[][src]Struct sc_cli::RunCmd

pub struct RunCmd {
    pub validator: bool,
    pub sentry: bool,
    pub no_grandpa: bool,
    pub light: bool,
    pub rpc_external: bool,
    pub unsafe_rpc_external: bool,
    pub ws_external: bool,
    pub unsafe_ws_external: bool,
    pub prometheus_external: bool,
    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: OffchainWorkerEnabled,
    pub shared_params: SharedParams,
    pub import_params: ImportParams,
    pub network_config: NetworkConfigurationParams,
    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_path: Option<PathBuf>,
    pub password_interactive: bool,
    pub password: Option<String>,
    pub password_filename: Option<PathBuf>,
    pub max_runtime_instances: usize,
}

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: bool

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.

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.

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. If no verbosity level is specified the default is 0.

offchain_worker: OffchainWorkerEnabled

Should execute offchain workers on every block.

By default it's only enabled for nodes that are authoring new blocks.

shared_params: SharedParamsimport_params: ImportParamsnetwork_config: NetworkConfigurationParamspool_config: TransactionPoolParamsalice: 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.

force_authoring: bool

Enable authoring even when offline.

keystore_path: Option<PathBuf>

Specify custom keystore path.

password_interactive: bool

Use interactive shell for entering the password used by the keystore.

password: Option<String>

Password used by the keystore.

password_filename: Option<PathBuf>

File that contains the password used by the keystore.

max_runtime_instances: usize

The size of the instances cache for each runtime.

The default value is 8 and the values higher than 256 are ignored.

Methods

impl RunCmd[src]

pub fn get_keyring(&self) -> Option<Sr25519Keyring>[src]

Get the Sr25519Keyring matching one of the flag.

pub fn update_config<F>(
    &self,
    config: &mut Configuration,
    spec_factory: F,
    version: &VersionInfo
) -> Result<()> where
    F: FnOnce(&str) -> Result<Box<dyn ChainSpec>, String>, 
[src]

Update and prepare a Configuration with command line parameters of RunCmd and VersionInfo.

pub fn run<FNL, FNF, SL, SF>(
    self,
    config: Configuration,
    new_light: FNL,
    new_full: FNF,
    version: &VersionInfo
) -> Result<()> where
    FNL: FnOnce(Configuration) -> Result<SL, Error>,
    FNF: FnOnce(Configuration) -> Result<SF, Error>,
    SL: AbstractService + Unpin,
    SF: AbstractService + Unpin
[src]

Run the command that runs the node.

pub fn init(&self, version: &VersionInfo) -> Result<()>[src]

Initialize substrate. This must be done only once.

This method:

  1. Set the panic handler
  2. Raise the FD limit
  3. Initialize the logger

Trait Implementations

impl Clone for RunCmd[src]

impl Debug for RunCmd[src]

impl StructOpt for RunCmd[src]

impl StructOptInternal for RunCmd[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> CheckedConversion for T[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, Outer> IsWrappedBy<Outer> for T where
    Outer: AsRef<T> + AsMut<T> + From<T>,
    T: From<Outer>, 
[src]

fn from_ref(outer: &Outer) -> &T[src]

Get a reference to the inner from the outer.

fn from_mut(outer: &mut Outer) -> &mut T[src]

Get a mutable reference to the inner from the outer.

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeDebug for T where
    T: Debug

impl<T> MaybeRefUnwindSafe for T where
    T: RefUnwindSafe

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> SaturatedConversion for T

impl<T> SendSyncUnwindSafe for T where
    T: Send + Sync + UnwindSafe + ?Sized

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<S, T> UncheckedInto<T> for S where
    T: UncheckedFrom<S>, 
[src]

impl<T, S> UniqueSaturatedInto<T> for S where
    S: TryInto<T>,
    T: Bounded

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,