Skip to content

Commit

Permalink
sui: remove make_sever function
Browse files Browse the repository at this point in the history
  • Loading branch information
bmwill committed May 27, 2022
1 parent a2ac3ee commit 9d7ccc7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 36 deletions.
36 changes: 1 addition & 35 deletions crates/sui/src/make.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@

use anyhow::{anyhow, Result};
use futures::future::join_all;
use parking_lot::Mutex;
use std::collections::BTreeMap;
use std::path::PathBuf;
use std::sync::Arc;
use std::time::Duration;
use sui_config::NetworkConfig;
use sui_config::NodeConfig;
use sui_core::authority::{AuthorityState, AuthorityStore};
use sui_core::authority::AuthorityState;
use sui_core::authority_active::ActiveAuthority;
use sui_core::authority_client::NetworkAuthorityClient;
use sui_core::authority_server::AuthorityServer;
use sui_core::checkpoints::CheckpointStore;
use sui_core::consensus_adapter::ConsensusListener;
use sui_node::SuiNode;
use tokio::sync::mpsc::channel;
Expand Down Expand Up @@ -64,37 +61,6 @@ impl SuiNetwork {
}
}

pub async fn make_server(validator_config: &NodeConfig) -> Result<AuthorityServer> {
let mut store_path = PathBuf::from(validator_config.db_path());
store_path.push("store");
let store = Arc::new(AuthorityStore::open(store_path, None));
let name = validator_config.public_key();
let mut checkpoints_path = PathBuf::from(validator_config.db_path());
checkpoints_path.push("checkpoints");

let secret = Arc::pin(validator_config.key_pair().copy());
let checkpoints = CheckpointStore::open(
&checkpoints_path,
None,
name,
validator_config.committee_config().committee(),
secret.clone(),
)?;

let state = AuthorityState::new(
validator_config.committee_config().committee(),
name,
secret.clone(),
store,
None,
Some(Arc::new(Mutex::new(checkpoints))),
validator_config.genesis(),
)
.await;

make_authority(validator_config, state).await
}

/// Spawn all the subsystems run by a Sui authority: a consensus node, a sui authority server,
/// and a consensus listener bridging the consensus node and the sui authority.
pub async fn make_authority(
Expand Down
2 changes: 1 addition & 1 deletion crates/sui/src/sui_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use sui_types::base_types::decode_bytes_hex;
use sui_types::base_types::SuiAddress;
use tracing::info;

pub use crate::make::{make_authority, make_server, SuiNetwork};
pub use crate::make::{make_authority, SuiNetwork};

#[derive(Parser)]
#[clap(rename_all = "kebab-case")]
Expand Down

0 comments on commit 9d7ccc7

Please sign in to comment.