Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

Commit

Permalink
make parachain-template-node build
Browse files Browse the repository at this point in the history
  • Loading branch information
Agusrodri committed Jun 16, 2023
1 parent 72ca83f commit 8f4e435
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
6 changes: 3 additions & 3 deletions parachain-template/node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,10 @@ impl RelayChainCli {
let chain_id = extension.map(|e| e.relay_chain.clone());
let base_path = para_config
.base_path
.as_ref()
.map(|x| x.path().join("polkadot"));
.path()
.join("polkadot");
Self {
base_path,
base_path: Some(base_path),
chain_id,
base: clap::Parser::parse_from(relay_chain_args),
}
Expand Down
12 changes: 10 additions & 2 deletions parachain-template/node/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use polkadot_service::CollatorPair;
use sc_consensus::ImportQueue;
use sc_consensus_manual_seal::{run_instant_seal, InstantSealParams};
use sc_executor::NativeElseWasmExecutor;
use sc_network::NetworkBlock;
use sc_network::{NetworkBlock, config::FullNetworkConfiguration};
use sc_network_sync::SyncingService;
use sc_service::{Configuration, PartialComponents, TFullBackend, TFullClient, TaskManager};
use sc_telemetry::{Telemetry, TelemetryHandle, TelemetryWorker, TelemetryWorkerHandle};
Expand Down Expand Up @@ -281,6 +281,8 @@ where
let transaction_pool = params.transaction_pool.clone();
let import_queue_service = params.import_queue.service();

let net_config = FullNetworkConfiguration::new(&parachain_config.network);

let (network, system_rpc_tx, tx_handler_controller, start_network, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &parachain_config,
Expand All @@ -292,6 +294,7 @@ where
Box::new(block_announce_validator)
})),
warp_sync_params: None,
net_config
})?;

let rpc_extensions_builder = {
Expand Down Expand Up @@ -343,7 +346,7 @@ where
&task_manager,
relay_chain_interface.clone(),
transaction_pool,
sync_service,
sync_service.clone(),
params.keystore_container.keystore(),
force_authoring,
)?;
Expand All @@ -363,6 +366,7 @@ where
recovery_handle: Box::new(overseer_handle),
collator_key: collator_key.expect("Command line arguments do not allow this. qed"),
relay_chain_slot_duration,
sync_service
};

start_collator(params).await?;
Expand All @@ -376,6 +380,7 @@ where
relay_chain_slot_duration,
import_queue: import_queue_service,
recovery_handle: Box::new(overseer_handle),
sync_service
};

start_full_node(params)?;
Expand Down Expand Up @@ -477,6 +482,8 @@ pub fn start_instant_seal_node(config: Configuration) -> Result<TaskManager, sc_
other: (mut telemetry, _),
} = new_partial::<RuntimeApi, TemplateRuntimeExecutor>(&config, false)?;

let net_config = FullNetworkConfiguration::new(&config.network);

let (network, system_rpc_tx, tx_handler_controller, network_starter, sync_service) =
sc_service::build_network(sc_service::BuildNetworkParams {
config: &config,
Expand All @@ -486,6 +493,7 @@ pub fn start_instant_seal_node(config: Configuration) -> Result<TaskManager, sc_
import_queue,
block_announce_validator_builder: None,
warp_sync_params: None,
net_config
})?;

if config.offchain_worker.enabled {
Expand Down

0 comments on commit 8f4e435

Please sign in to comment.