Skip to content

Commit

Permalink
default event processing to true for fullnode.yaml (#6783)
Browse files Browse the repository at this point in the history
start fullnode with event processing in sui start
  • Loading branch information
patrickkuo authored and ebmifa committed Dec 16, 2022
1 parent 4685f9d commit a8af20d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions crates/sui-swarm/src/memory/swarm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ pub struct SwarmBuilder<R = OsRng> {
initial_accounts_config: Option<GenesisConfig>,
fullnode_count: usize,
fullnode_rpc_addr: Option<SocketAddr>,
with_event_store: bool,
}

impl SwarmBuilder {
Expand All @@ -38,6 +39,7 @@ impl SwarmBuilder {
initial_accounts_config: None,
fullnode_count: 0,
fullnode_rpc_addr: None,
with_event_store: false,
}
}
}
Expand All @@ -51,6 +53,7 @@ impl<R> SwarmBuilder<R> {
initial_accounts_config: self.initial_accounts_config,
fullnode_count: self.fullnode_count,
fullnode_rpc_addr: self.fullnode_rpc_addr,
with_event_store: false,
}
}

Expand Down Expand Up @@ -144,6 +147,11 @@ impl<R: rand::RngCore + rand::CryptoRng> SwarmBuilder<R> {
}
}

pub fn with_event_store(mut self) -> Self {
self.with_event_store = true;
self
}

pub fn from_network_config(self, dir: PathBuf, network_config: NetworkConfig) -> Swarm {
let dir = SwarmDirectory::Persistent(dir);

Expand All @@ -156,6 +164,7 @@ impl<R: rand::RngCore + rand::CryptoRng> SwarmBuilder<R> {
let fullnodes = if let Some(fullnode_rpc_addr) = self.fullnode_rpc_addr {
let mut config = network_config
.fullnode_config_builder()
.set_event_store(self.with_event_store)
.with_random_dir()
.build()
.unwrap();
Expand Down
2 changes: 2 additions & 0 deletions crates/sui/src/sui_commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ impl SuiCommand {
} else {
Swarm::builder()
.with_fullnode_rpc_addr(sui_config::node::default_json_rpc_address())
.with_event_store()
}
.from_network_config(sui_config_dir()?, network_config);

Expand Down Expand Up @@ -341,6 +342,7 @@ async fn genesis(

let mut fullnode_config = network_config
.fullnode_config_builder()
.with_event_store()
.with_dir(FULL_NODE_DB_PATH.into())
.build()?;

Expand Down

0 comments on commit a8af20d

Please sign in to comment.