MCPcopy Create free account
hub / github.com/base/base / keypair

Method keypair

crates/consensus/cli/src/bootnode.rs:281–289  ·  view source on GitHub ↗

Loads the libp2p keypair for the bootnode.

(&self, chain_id: u64)

Source from the content-addressed store, hash-verified

279
280 /// Loads the libp2p keypair for the bootnode.
281 pub fn keypair(&self, chain_id: u64) -> eyre::Result<Keypair> {
282 if let Some(mut private_key) = self.private_key {
283 return SecretKeyLoader::parse(&mut private_key.0).map_err(Into::into);
284 }
285
286 let key_path = self.priv_path.clone().unwrap_or_else(|| Self::default_key_path(chain_id));
287 info!(target: "rollup_node::bootnode", path = %key_path.display(), "Using bootnode P2P key path");
288 SecretKeyLoader::load(&key_path).map_err(Into::into)
289 }
290
291 /// Returns the default key path for the given chain.
292 pub fn default_key_path(chain_id: u64) -> PathBuf {

Callers 2

discovery_driverMethod · 0.45
local_enrMethod · 0.45

Calls 2

parseFunction · 0.85
cloneMethod · 0.45

Tested by

no test coverage detected