Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

help text examples + clean up #2418

Merged
merged 12 commits into from
Apr 1, 2023
Merged
Show file tree
Hide file tree
Changes from 11 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions client/relay-chain-minimal-node/src/collator_overseer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ fn build_overseer<'a>(
.collation_generation(CollationGenerationSubsystem::new(Metrics::register(registry)?))
.collator_protocol({
let side = ProtocolSide::Collator(
network_service.local_peer_id().clone(),
network_service.local_peer_id(),
collator_pair,
collation_req_receiver,
Metrics::register(registry)?,
Expand All @@ -129,8 +129,8 @@ fn build_overseer<'a>(
peer_set_protocol_names.clone(),
))
.network_bridge_tx(NetworkBridgeTxSubsystem::new(
network_service.clone(),
authority_discovery_service.clone(),
network_service,
authority_discovery_service,
network_bridge_metrics,
req_protocol_names,
peer_set_protocol_names,
Expand Down Expand Up @@ -170,7 +170,7 @@ pub(crate) fn spawn_overseer(
e
})?;

let overseer_handle = Handle::new(overseer_handle.clone());
let overseer_handle = Handle::new(overseer_handle);
{
let handle = overseer_handle.clone();
task_manager.spawn_essential_handle().spawn_blocking(
Expand Down
9 changes: 5 additions & 4 deletions client/relay-chain-minimal-node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ fn build_authority_discovery_service<Block: BlockT>(
network.clone(),
Box::pin(dht_event_stream),
authority_discovery_role,
prometheus_registry.clone(),
prometheus_registry,
);

task_manager.spawn_handle().spawn(
Expand Down Expand Up @@ -150,9 +150,10 @@ async fn new_minimal_relay_chain(
let (collation_req_receiver, available_data_req_receiver) =
build_request_response_protocol_receivers(&request_protocol_names, &mut config);

let best_header = relay_chain_rpc_client.chain_get_header(None).await?.ok_or_else(|| {
RelayChainError::RpcCallError("Unable to fetch best header".to_string().into())
})?;
let best_header = relay_chain_rpc_client
.chain_get_header(None)
.await?
.ok_or_else(|| RelayChainError::RpcCallError("Unable to fetch best header".to_string()))?;
let (network, network_starter, sync_oracle) =
build_collator_network(&config, task_manager.spawn_handle(), genesis_hash, best_header)
.map_err(|e| RelayChainError::Application(Box::new(e) as Box<_>))?;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ impl ReconnectingWebsocketWorker {
}

if client_manager.connect_to_new_rpc_server().await.is_err() {
return Err(format!("Unable to find valid external RPC server, shutting down."))
return Err("Unable to find valid external RPC server, shutting down.".to_string())
};

for item in requests_to_retry.into_iter() {
Expand Down
3 changes: 2 additions & 1 deletion parachain-template/node/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ substrate-prometheus-endpoint = { git = "https://github.com/paritytech/substrate
try-runtime-cli = { git = "https://github.com/paritytech/substrate", branch = "master", optional = true }

# Polkadot
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "master" }
polkadot-cli = { git = "https://github.com/paritytech/polkadot", branch = "master", features = ["rococo-native"] }
polkadot-primitives = { git = "https://github.com/paritytech/polkadot", branch = "master" }
xcm = { git = "https://github.com/paritytech/polkadot", default-features = false, branch = "master" }

Expand All @@ -64,6 +64,7 @@ cumulus-client-service = { path = "../../client/service" }
cumulus-primitives-core = { path = "../../primitives/core" }
cumulus-primitives-parachain-inherent = { path = "../../primitives/parachain-inherent" }
cumulus-relay-chain-interface = { path = "../../client/relay-chain-interface" }
color-print = "0.3.4"

[build-dependencies]
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }
Expand Down
13 changes: 13 additions & 0 deletions parachain-template/node/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,25 @@ pub enum Subcommand {
TryRuntime,
}

const AFTER_HELP_EXAMPLE: &str = color_print::cstr!(
r#"<bold><underline>Examples:</></>
<bold>parachain-template-node build-spec --disable-default-bootnode > plain-parachain-chainspec.json</>
Export a chainspec for a local testnet in json format.
<bold>parachain-template-node --chain plain-parachain-chainspec.json --tmp -- --chain rococo-local</>
Launch a full node with chain specification loaded from plain-parachain-chainspec.json.
<bold>parachain-template-node</>
Launch a full node with default parachain <italic>local-testnet</> and relay chain <italic>rococo-local</>.
<bold>parachain-template-node --collator</>
Launch a collator with default parachain <italic>local-testnet</> and relay chain <italic>rococo-local</>.
"#
);
#[derive(Debug, clap::Parser)]
#[command(
propagate_version = true,
args_conflicts_with_subcommands = true,
subcommand_negates_reqs = true
)]
#[clap(after_help = AFTER_HELP_EXAMPLE)]
pub struct Cli {
#[command(subcommand)]
pub subcommand: Option<Subcommand>,
Expand Down
1 change: 1 addition & 0 deletions polkadot-parachain/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ cumulus-client-service = { path = "../client/service" }
cumulus-primitives-core = { path = "../primitives/core" }
cumulus-primitives-parachain-inherent = { path = "../primitives/parachain-inherent" }
cumulus-relay-chain-interface = { path = "../client/relay-chain-interface" }
color-print = "0.3.4"

[build-dependencies]
substrate-build-script-utils = { git = "https://github.com/paritytech/substrate", branch = "master" }
Expand Down
10 changes: 10 additions & 0 deletions polkadot-parachain/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,22 @@ pub enum Subcommand {
TryRuntime,
}

const AFTER_HELP_EXAMPLE: &str = color_print::cstr!(
r#"<bold><underline>Examples:</></>
<bold>polkadot-parachain --chain statemint --sync warp -- --chain polkadot</>
skunert marked this conversation as resolved.
Show resolved Hide resolved
Launch a warp-syncing full node of the <italic>statemint</> parachain on the <italic>polkadot</> relay chain.
<bold>polkadot-parachain --chain statemint --sync warp --relay-chain-rpc-url ws://rpc.example.com -- --chain polkadot</>
Launch a warp-syncing full node of the <italic>statemint</> parachain on the <italic>polkadot</> relay chain.
Uses <italic>ws://rpc.example.com</> as remote relay chain node.
"#
);
#[derive(Debug, clap::Parser)]
#[command(
propagate_version = true,
args_conflicts_with_subcommands = true,
subcommand_negates_reqs = true
)]
#[clap(after_help = AFTER_HELP_EXAMPLE)]
pub struct Cli {
#[command(subcommand)]
pub subcommand: Option<Subcommand>,
Expand Down