pub struct RunCmd {Show 38 fields
pub validator: bool,
pub sentry: Vec<MultiaddrWithPeerId>,
pub no_grandpa: bool,
pub light: bool,
pub rpc_external: bool,
pub unsafe_rpc_external: bool,
pub rpc_methods: RpcMethods,
pub ws_external: bool,
pub unsafe_ws_external: bool,
pub prometheus_external: bool,
pub ipc_path: Option<String>,
pub rpc_port: Option<u16>,
pub ws_port: Option<u16>,
pub ws_max_connections: Option<usize>,
pub rpc_cors: Option<Cors>,
pub prometheus_port: Option<u16>,
pub no_prometheus: bool,
pub name: Option<String>,
pub no_telemetry: bool,
pub telemetry_endpoints: Vec<(String, u8)>,
pub offchain_worker_params: OffchainWorkerParams,
pub shared_params: SharedParams,
pub import_params: ImportParams,
pub network_params: NetworkParams,
pub pool_config: TransactionPoolParams,
pub alice: bool,
pub bob: bool,
pub charlie: bool,
pub dave: bool,
pub eve: bool,
pub ferdie: bool,
pub one: bool,
pub two: bool,
pub force_authoring: bool,
pub keystore_params: KeystoreParams,
pub max_runtime_instances: Option<usize>,
pub sentry_nodes: Vec<MultiaddrWithPeerId>,
pub tmp: bool,
}
Expand description
The run
command used to run a node.
Fields
validator: bool
Enable validator mode.
The node will be started with the authority role and actively participate in any consensus task that it can (e.g. depending on availability of local keys).
sentry: Vec<MultiaddrWithPeerId>
Enable sentry mode.
The node will be started with the authority role and participate in consensus tasks as an “observer”, it will never actively participate regardless of whether it could (e.g. keys are available locally). This mode is useful as a secure proxy for validators (which would run detached from the network), since we want this node to participate in the full consensus protocols in order to have all needed consensus data available to relay to private nodes.
no_grandpa: bool
Disable GRANDPA voter when running in validator mode, otherwise disable the GRANDPA observer.
light: bool
Experimental: Run in light client mode.
rpc_external: bool
Listen to all RPC interfaces.
Default is local. Note: not all RPC methods are safe to be exposed publicly. Use an RPC proxy
server to filter out dangerous methods. More details:
https://github.com/paritytech/substrate/wiki/Public-RPC.
Use --unsafe-rpc-external
to suppress the warning if you understand the risks.
unsafe_rpc_external: bool
Listen to all RPC interfaces.
Same as --rpc-external
.
rpc_methods: RpcMethods
RPC methods to expose.
Unsafe
: Exposes every RPC method.Safe
: Exposes only a safe subset of RPC methods, denying unsafe RPC methods.Auto
: Acts asSafe
if RPC is served externally, e.g. when--{rpc,ws}-external
is passed, otherwise acts asUnsafe
.
ws_external: bool
Listen to all Websocket interfaces.
Default is local. Note: not all RPC methods are safe to be exposed publicly. Use an RPC proxy
server to filter out dangerous methods. More details: https://github.com/paritytech/substrate/wiki/Public-RPC.
Use --unsafe-ws-external
to suppress the warning if you understand the risks.
unsafe_ws_external: bool
Listen to all Websocket interfaces.
Same as --ws-external
but doesn’t warn you about it.
prometheus_external: bool
Listen to all Prometheus data source interfaces.
Default is local.
ipc_path: Option<String>
Specify IPC RPC server path
rpc_port: Option<u16>
Specify HTTP RPC server TCP port.
ws_port: Option<u16>
Specify WebSockets RPC server TCP port.
ws_max_connections: Option<usize>
Maximum number of WS RPC server connections.
rpc_cors: Option<Cors>
Specify browser Origins allowed to access the HTTP & WS RPC servers.
A comma-separated list of origins (protocol://domain or special null
value). Value of all
will disable origin validation. Default is to
allow localhost and https://polkadot.js.org origins. When running in
–dev mode the default is to allow all origins.
prometheus_port: Option<u16>
Specify Prometheus data source server TCP Port.
no_prometheus: bool
Do not expose a Prometheus metric endpoint.
Prometheus metric endpoint is enabled by default.
name: Option<String>
The human-readable name for this node.
The node name will be reported to the telemetry server, if enabled.
no_telemetry: bool
Disable connecting to the Substrate telemetry server.
Telemetry is on by default on global chains.
telemetry_endpoints: Vec<(String, u8)>
The URL of the telemetry server to connect to.
This flag can be passed multiple times as a means to specify multiple
telemetry endpoints. Verbosity levels range from 0-9, with 0 denoting
the least verbosity.
Expected format is ‘URL VERBOSITY’, e.g. --telemetry-url 'wss://foo/bar 0'
.
offchain_worker_params: OffchainWorkerParams
import_params: ImportParams
network_params: NetworkParams
pool_config: TransactionPoolParams
alice: bool
Shortcut for --name Alice --validator
with session keys for Alice
added to keystore.
bob: bool
Shortcut for --name Bob --validator
with session keys for Bob
added to keystore.
charlie: bool
Shortcut for --name Charlie --validator
with session keys for Charlie
added to keystore.
dave: bool
Shortcut for --name Dave --validator
with session keys for Dave
added to keystore.
eve: bool
Shortcut for --name Eve --validator
with session keys for Eve
added to keystore.
ferdie: bool
Shortcut for --name Ferdie --validator
with session keys for Ferdie
added to keystore.
one: bool
Shortcut for --name One --validator
with session keys for One
added to keystore.
two: bool
Shortcut for --name Two --validator
with session keys for Two
added to keystore.
Enable authoring even when offline.
keystore_params: KeystoreParams
max_runtime_instances: Option<usize>
The size of the instances cache for each runtime.
The default value is 8 and the values higher than 256 are ignored.
sentry_nodes: Vec<MultiaddrWithPeerId>
Specify a list of sentry node public addresses.
Can’t be used with –public-addr as the sentry node would take precedence over the public address specified there.
tmp: bool
Run a temporary node.
A temporary directory will be created to store the configuration and will be deleted at the end of the process.
Note: the directory is random per process execution. This directory is used as base path which includes: database, node key and keystore.
Implementations
sourceimpl RunCmd
impl RunCmd
sourcepub fn get_keyring(&self) -> Option<Sr25519Keyring>
pub fn get_keyring(&self) -> Option<Sr25519Keyring>
Get the Sr25519Keyring
matching one of the flag.
Trait Implementations
sourceimpl CliConfiguration<()> for RunCmd
impl CliConfiguration<()> for RunCmd
Get the SharedParams for this object
sourcefn import_params(&self) -> Option<&ImportParams>
fn import_params(&self) -> Option<&ImportParams>
Get the ImportParams for this object
sourcefn network_params(&self) -> Option<&NetworkParams>
fn network_params(&self) -> Option<&NetworkParams>
Get the NetworkParams for this object
sourcefn keystore_params(&self) -> Option<&KeystoreParams>
fn keystore_params(&self) -> Option<&KeystoreParams>
Get the KeystoreParams for this object
sourcefn offchain_worker_params(&self) -> Option<&OffchainWorkerParams>
fn offchain_worker_params(&self) -> Option<&OffchainWorkerParams>
Get a reference to OffchainWorkerParams
for this object.
sourcefn dev_key_seed(&self, is_dev: bool) -> Result<Option<String>>
fn dev_key_seed(&self, is_dev: bool) -> Result<Option<String>>
Get the development key seed from the current object Read more
sourcefn telemetry_endpoints(
&self,
chain_spec: &Box<dyn ChainSpec>
) -> Result<Option<TelemetryEndpoints>>
fn telemetry_endpoints(
&self,
chain_spec: &Box<dyn ChainSpec>
) -> Result<Option<TelemetryEndpoints>>
Get the telemetry endpoints (if any) Read more
Returns Ok(true)
if authoring should be forced Read more
sourcefn prometheus_config(
&self,
default_listen_port: u16
) -> Result<Option<PrometheusConfig>>
fn prometheus_config(
&self,
default_listen_port: u16
) -> Result<Option<PrometheusConfig>>
Get the prometheus configuration (None
if disabled) Read more
sourcefn disable_grandpa(&self) -> Result<bool>
fn disable_grandpa(&self) -> Result<bool>
Returns Ok(true)
if grandpa should be disabled Read more
sourcefn rpc_ws_max_connections(&self) -> Result<Option<usize>>
fn rpc_ws_max_connections(&self) -> Result<Option<usize>>
Get the RPC websockets maximum connections (None
if unlimited). Read more
sourcefn rpc_cors(&self, is_dev: bool) -> Result<Option<Vec<String>>>
fn rpc_cors(&self, is_dev: bool) -> Result<Option<Vec<String>>>
Get the RPC cors (None
if disabled) Read more
sourcefn rpc_http(&self, default_listen_port: u16) -> Result<Option<SocketAddr>>
fn rpc_http(&self, default_listen_port: u16) -> Result<Option<SocketAddr>>
Get the RPC HTTP address (None
if disabled). Read more
sourcefn rpc_ws(&self, default_listen_port: u16) -> Result<Option<SocketAddr>>
fn rpc_ws(&self, default_listen_port: u16) -> Result<Option<SocketAddr>>
Get the RPC websocket address (None
if disabled). Read more
sourcefn rpc_methods(&self) -> Result<RpcMethods>
fn rpc_methods(&self) -> Result<RpcMethods>
Returns the RPC method set to expose. Read more
sourcefn transaction_pool(&self) -> Result<TransactionPoolOptions>
fn transaction_pool(&self) -> Result<TransactionPoolOptions>
Get the transaction pool options Read more
sourcefn max_runtime_instances(&self) -> Result<Option<usize>>
fn max_runtime_instances(&self) -> Result<Option<usize>>
Get maximum runtime instances Read more
sourcefn base_path(&self) -> Result<Option<BasePath>>
fn base_path(&self) -> Result<Option<BasePath>>
Get the base path of the configuration (if any) Read more
sourcefn pruning_params(&self) -> Option<&PruningParams>
fn pruning_params(&self) -> Option<&PruningParams>
Get the PruningParams for this object
sourcefn node_key_params(&self) -> Option<&NodeKeyParams>
fn node_key_params(&self) -> Option<&NodeKeyParams>
Get the NodeKeyParams for this object
sourcefn database_params(&self) -> Option<&DatabaseParams>
fn database_params(&self) -> Option<&DatabaseParams>
Get the DatabaseParams for this object
sourcefn network_config(
&self,
chain_spec: &Box<dyn ChainSpec>,
is_dev: bool,
net_config_dir: PathBuf,
client_id: &str,
node_name: &str,
node_key: NodeKeyConfig,
default_listen_port: u16
) -> Result<NetworkConfiguration>
fn network_config(
&self,
chain_spec: &Box<dyn ChainSpec>,
is_dev: bool,
net_config_dir: PathBuf,
client_id: &str,
node_name: &str,
node_key: NodeKeyConfig,
default_listen_port: u16
) -> Result<NetworkConfiguration>
Get the network configuration Read more
sourcefn keystore_config(
&self,
config_dir: &PathBuf
) -> Result<(Option<String>, KeystoreConfig)>
fn keystore_config(
&self,
config_dir: &PathBuf
) -> Result<(Option<String>, KeystoreConfig)>
Get the keystore configuration. Read more
sourcefn database_transaction_storage(&self) -> Result<TransactionStorageMode>
fn database_transaction_storage(&self) -> Result<TransactionStorageMode>
Get the database transaction storage scheme.
sourcefn database_config(
&self,
base_path: &PathBuf,
cache_size: usize,
database: Database
) -> Result<DatabaseConfig>
fn database_config(
&self,
base_path: &PathBuf,
cache_size: usize,
database: Database
) -> Result<DatabaseConfig>
Get the database configuration object for the parameters provided
sourcefn state_cache_size(&self) -> Result<usize>
fn state_cache_size(&self) -> Result<usize>
Get the state cache size. Read more
sourcefn state_cache_child_ratio(&self) -> Result<Option<usize>>
fn state_cache_child_ratio(&self) -> Result<Option<usize>>
Get the state cache child ratio (if any). Read more
sourcefn state_pruning(
&self,
unsafe_pruning: bool,
role: &Role
) -> Result<PruningMode>
fn state_pruning(
&self,
unsafe_pruning: bool,
role: &Role
) -> Result<PruningMode>
Get the state pruning mode. Read more
sourcefn keep_blocks(&self) -> Result<KeepBlocks>
fn keep_blocks(&self) -> Result<KeepBlocks>
Get the block pruning mode. Read more
sourcefn wasm_method(&self) -> Result<WasmExecutionMethod>
fn wasm_method(&self) -> Result<WasmExecutionMethod>
Get the WASM execution method. Read more
sourcefn wasm_runtime_overrides(&self) -> Option<PathBuf>
fn wasm_runtime_overrides(&self) -> Option<PathBuf>
Get the path where WASM overrides live. Read more
sourcefn execution_strategies(
&self,
is_dev: bool,
is_validator: bool
) -> Result<ExecutionStrategies>
fn execution_strategies(
&self,
is_dev: bool,
is_validator: bool
) -> Result<ExecutionStrategies>
Get the execution strategies. Read more
sourcefn telemetry_external_transport(&self) -> Result<Option<ExtTransport>>
fn telemetry_external_transport(&self) -> Result<Option<ExtTransport>>
Get the telemetry external transport Read more
sourcefn default_heap_pages(&self) -> Result<Option<u64>>
fn default_heap_pages(&self) -> Result<Option<u64>>
Get the default value for heap pages Read more
sourcefn offchain_worker(&self, role: &Role) -> Result<OffchainWorkerConfig>
fn offchain_worker(&self, role: &Role) -> Result<OffchainWorkerConfig>
Returns an offchain worker config wrapped in Ok(_)
Read more
sourcefn tracing_targets(&self) -> Result<Option<String>>
fn tracing_targets(&self) -> Result<Option<String>>
Get the tracing targets from the current object (if any) Read more
sourcefn tracing_receiver(&self) -> Result<TracingReceiver>
fn tracing_receiver(&self) -> Result<TracingReceiver>
Get the TracingReceiver value from the current object Read more
sourcefn node_key(&self, net_config_dir: &PathBuf) -> Result<NodeKeyConfig>
fn node_key(&self, net_config_dir: &PathBuf) -> Result<NodeKeyConfig>
Get the node key from the current object Read more
sourcefn announce_block(&self) -> Result<bool>
fn announce_block(&self) -> Result<bool>
Activate or not the automatic announcing of blocks after import Read more
sourcefn create_configuration<C: SubstrateCli>(
&self,
cli: &C,
task_executor: TaskExecutor,
telemetry_handle: Option<TelemetryHandle>
) -> Result<Configuration>
fn create_configuration<C: SubstrateCli>(
&self,
cli: &C,
task_executor: TaskExecutor,
telemetry_handle: Option<TelemetryHandle>
) -> Result<Configuration>
Create a Configuration object from the current object
sourcefn log_filters(&self) -> Result<String>
fn log_filters(&self) -> Result<String>
Get the filters for the logging. Read more
sourcefn is_log_filter_reloading_disabled(&self) -> Result<bool>
fn is_log_filter_reloading_disabled(&self) -> Result<bool>
Is log reloading disabled (enabled by default)
sourcefn disable_log_color(&self) -> Result<bool>
fn disable_log_color(&self) -> Result<bool>
Should the log color output be disabled?
sourcefn init<C: SubstrateCli>(&self) -> Result<TelemetryWorker>
fn init<C: SubstrateCli>(&self) -> Result<TelemetryWorker>
Initialize substrate. This must be done only once per process. Read more
sourceimpl StructOpt for RunCmd
impl StructOpt for RunCmd
sourcefn from_clap(matches: &ArgMatches<'_>) -> Self
fn from_clap(matches: &ArgMatches<'_>) -> Self
Builds the struct from clap::ArgMatches
. It’s guaranteed to succeed
if matches
originates from an App
generated by StructOpt::clap
called on
the same type, otherwise it must panic. Read more
sourcefn from_args() -> Self
fn from_args() -> Self
Builds the struct from the command line arguments (std::env::args_os
).
Calls clap::Error::exit
on failure, printing the error message and aborting the program. Read more
sourcefn from_args_safe() -> Result<Self, Error>
fn from_args_safe() -> Result<Self, Error>
Builds the struct from the command line arguments (std::env::args_os
).
Unlike StructOpt::from_args
, returns clap::Error
on failure instead of aborting the program,
so calling .exit
is up to you. Read more
sourcefn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Gets the struct from any iterator such as a Vec
of your making.
Print the error message and quit the program in case of failure. Read more
sourcefn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
fn from_iter_safe<I>(iter: I) -> Result<Self, Error> where
I: IntoIterator,
<I as IntoIterator>::Item: Into<OsString>,
<I as IntoIterator>::Item: Clone,
Gets the struct from any iterator such as a Vec
of your making. Read more
Auto Trait Implementations
impl RefUnwindSafe for RunCmd
impl Send for RunCmd
impl Sync for RunCmd
impl Unpin for RunCmd
impl UnwindSafe for RunCmd
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> CheckedConversion for T
impl<T> CheckedConversion for T
sourcefn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
fn checked_from<T>(t: T) -> Option<Self> where
Self: TryFrom<T>,
Convert from a value of T
into an equivalent instance of Option<Self>
. Read more
sourcefn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
fn checked_into<T>(self) -> Option<T> where
Self: TryInto<T>,
Consume self to return Some
equivalent value of Option<T>
. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for T where
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
sourceimpl<T> Pointable for T
impl<T> Pointable for T
sourceimpl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
sourcefn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Self where
Self: UniqueSaturatedFrom<T>,
Convert from a value of T
into an equivalent instance of Self
. Read more
sourcefn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> T where
Self: UniqueSaturatedInto<T>,
Consume self to return an equivalent value of T
. Read more
sourceimpl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for S where
T: UncheckedFrom<S>,
sourcepub fn unchecked_into(self) -> T
pub fn unchecked_into(self) -> T
The counterpart to unchecked_from
.
sourceimpl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for S where
T: Bounded,
S: TryInto<T>,
sourcepub fn unique_saturated_into(self) -> T
pub fn unique_saturated_into(self) -> T
Consume self to return an equivalent value of T
.
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more