mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 22:11:02 +00:00
Update Polkadot & Substrate (#300)
This commit is contained in:
@@ -24,7 +24,7 @@ use log::info;
|
||||
use parachain_runtime::Block;
|
||||
use polkadot_parachain::primitives::AccountIdConversion;
|
||||
use sc_cli::{
|
||||
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams, InitLoggerParams,
|
||||
ChainSpec, CliConfiguration, DefaultConfigurationValues, ImportParams,
|
||||
KeystoreParams, NetworkParams, Result, RuntimeVersion, SharedParams, SubstrateCli,
|
||||
};
|
||||
use sc_service::{
|
||||
@@ -217,10 +217,9 @@ pub fn run() -> Result<()> {
|
||||
})
|
||||
}
|
||||
Some(Subcommand::ExportGenesisState(params)) => {
|
||||
sc_cli::init_logger(InitLoggerParams {
|
||||
tracing_receiver: sc_tracing::TracingReceiver::Log,
|
||||
..Default::default()
|
||||
})?;
|
||||
let mut builder = sc_cli::GlobalLoggerBuilder::new("");
|
||||
builder.with_profiling(sc_tracing::TracingReceiver::Log, "");
|
||||
let _ = builder.init();
|
||||
|
||||
let block: Block = generate_genesis_block(&load_spec(
|
||||
¶ms.chain.clone().unwrap_or_default(),
|
||||
@@ -242,10 +241,9 @@ pub fn run() -> Result<()> {
|
||||
Ok(())
|
||||
}
|
||||
Some(Subcommand::ExportGenesisWasm(params)) => {
|
||||
sc_cli::init_logger(InitLoggerParams {
|
||||
tracing_receiver: sc_tracing::TracingReceiver::Log,
|
||||
..Default::default()
|
||||
})?;
|
||||
let mut builder = sc_cli::GlobalLoggerBuilder::new("");
|
||||
builder.with_profiling(sc_tracing::TracingReceiver::Log, "");
|
||||
let _ = builder.init();
|
||||
|
||||
let raw_wasm_blob =
|
||||
extract_genesis_wasm(&cli.load_spec(¶ms.chain.clone().unwrap_or_default())?)?;
|
||||
@@ -292,9 +290,12 @@ pub fn run() -> Result<()> {
|
||||
let genesis_state = format!("0x{:?}", HexDisplay::from(&block.header().encode()));
|
||||
|
||||
let task_executor = config.task_executor.clone();
|
||||
let polkadot_config =
|
||||
SubstrateCli::create_configuration(&polkadot_cli, &polkadot_cli, task_executor)
|
||||
.map_err(|err| format!("Relay chain argument error: {}", err))?;
|
||||
let polkadot_config = SubstrateCli::create_configuration(
|
||||
&polkadot_cli,
|
||||
&polkadot_cli,
|
||||
task_executor,
|
||||
None,
|
||||
).map_err(|err| format!("Relay chain argument error: {}", err))?;
|
||||
let collator = cli.run.base.validator || cli.collator;
|
||||
|
||||
info!("Parachain id: {:?}", id);
|
||||
@@ -369,7 +370,7 @@ impl CliConfiguration<Self> for RelayChainCli {
|
||||
self.base.base.prometheus_config(default_listen_port)
|
||||
}
|
||||
|
||||
fn init<C: SubstrateCli>(&self) -> Result<()> {
|
||||
fn init<C: SubstrateCli>(&self) -> Result<sc_telemetry::TelemetryWorker> {
|
||||
unreachable!("PolkadotCli is never initialized; qed");
|
||||
}
|
||||
|
||||
|
||||
@@ -49,13 +49,13 @@ pub fn new_partial(
|
||||
(),
|
||||
sp_consensus::import_queue::BasicQueue<Block, PrefixedMemoryDB<BlakeTwo256>>,
|
||||
sc_transaction_pool::FullPool<Block, TFullClient<Block, RuntimeApi, Executor>>,
|
||||
(),
|
||||
Option<sc_telemetry::TelemetrySpan>,
|
||||
>,
|
||||
sc_service::Error,
|
||||
> {
|
||||
let inherent_data_providers = sp_inherents::InherentDataProviders::new();
|
||||
|
||||
let (client, backend, keystore_container, task_manager) =
|
||||
let (client, backend, keystore_container, task_manager, telemetry_span) =
|
||||
sc_service::new_full_parts::<Block, RuntimeApi, Executor>(&config)?;
|
||||
let client = Arc::new(client);
|
||||
|
||||
@@ -85,7 +85,7 @@ pub fn new_partial(
|
||||
transaction_pool,
|
||||
inherent_data_providers,
|
||||
select_chain: (),
|
||||
other: (),
|
||||
other: telemetry_span,
|
||||
};
|
||||
|
||||
Ok(params)
|
||||
@@ -94,7 +94,7 @@ pub fn new_partial(
|
||||
/// Start a node with the given parachain `Configuration` and relay chain `Configuration`.
|
||||
///
|
||||
/// This is the actual implementation that is abstract over the executor and the runtime api.
|
||||
#[sc_cli::prefix_logs_with("Parachain")]
|
||||
#[sc_tracing::logging::prefix_logs_with("Parachain")]
|
||||
async fn start_node_impl<RB>(
|
||||
parachain_config: Configuration,
|
||||
collator_key: CollatorPair,
|
||||
@@ -125,6 +125,7 @@ where
|
||||
)?;
|
||||
|
||||
let params = new_partial(¶chain_config)?;
|
||||
let telemetry_span = params.other;
|
||||
params
|
||||
.inherent_data_providers
|
||||
.register_provider(sp_timestamp::InherentDataProvider)
|
||||
@@ -164,18 +165,18 @@ where
|
||||
client: client.clone(),
|
||||
transaction_pool: transaction_pool.clone(),
|
||||
task_manager: &mut task_manager,
|
||||
telemetry_connection_sinks: Default::default(),
|
||||
config: parachain_config,
|
||||
keystore: params.keystore_container.sync_keystore(),
|
||||
backend: backend.clone(),
|
||||
network: network.clone(),
|
||||
network_status_sinks,
|
||||
system_rpc_tx,
|
||||
telemetry_span,
|
||||
})?;
|
||||
|
||||
let announce_block = {
|
||||
let network = network.clone();
|
||||
Arc::new(move |hash, data| network.announce_block(hash, data))
|
||||
Arc::new(move |hash, data| network.announce_block(hash, Some(data)))
|
||||
};
|
||||
|
||||
if validator {
|
||||
|
||||
Reference in New Issue
Block a user