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

Function get_node_flags

node/src/bin/protocol_params.rs:393–417  ·  view source on GitHub ↗
(node: usize, genesis_path: &str)

Source from the content-addressed store, hash-verified

391 }
392 Err(e) => panic!("Error sending transaction: {}", e),
393 }
394}
395
396async fn get_latest_height(rpc_port: u16) -> Result<u64, Box<dyn std::error::Error>> {
397 let url = format!("http://localhost:{}", rpc_port);
398 let client = HttpClientBuilder::default().build(&url)?;
399 let height = client.get_latest_height().await?;
400 Ok(height)
401}
402
403fn get_node_flags(node: usize, genesis_path: &str) -> RunFlags {
404 let path = format!("testnet/node{node}/");
405
406 RunFlags {
407 key_store_path: path.clone(),
408 store_path: format!("{path}db"),
409 port: (26600 + (node * 10)) as u16,
410 prom_port: (28600 + (node * 10)) as u16,
411 prom_ip: "0.0.0.0".into(),
412 rpc_ip: "0.0.0.0".into(),
413 rpc_port: (3030 + (node * 10)) as u16,
414 admin_rpc_port: (3031 + (node * 10)) as u16,
415 rpc_max_request_body_size: summit_rpc::DEFAULT_RPC_BODY_LIMIT_BYTES,
416 rpc_max_response_body_size: summit_rpc::DEFAULT_RPC_BODY_LIMIT_BYTES,
417 rpc_request_timeout_secs: summit_rpc::DEFAULT_RPC_REQUEST_TIMEOUT_SECS,
418 rpc_max_batch_size: summit_rpc::DEFAULT_RPC_MAX_BATCH_SIZE,
419 worker_threads: Some(2),
420 log_level: "debug".into(),

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected