Skip to content

Commit

Permalink
fix: start_primary
Browse files Browse the repository at this point in the history
  • Loading branch information
joske committed Nov 2, 2023
1 parent ca1f7bb commit 471b7a5
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions node/bft/examples/simple_node.rs
Expand Up @@ -169,17 +169,24 @@ pub async fn start_bft(

/// Starts the primary instance.
pub async fn start_primary(
_node_id: u16,
_num_nodes: u16,
_peers: HashMap<u16, SocketAddr>,
node_id: u16,
num_nodes: u16,
peers: HashMap<u16, SocketAddr>,
) -> Result<(Primary<CurrentNetwork>, PrimarySender<CurrentNetwork>)> {
/*
// Initialize the primary channels.
let (sender, receiver) = init_primary_channels();
// Initialize the components.
let (committee, account) = initialize_components(node_id, num_nodes)?;
// Initialize the mock ledger service.
let ledger = Arc::new(MockLedgerService::new(committee));
let gen_key = account.private_key();
let public_balance_per_validator =
(1_500_000_000_000_000 - (num_nodes as u64) * 1_000_000_000_000) / (num_nodes as u64);
let mut balances = IndexMap::<Address<CurrentNetwork>, u64>::new();
for address in committee.members().keys() {
balances.insert(*address, public_balance_per_validator);
}
let mut rng = TestRng::default();
let gen_ledger = genesis_ledger(*gen_key, committee.clone(), balances.clone(), &mut rng);
let ledger = Arc::new(TranslucentLedgerService::new(gen_ledger));
// Initialize the storage.
let storage = Storage::new(ledger.clone(), MAX_GC_ROUNDS);
// Initialize the gateway IP and dev mode.
Expand All @@ -197,8 +204,6 @@ pub async fn start_primary(
handle_signals(&primary);
// Return the primary instance.
Ok((primary, sender))
*/
todo!()
}

pub type CurrentLedger = Ledger<CurrentNetwork, ConsensusMemory<CurrentNetwork>>;
Expand Down

0 comments on commit 471b7a5

Please sign in to comment.