mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 03:31:05 +00:00
* WIP * WIP * WIP * WIP * WIP * WIP * Update node/service/src/lib.rs Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> * WIP * "Update Substrate" Co-authored-by: Bastian Köcher <bkchr@users.noreply.github.com> Co-authored-by: parity-processbot <>
This commit is contained in:
Generated
+339
-177
File diff suppressed because it is too large
Load Diff
@@ -6,6 +6,7 @@ use polkadot_primitives::v1::{
|
|||||||
Block, Hash, Header,
|
Block, Hash, Header,
|
||||||
};
|
};
|
||||||
use sc_block_builder::{BlockBuilderApi, BlockBuilderProvider};
|
use sc_block_builder::{BlockBuilderApi, BlockBuilderProvider};
|
||||||
|
use sp_core::traits::SpawnNamed;
|
||||||
use sp_api::{ApiExt, ProvideRuntimeApi};
|
use sp_api::{ApiExt, ProvideRuntimeApi};
|
||||||
use sp_blockchain::HeaderBackend;
|
use sp_blockchain::HeaderBackend;
|
||||||
use sp_consensus::{Proposal, RecordProof};
|
use sp_consensus::{Proposal, RecordProof};
|
||||||
@@ -25,12 +26,14 @@ pub struct ProposerFactory<TxPool, Backend, Client> {
|
|||||||
|
|
||||||
impl<TxPool, Backend, Client> ProposerFactory<TxPool, Backend, Client> {
|
impl<TxPool, Backend, Client> ProposerFactory<TxPool, Backend, Client> {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
|
spawn_handle: impl SpawnNamed + 'static,
|
||||||
client: Arc<Client>,
|
client: Arc<Client>,
|
||||||
transaction_pool: Arc<TxPool>,
|
transaction_pool: Arc<TxPool>,
|
||||||
overseer: OverseerHandler,
|
overseer: OverseerHandler,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
ProposerFactory {
|
ProposerFactory {
|
||||||
inner: sc_basic_authorship::ProposerFactory::new(
|
inner: sc_basic_authorship::ProposerFactory::new(
|
||||||
|
spawn_handle,
|
||||||
client,
|
client,
|
||||||
transaction_pool,
|
transaction_pool,
|
||||||
None,
|
None,
|
||||||
|
|||||||
@@ -446,6 +446,7 @@ pub fn new_full<RuntimeApi, Executor>(
|
|||||||
consensus_common::CanAuthorWithNativeVersion::new(client.executor().clone());
|
consensus_common::CanAuthorWithNativeVersion::new(client.executor().clone());
|
||||||
|
|
||||||
let proposer = ProposerFactory::new(
|
let proposer = ProposerFactory::new(
|
||||||
|
task_manager.spawn_handle(),
|
||||||
client.clone(),
|
client.clone(),
|
||||||
transaction_pool,
|
transaction_pool,
|
||||||
overseer_handler.clone(),
|
overseer_handler.clone(),
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ inherents = { package = "sp-inherents", git = "https://github.com/paritytech/sub
|
|||||||
pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
pallet-staking = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
pallet-transaction-payment = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-chain-spec = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
|
sc-cli = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-client-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-consensus = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
sc-executor = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ native_executor_instance!(
|
|||||||
);
|
);
|
||||||
|
|
||||||
/// Create a new Polkadot test service for a full node.
|
/// Create a new Polkadot test service for a full node.
|
||||||
|
#[sc_cli::prefix_logs_with(config.network.node_name.as_str())]
|
||||||
pub fn polkadot_test_new_full(
|
pub fn polkadot_test_new_full(
|
||||||
config: Configuration,
|
config: Configuration,
|
||||||
authority_discovery_disabled: bool,
|
authority_discovery_disabled: bool,
|
||||||
@@ -112,14 +113,13 @@ pub fn node_config(
|
|||||||
spec.set_storage(storage);
|
spec.set_storage(storage);
|
||||||
|
|
||||||
let mut network_config = NetworkConfiguration::new(
|
let mut network_config = NetworkConfiguration::new(
|
||||||
format!("Polkadot Test Node for: {}", key_seed),
|
key_seed.to_string(),
|
||||||
"network/test/0.1",
|
"network/test/0.1",
|
||||||
Default::default(),
|
Default::default(),
|
||||||
None,
|
None,
|
||||||
);
|
);
|
||||||
let informant_output_format = OutputFormat {
|
let informant_output_format = OutputFormat {
|
||||||
enable_color: false,
|
enable_color: false,
|
||||||
prefix: format!("[{}] ", key_seed),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
network_config.boot_nodes = boot_nodes;
|
network_config.boot_nodes = boot_nodes;
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ use std::{
|
|||||||
use sp_blockchain::HeaderBackend;
|
use sp_blockchain::HeaderBackend;
|
||||||
use block_builder::{BlockBuilderApi, BlockBuilderProvider};
|
use block_builder::{BlockBuilderApi, BlockBuilderProvider};
|
||||||
use consensus::{Proposal, RecordProof};
|
use consensus::{Proposal, RecordProof};
|
||||||
|
use primitives::traits::SpawnNamed;
|
||||||
use polkadot_primitives::v0::{NEW_HEADS_IDENTIFIER, Block, Header, AttestedCandidate};
|
use polkadot_primitives::v0::{NEW_HEADS_IDENTIFIER, Block, Header, AttestedCandidate};
|
||||||
use runtime_primitives::traits::{DigestFor, HashFor};
|
use runtime_primitives::traits::{DigestFor, HashFor};
|
||||||
use txpool_api::TransactionPool;
|
use txpool_api::TransactionPool;
|
||||||
@@ -47,11 +48,13 @@ pub struct ProposerFactory<Client, TxPool, Backend> {
|
|||||||
impl<Client, TxPool, Backend> ProposerFactory<Client, TxPool, Backend> {
|
impl<Client, TxPool, Backend> ProposerFactory<Client, TxPool, Backend> {
|
||||||
/// Create a new proposer factory.
|
/// Create a new proposer factory.
|
||||||
pub fn new(
|
pub fn new(
|
||||||
|
spawn_handle: Box<dyn SpawnNamed>,
|
||||||
client: Arc<Client>,
|
client: Arc<Client>,
|
||||||
transaction_pool: Arc<TxPool>,
|
transaction_pool: Arc<TxPool>,
|
||||||
prometheus: Option<&PrometheusRegistry>,
|
prometheus: Option<&PrometheusRegistry>,
|
||||||
) -> Self {
|
) -> Self {
|
||||||
let factory = sc_basic_authorship::ProposerFactory::new(
|
let factory = sc_basic_authorship::ProposerFactory::new(
|
||||||
|
spawn_handle,
|
||||||
client,
|
client,
|
||||||
transaction_pool,
|
transaction_pool,
|
||||||
prometheus,
|
prometheus,
|
||||||
|
|||||||
Reference in New Issue
Block a user