Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

Commit

Permalink
Update command.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
HCastano committed Jan 3, 2022
1 parent 70b4c05 commit 4c1475b
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -210,8 +210,11 @@ pub fn run() -> Result<()> {
builder.with_profiling(sc_tracing::TracingReceiver::Log, "");
let _ = builder.init();

let block: Block =
generate_genesis_block(&load_spec(&params.chain.clone().unwrap_or_default())?)?;
let spec = load_spec(&params.chain.clone().unwrap_or_default())?;
let state_version = Cli::native_runtime_version(&spec).state_version();

let block: Block = generate_genesis_block(&spec, state_version)?;

let raw_header = block.header().encode();
let output_buf = if params.raw {
raw_header
Expand Down Expand Up @@ -293,8 +296,11 @@ pub fn run() -> Result<()> {
let parachain_account =
AccountIdConversion::<polkadot_primitives::v0::AccountId>::into_account(&id);

let block: Block =
generate_genesis_block(&config.chain_spec).map_err(|e| format!("{:?}", e))?;
let state_version =
RelayChainCli::native_runtime_version(&config.chain_spec).state_version();
let block: Block = generate_genesis_block(&config.chain_spec, state_version)
.map_err(|e| format!("{:?}", e))?;

let genesis_state = format!("0x{:?}", HexDisplay::from(&block.header().encode()));

let tokio_handle = config.tokio_handle.clone();
Expand Down Expand Up @@ -370,11 +376,24 @@ impl CliConfiguration<Self> for RelayChainCli {
self.base.base.rpc_ws(default_listen_port)
}

fn prometheus_config(&self, default_listen_port: u16) -> Result<Option<PrometheusConfig>> {
self.base.base.prometheus_config(default_listen_port)
fn prometheus_config(
&self,
default_listen_port: u16,
chain_spec: &Box<dyn ChainSpec>,
) -> Result<Option<PrometheusConfig>> {
self.base.base.prometheus_config(default_listen_port, chain_spec)
}

fn init<C: SubstrateCli>(&self) -> Result<()> {
fn init<F>(
&self,
_support_url: &String,
_impl_version: &String,
_logger_hook: F,
_config: &sc_service::Configuration,
) -> Result<()>
where
F: FnOnce(&mut sc_cli::LoggerBuilder, &sc_service::Configuration),
{
unreachable!("PolkadotCli is never initialized; qed");
}

Expand Down

0 comments on commit 4c1475b

Please sign in to comment.