Struct sc_cli::commands::RunCmd

source ·
pub struct RunCmd {
Show 37 fields pub validator: bool, pub no_grandpa: bool, pub rpc_external: bool, pub unsafe_rpc_external: bool, pub rpc_methods: RpcMethods, pub rpc_rate_limit: Option<NonZeroU32>, pub rpc_rate_limit_whitelisted_ips: Vec<IpNetwork>, pub rpc_rate_limit_trust_proxy_headers: bool, pub rpc_max_request_size: u32, pub rpc_max_response_size: u32, pub rpc_max_subscriptions_per_connection: u32, pub rpc_port: Option<u16>, pub rpc_max_connections: u32, pub rpc_message_buffer_capacity_per_connection: u32, pub rpc_disable_batch_requests: bool, pub rpc_max_batch_request_len: Option<u32>, pub rpc_cors: Option<Cors>, pub name: Option<String>, pub telemetry_params: TelemetryParams, pub prometheus_params: PrometheusParams, pub runtime_params: RuntimeParams, pub offchain_worker_params: OffchainWorkerParams, pub shared_params: SharedParams, pub import_params: ImportParams, pub network_params: NetworkParams, pub pool_config: TransactionPoolParams, pub keystore_params: KeystoreParams, 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 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).

§no_grandpa: bool

Disable GRANDPA.

Disables voter when running in validator mode, otherwise disable the GRANDPA observer.

§rpc_external: bool

Listen to all RPC interfaces (default: local).

Not all RPC methods are safe to be exposed publicly.

Use an RPC proxy server to filter out dangerous methods. More details: https://docs.substrate.io/build/remote-procedure-calls/#public-rpc-interfaces.

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.

§rpc_rate_limit: Option<NonZeroU32>

RPC rate limiting (calls/minute) for each connection.

This is disabled by default.

For example --rpc-rate-limit 10 will maximum allow 10 calls per minute per connection.

§rpc_rate_limit_whitelisted_ips: Vec<IpNetwork>

Disable RPC rate limiting for certain ip addresses.

Each IP address must be in CIDR notation such as 1.2.3.4/24.

§rpc_rate_limit_trust_proxy_headers: bool

Trust proxy headers for disable rate limiting.

By default the rpc server will not trust headers such X-Real-IP, X-Forwarded-For and Forwarded and this option will make the rpc server to trust these headers.

For instance this may be secure if the rpc server is behind a reverse proxy and that the proxy always sets these headers.

§rpc_max_request_size: u32

Set the maximum RPC request payload size for both HTTP and WS in megabytes.

§rpc_max_response_size: u32

Set the maximum RPC response payload size for both HTTP and WS in megabytes.

§rpc_max_subscriptions_per_connection: u32

Set the maximum concurrent subscriptions per connection.

§rpc_port: Option<u16>

Specify JSON-RPC server TCP port.

§rpc_max_connections: u32

Maximum number of RPC server connections.

§rpc_message_buffer_capacity_per_connection: u32

The number of messages the RPC server is allowed to keep in memory.

If the buffer becomes full then the server will not process new messages until the connected client start reading the underlying messages.

This applies per connection which includes both JSON-RPC methods calls and subscriptions.

§rpc_disable_batch_requests: bool

Disable RPC batch requests

§rpc_max_batch_request_len: Option<u32>

Limit the max length per RPC batch request

§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.

§name: Option<String>

The human-readable name for this node.

It’s used as network node name.

§telemetry_params: TelemetryParams§prometheus_params: PrometheusParams§runtime_params: RuntimeParams§offchain_worker_params: OffchainWorkerParams§shared_params: SharedParams§import_params: ImportParams§network_params: NetworkParams§pool_config: TransactionPoolParams§keystore_params: KeystoreParams§alice: bool

Shortcut for --name Alice --validator.

Session keys for Alice are added to keystore.

§bob: bool

Shortcut for --name Bob --validator.

Session keys for Bob are added to keystore.

§charlie: bool

Shortcut for --name Charlie --validator.

Session keys for Charlie are added to keystore.

§dave: bool

Shortcut for --name Dave --validator.

Session keys for Dave are added to keystore.

§eve: bool

Shortcut for --name Eve --validator.

Session keys for Eve are added to keystore.

§ferdie: bool

Shortcut for --name Ferdie --validator.

Session keys for Ferdie are added to keystore.

§one: bool

Shortcut for --name One --validator.

Session keys for One are added to keystore.

§two: bool

Shortcut for --name Two --validator.

Session keys for Two are added to keystore.

§force_authoring: bool

Enable authoring even when offline.

§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.

When --dev is given and no explicit --base-path, this option is implied.

Implementations§

source§

impl RunCmd

source

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

Get the Sr25519Keyring matching one of the flag.

Trait Implementations§

source§

impl Args for RunCmd

