Skip to content

Commit

Permalink
replace new_dev by start_dev_node + remove async
Browse files Browse the repository at this point in the history
  • Loading branch information
nanocryk committed Nov 7, 2023
1 parent f3e7dbc commit 0355595
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 393 deletions.
14 changes: 9 additions & 5 deletions client/node-common/src/service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,14 @@ where
{
/// Create a new `NodeBuilder` which prepare objects required to launch a
/// node. However it doesn't start anything, and doesn't provide any
/// cumulus-dependent objects (as it requires an import queue, which usually
/// network-dependent objects (as it requires an import queue, which usually
/// is different for each node).
pub async fn new(
#[must_use]
pub fn new(
parachain_config: &Configuration,
hwbench: Option<sc_sysinfo::HwBench>,
) -> Result<Self, sc_service::Error> {
// Refactor: old new_partial + build_relay_chain_interface
// Refactor: old new_partial

let telemetry = parachain_config
.telemetry_endpoints
Expand Down Expand Up @@ -233,6 +234,7 @@ where
+ BlockBuilder<Block>
+ cumulus_primitives_core::CollectCollationInfo<Block>,
{
#[must_use]
pub async fn build_relay_chain_interface(
&mut self,
parachain_config: &Configuration,
Expand All @@ -259,6 +261,7 @@ where
///
/// Can only be called once on a `NodeBuilder` that doesn't have yet network
/// data.
#[must_use]
pub async fn build_cumulus_network<RCInterface>(
self,
parachain_config: &Configuration,
Expand Down Expand Up @@ -329,11 +332,12 @@ where
})
}

/// Given an import queue, calls `cumulus_client_service::build_network` and
/// Given an import queue, calls `sc_service::build_network` and
/// stores the returned objects in `self.network` and `self.tx_handler_controller`.
///
/// Can only be called once on a `NodeBuilder` that doesn't have yet network
/// data.
#[must_use]
pub fn build_substrate_network(
self,
parachain_config: &Configuration,
Expand Down Expand Up @@ -399,7 +403,7 @@ where
})
}

/// Given an `rpc_builder`, spawns the common tasks of a Substrate + Cumulus
/// Given an `rpc_builder`, spawns the common tasks of a Substrate
/// node. It consumes `self.tx_handler_controller` in the process, which means
/// it can only be called once, and any other code that would need this
/// controller should interact with it before calling this function.
Expand Down
2 changes: 1 addition & 1 deletion node/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ pub fn run() -> Result<()> {
config.chain_spec.is_dev() || relay_chain_id == Some("dev-service".to_string()) || cli.run.dev_service;

if dev_service {
return crate::service::new_dev(config, cli.run.sealing, hwbench, id).map_err(Into::into)
return crate::service::start_dev_node(config, cli.run.sealing, hwbench, id).map_err(Into::into)
}

let parachain_account =
Expand Down
Loading

0 comments on commit 0355595

Please sign in to comment.