mirror of
https://github.com/hl-archive-node/nanoreth.git
synced 2025-12-06 10:59:55 +00:00
fix(node): insert genesis on node startup (#909)
This commit is contained in:
@ -12,6 +12,7 @@ use clap::{crate_version, Parser};
|
||||
use eyre::Context;
|
||||
use fdlimit::raise_fd_limit;
|
||||
use futures::{stream::select as stream_select, Stream, StreamExt};
|
||||
use reth_cli_utils::init::init_genesis;
|
||||
use reth_consensus::BeaconConsensus;
|
||||
use reth_downloaders::{bodies, headers};
|
||||
use reth_interfaces::consensus::ForkchoiceState;
|
||||
@ -114,6 +115,9 @@ impl Command {
|
||||
HeaderMetrics::describe();
|
||||
}
|
||||
|
||||
let genesis = init_genesis(db.clone(), self.chain.genesis().clone())?;
|
||||
info!(target: "reth::cli", ?genesis, "Inserted genesis");
|
||||
|
||||
let consensus: Arc<BeaconConsensus> = Arc::new(BeaconConsensus::new(self.chain.clone()));
|
||||
|
||||
let network = config
|
||||
|
||||
@ -81,6 +81,11 @@ impl ChainSpec {
|
||||
self.chain
|
||||
}
|
||||
|
||||
/// Return genesis block
|
||||
pub fn genesis(&self) -> &Genesis {
|
||||
&self.genesis
|
||||
}
|
||||
|
||||
/// Returns the chain genesis hash
|
||||
pub fn genesis_hash(&self) -> H256 {
|
||||
self.genesis_hash
|
||||
|
||||
Reference in New Issue
Block a user