source§

fn group_id() -> Option<Id>

Report the ArgGroup::id for this set of arguments
source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self. Read more
source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can update self. Read more
source§

impl CliConfiguration for RunCmd

source§

fn shared_params(&self) -> &SharedParams

Get the SharedParams for this object
source§

fn import_params(&self) -> Option<&ImportParams>

Get the ImportParams for this object
source§

fn network_params(&self) -> Option<&NetworkParams>

Get the NetworkParams for this object
source§

fn keystore_params(&self) -> Option<&KeystoreParams>

Get the KeystoreParams for this object
source§

fn offchain_worker_params(&self) -> Option<&OffchainWorkerParams>

Get a reference to OffchainWorkerParams for this object.
source§

fn node_name(&self) -> Result<String>

Get the name of the node. Read more
source§

fn dev_key_seed(&self, is_dev: bool) -> Result<Option<String>>

Get the development key seed from the current object Read more
source§

fn telemetry_endpoints( &self, chain_spec: &Box<dyn ChainSpec> ) -> Result<Option<TelemetryEndpoints>>

Get the telemetry endpoints (if any) Read more
source§

fn role(&self, is_dev: bool) -> Result<Role>

Gets the role Read more
source§

fn force_authoring(&self) -> Result<bool>

Returns Ok(true) if authoring should be forced Read more
source§

fn prometheus_config( &self, default_listen_port: u16, chain_spec: &Box<dyn ChainSpec> ) -> Result<Option<PrometheusConfig>>

Get the prometheus configuration (None if disabled) Read more
source§

fn disable_grandpa(&self) -> Result<bool>

Returns Ok(true) if grandpa should be disabled Read more
source§

fn rpc_max_connections(&self) -> Result<u32>

Get the maximum number of RPC server connections.
source§

fn rpc_cors(&self, is_dev: bool) -> Result<Option<Vec<String>>>

Get the RPC cors (None if disabled) Read more
source§

fn rpc_addr(&self, default_listen_port: u16) -> Result<Option<SocketAddr>>

Get the RPC address.
source§

fn rpc_methods(&self) -> Result<RpcMethods>

Returns the RPC method set to expose. Read more
source§

fn rpc_max_request_size(&self) -> Result<u32>

Get maximum RPC request payload size.
source§

fn rpc_max_response_size(&self) -> Result<u32>

Get maximum RPC response payload size.
source§

fn rpc_max_subscriptions_per_connection(&self) -> Result<u32>

Get maximum number of subscriptions per connection.
source§

fn rpc_buffer_capacity_per_connection(&self) -> Result<u32>

The number of messages the RPC server is allowed to keep in memory per connection.
source§

fn rpc_batch_config(&self) -> Result<RpcBatchRequestConfig>

RPC server batch request configuration.
source§

fn rpc_rate_limit(&self) -> Result<Option<NonZeroU32>>

RPC rate limit configuration.
source§

fn rpc_rate_limit_whitelisted_ips(&self) -> Result<Vec<IpNetwork>>

RPC rate limit whitelisted ip addresses.
source§

fn rpc_rate_limit_trust_proxy_headers(&self) -> Result<bool>

RPC rate limit trust proxy headers.
source§

fn transaction_pool(&self, is_dev: bool) -> Result<TransactionPoolOptions>

Get the transaction pool options Read more
source§

fn max_runtime_instances(&self) -> Result<Option<usize>>

Get maximum runtime instances Read more
source§

fn runtime_cache_size(&self) -> Result<u8>

Get maximum different runtimes in cache Read more
source§

fn base_path(&self) -> Result<Option<BasePath>>

Get the base path of the configuration (if any) Read more
source§

fn pruning_params(&self) -> Option<&PruningParams>

Get the PruningParams for this object
source§

fn node_key_params(&self) -> Option<&NodeKeyParams>

Get the NodeKeyParams for this object
source§

fn database_params(&self) -> Option<&DatabaseParams>

Get the DatabaseParams for this object
source§

fn is_dev(&self) -> Result<bool>

Returns true if the node is for development or not Read more
source§

fn network_config( &self, chain_spec: &Box<dyn ChainSpec>, is_dev: bool, is_validator: 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
source§

fn keystore_config(&self, config_dir: &PathBuf) -> Result<KeystoreConfig>

Get the keystore configuration. Read more
source§

fn database_cache_size(&self) -> Result<Option<usize>>

Get the database cache size. Read more
source§

fn database(&self) -> Result<Option<Database>>

Get the database backend variant. Read more
source§

fn database_config( &self, base_path: &PathBuf, cache_size: usize, database: Database ) -> Result<DatabaseSource>

Get the database configuration object for the parameters provided
source§

fn trie_cache_maximum_size(&self) -> Result<Option<usize>>

Get the trie cache maximum size. Read more
source§

fn state_pruning(&self) -> Result<Option<PruningMode>>

Get the state pruning mode. Read more
source§

fn blocks_pruning(&self) -> Result<BlocksPruning>

Get the block pruning mode. Read more
source§

fn chain_id(&self, is_dev: bool) -> Result<String>

Get the chain ID (string). Read more
source§

fn wasm_method(&self) -> Result<WasmExecutionMethod>

Get the WASM execution method. Read more
source§

fn wasm_runtime_overrides(&self) -> Option<PathBuf>

Get the path where WASM overrides live. Read more
source§

fn default_heap_pages(&self) -> Result<Option<u64>>

Get the default value for heap pages Read more
source§

fn offchain_worker(&self, role: &Role) -> Result<OffchainWorkerConfig>

Returns an offchain worker config wrapped in Ok(_) Read more
source§

fn tracing_targets(&self) -> Result<Option<String>>

Get the tracing targets from the current object (if any) Read more
source§

fn tracing_receiver(&self) -> Result<TracingReceiver>

Get the TracingReceiver value from the current object Read more
source§

fn node_key(&self, net_config_dir: &PathBuf) -> Result<NodeKeyConfig>

Get the node key from the current object Read more
source§

fn announce_block(&self) -> Result<bool>

Activate or not the automatic announcing of blocks after import Read more
source§

fn create_configuration<C: SubstrateCli>( &self, cli: &C, tokio_handle: Handle ) -> Result<Configuration>

Create a Configuration object from the current object
source§

fn log_filters(&self) -> Result<String>

Get the filters for the logging. Read more
source§

fn detailed_log_output(&self) -> Result<bool>

Should the detailed log output be enabled.
source§

fn enable_log_reloading(&self) -> Result<bool>

Is log reloading enabled?
source§

fn disable_log_color(&self) -> Result<bool>

Should the log color output be disabled?
source§

fn init<F>( &self, support_url: &String, impl_version: &String, logger_hook: F, config: &Configuration ) -> Result<()>

Initialize substrate. This must be done only once per process. Read more
source§

impl Clone for RunCmd

source§

fn clone(&self) -> RunCmd

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl CommandFactory for RunCmd

source§

fn command<'b>() -> Command

Build a Command that can instantiate Self. Read more
source§

fn command_for_update<'b>() -> Command

Build a Command that can update self. Read more
source§

impl Debug for RunCmd

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl FromArgMatches for RunCmd

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

impl Parser for RunCmd

source§

fn parse() -> Self

Parse from std::env::args_os(), exit on error.
source§

fn try_parse() -> Result<Self, Error>

Parse from std::env::args_os(), return Err on error.
source§

fn parse_from<I, T>(itr: I) -> Self
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, exit on error.
source§

fn try_parse_from<I, T>(itr: I) -> Result<Self, Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Parse from iterator, return Err on error.
source§

fn update_from<I, T>(&mut self, itr: I)
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, exit on error.
source§

fn try_update_from<I, T>(&mut self, itr: I) -> Result<(), Error>
where I: IntoIterator<Item = T>, T: Into<OsString> + Clone,

Update from iterator, return Err on error.

Auto Trait Implementations§

§

impl Freeze for RunCmd

§

impl RefUnwindSafe for RunCmd

§

impl Send for RunCmd

§

impl Sync for RunCmd

§

impl Unpin for RunCmd

§

impl UnwindSafe for RunCmd

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Any for T
where T: Any,

source§

fn into_any(self: Box<T>) -> Box<dyn Any>

source§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

source§

fn type_name(&self) -> &'static str

source§

impl<T> AnySync for T
where T: Any + Send + Sync,

source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

source§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

source§

fn implicit( self, class: Class, constructed: bool, tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CheckedConversion for T

source§

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
source§

fn checked_into<T>(self) -> Option<T>
where Self: TryInto<T>,

Consume self to return Some equivalent value of Option<T>. Read more
source§

impl<T> DynClone for T
where T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

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

source§

fn from_ref(outer: &Outer) -> &T

Get a reference to the inner from the outer.

source§

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

Get a mutable reference to the inner from the outer.

source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatedConversion for T

source§

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
source§

fn saturated_into<T>(self) -> T
where Self: UniqueSaturatedInto<T>,

Consume self to return an equivalent value of T. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<S, T> UncheckedInto<T> for S
where T: UncheckedFrom<S>,

source§

fn unchecked_into(self) -> T

The counterpart to unchecked_from.
source§

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

source§

fn unique_saturated_into(self) -> T

Consume self to return an equivalent value of T.
source§

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

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> JsonSchemaMaybe for T

source§

impl<T> MaybeDebug for T
where T: Debug,

source§

impl<T> MaybeRefUnwindSafe for T
where T: RefUnwindSafe,

source§

impl<T> MaybeSend for T
where T: Send,