MCPcopy Create free account
hub / github.com/SeismicSystems/summit / run_node_inner

Function run_node_inner

node/src/args.rs:229–429  ·  view source on GitHub ↗
(
    context: tokio::Context,
    flags: RunFlags,
    key_store: KeyStore<PrivateKey>,
    loaded: LoadedCheckpoint<MultisigScheme>,
)

Source from the content-addressed store, hash-verified

227
228 /// Observer mode: RPC-only node that follows the chain without proposing or voting on blocks.
229 /// The value is a derivation index that produces a distinct identity from the base node key.
230 #[arg(long)]
231 pub observer: Option<u32>,
232
233 /// Hard cap on unique deferred notarized blocks while the execution layer is SYNCING.
234 #[arg(long, default_value_t = FINALIZER_PENDING_NOTARIZED_MAX)]
235 pub finalizer_pending_notarized_max: usize,
236}
237
238impl Command {
239 pub fn exec(&self) {
240 match self {
241 Command::Run { flags } => self.run_node(flags),
242 Command::DepositRpc { flags } => self.run_deposit_rpc(flags),
243 Command::Keys(cmd) => cmd.exec(),
244
245 Command::Genesis(cmd) => cmd.exec(),
246 }
247 }
248
249 fn run_deposit_rpc(&self, flags: &DepositRpcFlags) {
250 let _critical_log_guard = crate::telemetry::init(Level::INFO, None);
251 let genesis = Genesis::load_from_file(&flags.genesis_path)
252 .unwrap_or_else(|e| panic!("Failed to load genesis file: {e}"));
253
254 // Validate that both validator keys are present before accepting requests.
255 let _key_store = expect_key_store(&flags.key_store_path);
256
257 let key_store_path = flags.key_store_path.clone();
258 let genesis_hash = genesis.genesis_hash();
259 let namespace = genesis.namespace.into_bytes();
260 let port = flags.port;
261 let executor = tokio::Runner::default();
262
263 executor.start(|context| async move {
264 start_deposit_rpc_server(
265 key_store_path,
266 genesis_hash,
267 namespace,
268 port,
269 RpcBodyLimits::default(),
270 context.stopped(),
271 )
272 .await
273 .unwrap_or_else(|e| panic!("Deposit RPC server failed: {e}"));
274 });
275 }
276
277 pub fn run_node(&self, flags: &RunFlags) {
278 // Initialize tokio-console subscriber if feature is enabled
279 #[cfg(feature = "tokio-console")]
280 {
281 console_subscriber::init();
282 }
283
284 let loaded = if let Some(checkpoint_path) = &flags.checkpoint_path {
285 read_checkpoint::<MultisigScheme>(checkpoint_path, flags.checkpoint_or_default)
286 } else {

Callers 1

run_nodeMethod · 0.85

Calls 15

verify_checkpoint_chainFunction · 0.85
get_expanded_pathFunction · 0.85
get_node_ipFunction · 0.85
start_network_and_engineFunction · 0.85
spawnMethod · 0.80
get_validatorsMethod · 0.80
cmpMethod · 0.80
public_keyMethod · 0.80
iterMethod · 0.80
pushMethod · 0.80
serveMethod · 0.80

Tested by

no test coverage detected