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

Function get_node_flags

node/src/bin/stake_and_checkpoint.rs:680–704  ·  view source on GitHub ↗
(node: usize, genesis_path: &str)

Source from the content-addressed store, hash-verified

678 let src_path = entry.path();
679 let dst_path = PathBuf::from(dst).join(entry.file_name());
680
681 if ty.is_dir() {
682 copy_dir_all(
683 src_path.to_str().expect("Invalid path"),
684 dst_path.to_str().expect("Invalid path"),
685 )?;
686 } else {
687 fs::copy(&src_path, &dst_path)?;
688 }
689 }
690 Ok(())
691}
692
693async fn get_latest_height(rpc_port: u16) -> Result<u64, Box<dyn std::error::Error>> {
694 let url = format!("http://localhost:{}", rpc_port);
695 let client = HttpClientBuilder::default().build(&url)?;
696 let height = client.get_latest_height().await?;
697 Ok(height)
698}
699
700async fn get_latest_checkpoint(
701 rpc_port: u16,
702) -> Result<Option<Checkpoint>, Box<dyn std::error::Error>> {
703 let url = format!("http://localhost:{}", rpc_port);
704 let client = HttpClientBuilder::default().build(&url)?;
705
706 match client.get_latest_checkpoint().await {
707 Ok(checkpoint_resp) => {

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected