[][src]Trait sc_cli::CliConfiguration

pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {
    pub fn shared_params(&self) -> &SharedParams;

    pub fn import_params(&self) -> Option<&ImportParams> { ... }
pub fn pruning_params(&self) -> Option<&PruningParams> { ... }
pub fn keystore_params(&self) -> Option<&KeystoreParams> { ... }
pub fn network_params(&self) -> Option<&NetworkParams> { ... }
pub fn offchain_worker_params(&self) -> Option<&OffchainWorkerParams> { ... }
pub fn node_key_params(&self) -> Option<&NodeKeyParams> { ... }
pub fn database_params(&self) -> Option<&DatabaseParams> { ... }
pub fn base_path(&self) -> Result<Option<BasePath>> { ... }
pub fn is_dev(&self) -> Result<bool> { ... }
pub fn role(&self, _is_dev: bool) -> Result<Role> { ... }
pub fn transaction_pool(&self) -> Result<TransactionPoolOptions> { ... }
pub 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> { ... }
pub fn keystore_config(&self, base_path: &PathBuf) -> Result<KeystoreConfig> { ... }
pub fn database_cache_size(&self) -> Result<Option<usize>> { ... }
pub fn database(&self) -> Result<Option<Database>> { ... }
pub fn database_config(
        &self,
        base_path: &PathBuf,
        cache_size: usize,
        database: Database
    ) -> Result<DatabaseConfig> { ... }
pub fn state_cache_size(&self) -> Result<usize> { ... }
pub fn state_cache_child_ratio(&self) -> Result<Option<usize>> { ... }
pub fn pruning(
        &self,
        unsafe_pruning: bool,
        role: &Role
    ) -> Result<PruningMode> { ... }
pub fn chain_id(&self, is_dev: bool) -> Result<String> { ... }
pub fn node_name(&self) -> Result<String> { ... }
pub fn wasm_method(&self) -> Result<WasmExecutionMethod> { ... }
pub fn execution_strategies(
        &self,
        is_dev: bool,
        is_validator: bool
    ) -> Result<ExecutionStrategies> { ... }
pub fn rpc_http(
        &self,
        _default_listen_port: u16
    ) -> Result<Option<SocketAddr>> { ... }
pub fn rpc_ipc(&self) -> Result<Option<String>> { ... }
pub fn rpc_ws(
        &self,
        _default_listen_port: u16
    ) -> Result<Option<SocketAddr>> { ... }
pub fn rpc_methods(&self) -> Result<RpcMethods> { ... }
pub fn rpc_ws_max_connections(&self) -> Result<Option<usize>> { ... }
pub fn rpc_cors(&self, _is_dev: bool) -> Result<Option<Vec<String>>> { ... }
pub fn prometheus_config(
        &self,
        _default_listen_port: u16
    ) -> Result<Option<PrometheusConfig>> { ... }
pub fn telemetry_endpoints(
        &self,
        chain_spec: &Box<dyn ChainSpec>
    ) -> Result<Option<TelemetryEndpoints>> { ... }
pub fn telemetry_external_transport(&self) -> Result<Option<ExtTransport>> { ... }
pub fn default_heap_pages(&self) -> Result<Option<u64>> { ... }
pub fn offchain_worker(&self, role: &Role) -> Result<OffchainWorkerConfig> { ... }
pub fn force_authoring(&self) -> Result<bool> { ... }
pub fn disable_grandpa(&self) -> Result<bool> { ... }
pub fn dev_key_seed(&self, _is_dev: bool) -> Result<Option<String>> { ... }
pub fn tracing_targets(&self) -> Result<Option<String>> { ... }
pub fn tracing_receiver(&self) -> Result<TracingReceiver> { ... }
pub fn node_key(&self, net_config_dir: &PathBuf) -> Result<NodeKeyConfig> { ... }
pub fn max_runtime_instances(&self) -> Result<Option<usize>> { ... }
pub fn announce_block(&self) -> Result<bool> { ... }
pub fn create_configuration<C: SubstrateCli>(
        &self,
        cli: &C,
        task_executor: TaskExecutor
    ) -> Result<Configuration> { ... }
pub fn log_filters(&self) -> Result<String> { ... }
pub fn init<C: SubstrateCli>(&self) -> Result<()> { ... } }

A trait that allows converting an object to a Configuration

Required methods

pub fn shared_params(&self) -> &SharedParams[src]

Get the SharedParams for this object

Loading content...

Provided methods

pub fn import_params(&self) -> Option<&ImportParams>[src]

Get the ImportParams for this object

pub fn pruning_params(&self) -> Option<&PruningParams>[src]

Get the PruningParams for this object

pub fn keystore_params(&self) -> Option<&KeystoreParams>[src]

Get the KeystoreParams for this object

pub fn network_params(&self) -> Option<&NetworkParams>[src]

Get the NetworkParams for this object

pub fn offchain_worker_params(&self) -> Option<&OffchainWorkerParams>[src]

Get a reference to OffchainWorkerParams for this object.

pub fn node_key_params(&self) -> Option<&NodeKeyParams>[src]

Get the NodeKeyParams for this object

pub fn database_params(&self) -> Option<&DatabaseParams>[src]

Get the DatabaseParams for this object

pub fn base_path(&self) -> Result<Option<BasePath>>[src]

Get the base path of the configuration (if any)

By default this is retrieved from SharedParams.

pub fn is_dev(&self) -> Result<bool>[src]

Returns true if the node is for development or not

By default this is retrieved from SharedParams.

pub fn role(&self, _is_dev: bool) -> Result<Role>[src]

Gets the role

By default this is Role::Full.

pub fn transaction_pool(&self) -> Result<TransactionPoolOptions>[src]

Get the transaction pool options

By default this is TransactionPoolOptions::default().

pub 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>
[src]

Get the network configuration

By default this is retrieved from NetworkParams if it is available otherwise it creates a default NetworkConfiguration based on node_name, client_id, node_key and net_config_dir.

pub fn keystore_config(&self, base_path: &PathBuf) -> Result<KeystoreConfig>[src]

Get the keystore configuration.

Bu default this is retrieved from KeystoreParams if it is available. Otherwise it uses KeystoreConfig::InMemory.

pub fn database_cache_size(&self) -> Result<Option<usize>>[src]

Get the database cache size.

By default this is retrieved from DatabaseParams if it is available. Otherwise its None.

pub fn database(&self) -> Result<Option<Database>>[src]

Get the database backend variant.

By default this is retrieved from DatabaseParams if it is available. Otherwise its None.

pub fn database_config(
    &self,
    base_path: &PathBuf,
    cache_size: usize,
    database: Database
) -> Result<DatabaseConfig>
[src]

Get the database configuration object for the parameters provided

pub fn state_cache_size(&self) -> Result<usize>[src]

Get the state cache size.

By default this is retrieved from ImportParams if it is available. Otherwise its 0.

pub fn state_cache_child_ratio(&self) -> Result<Option<usize>>[src]

Get the state cache child ratio (if any).

By default this is None.

pub fn pruning(&self, unsafe_pruning: bool, role: &Role) -> Result<PruningMode>[src]

Get the pruning mode.

By default this is retrieved from PruningMode if it is available. Otherwise its PruningMode::default().

pub fn chain_id(&self, is_dev: bool) -> Result<String>[src]

Get the chain ID (string).

By default this is retrieved from SharedParams.

pub fn node_name(&self) -> Result<String>[src]

Get the name of the node.

By default a random name is generated.

pub fn wasm_method(&self) -> Result<WasmExecutionMethod>[src]

Get the WASM execution method.

By default this is retrieved from ImportParams if it is available. Otherwise its WasmExecutionMethod::default().

pub fn execution_strategies(
    &self,
    is_dev: bool,
    is_validator: bool
) -> Result<ExecutionStrategies>
[src]

Get the execution strategies.

By default this is retrieved from ImportParams if it is available. Otherwise its ExecutionStrategies::default().

pub fn rpc_http(&self, _default_listen_port: u16) -> Result<Option<SocketAddr>>[src]

Get the RPC HTTP address (None if disabled).

By default this is None.

pub fn rpc_ipc(&self) -> Result<Option<String>>[src]

Get the RPC IPC path (None if disabled).

By default this is None.

pub fn rpc_ws(&self, _default_listen_port: u16) -> Result<Option<SocketAddr>>[src]

Get the RPC websocket address (None if disabled).

By default this is None.

pub fn rpc_methods(&self) -> Result<RpcMethods>[src]

Returns the RPC method set to expose.

By default this is RpcMethods::Auto (unsafe RPCs are denied iff {rpc,ws}_external returns true, respectively).

pub fn rpc_ws_max_connections(&self) -> Result<Option<usize>>[src]

Get the RPC websockets maximum connections (None if unlimited).

By default this is None.

pub fn rpc_cors(&self, _is_dev: bool) -> Result<Option<Vec<String>>>[src]

Get the RPC cors (None if disabled)

By default this is Some(Vec::new()).

pub fn prometheus_config(
    &self,
    _default_listen_port: u16
) -> Result<Option<PrometheusConfig>>
[src]

Get the prometheus configuration (None if disabled)

By default this is None.

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

Get the telemetry endpoints (if any)

By default this is retrieved from the chain spec loaded by load_spec.

pub fn telemetry_external_transport(&self) -> Result<Option<ExtTransport>>[src]

Get the telemetry external transport

By default this is None.

pub fn default_heap_pages(&self) -> Result<Option<u64>>[src]

Get the default value for heap pages

By default this is None.

pub fn offchain_worker(&self, role: &Role) -> Result<OffchainWorkerConfig>[src]

Returns an offchain worker config wrapped in Ok(_)

By default offchain workers are disabled.

pub fn force_authoring(&self) -> Result<bool>[src]

Returns Ok(true) if authoring should be forced

By default this is false.

pub fn disable_grandpa(&self) -> Result<bool>[src]

Returns Ok(true) if grandpa should be disabled

By default this is false.

pub fn dev_key_seed(&self, _is_dev: bool) -> Result<Option<String>>[src]

Get the development key seed from the current object

By default this is None.

pub fn tracing_targets(&self) -> Result<Option<String>>[src]

Get the tracing targets from the current object (if any)

By default this is retrieved from ImportParams if it is available. Otherwise its None.

pub fn tracing_receiver(&self) -> Result<TracingReceiver>[src]

Get the TracingReceiver value from the current object

By default this is retrieved from ImportParams if it is available. Otherwise its TracingReceiver::default().

pub fn node_key(&self, net_config_dir: &PathBuf) -> Result<NodeKeyConfig>[src]

Get the node key from the current object

By default this is retrieved from NodeKeyParams if it is available. Otherwise its NodeKeyConfig::default().

pub fn max_runtime_instances(&self) -> Result<Option<usize>>[src]

Get maximum runtime instances

By default this is None.

pub fn announce_block(&self) -> Result<bool>[src]

Activate or not the automatic announcing of blocks after import

By default this is false.

pub fn create_configuration<C: SubstrateCli>(
    &self,
    cli: &C,
    task_executor: TaskExecutor
) -> Result<Configuration>
[src]

Create a Configuration object from the current object

pub fn log_filters(&self) -> Result<String>[src]

Get the filters for the logging.

This should be a list of comma-separated values. Example: foo=trace,bar=debug,baz=info

By default this is retrieved from SharedParams.

pub fn init<C: SubstrateCli>(&self) -> Result<()>[src]

Initialize substrate. This must be done only once per process.

This method:

  1. Sets the panic handler
  2. Initializes the logger
  3. Raises the FD limit
Loading content...

Implementors

impl CliConfiguration<()> for BuildSpecCmd[src]

impl CliConfiguration<()> for BuildSyncSpecCmd[src]

impl CliConfiguration<()> for CheckBlockCmd[src]

impl CliConfiguration<()> for ExportBlocksCmd[src]

impl CliConfiguration<()> for ExportStateCmd[src]

impl CliConfiguration<()> for ImportBlocksCmd[src]

impl CliConfiguration<()> for PurgeChainCmd[src]

impl CliConfiguration<()> for RevertCmd[src]

impl CliConfiguration<()> for RunCmd[src]

Loading content...