Trait sc_cli::CliConfiguration [−][src]
pub trait CliConfiguration<DCV: DefaultConfigurationValues = ()>: Sized {}Show methods
fn shared_params(&self) -> &SharedParams; fn import_params(&self) -> Option<&ImportParams> { ... } fn pruning_params(&self) -> Option<&PruningParams> { ... } fn keystore_params(&self) -> Option<&KeystoreParams> { ... } fn network_params(&self) -> Option<&NetworkParams> { ... } fn offchain_worker_params(&self) -> Option<&OffchainWorkerParams> { ... } fn node_key_params(&self) -> Option<&NodeKeyParams> { ... } fn database_params(&self) -> Option<&DatabaseParams> { ... } fn base_path(&self) -> Result<Option<BasePath>> { ... } fn is_dev(&self) -> Result<bool> { ... } fn role(&self, _is_dev: bool) -> Result<Role> { ... } fn transaction_pool(&self) -> Result<TransactionPoolOptions> { ... } 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> { ... } fn keystore_config(
&self,
config_dir: &PathBuf
) -> Result<(Option<String>, KeystoreConfig)> { ... } fn database_cache_size(&self) -> Result<Option<usize>> { ... } fn database_transaction_storage(&self) -> Result<TransactionStorageMode> { ... } fn database(&self) -> Result<Option<Database>> { ... } fn database_config(
&self,
base_path: &PathBuf,
cache_size: usize,
database: Database
) -> Result<DatabaseSource> { ... } fn state_cache_size(&self) -> Result<usize> { ... } fn state_cache_child_ratio(&self) -> Result<Option<usize>> { ... } fn state_pruning(
&self,
unsafe_pruning: bool,
role: &Role
) -> Result<PruningMode> { ... } fn keep_blocks(&self) -> Result<KeepBlocks> { ... } fn chain_id(&self, is_dev: bool) -> Result<String> { ... } fn node_name(&self) -> Result<String> { ... } fn wasm_method(&self) -> Result<WasmExecutionMethod> { ... } fn wasm_runtime_overrides(&self) -> Option<PathBuf> { ... } fn execution_strategies(
&self,
is_dev: bool,
is_validator: bool
) -> Result<ExecutionStrategies> { ... } fn rpc_http(&self, _default_listen_port: u16) -> Result<Option<SocketAddr>> { ... } fn rpc_ipc(&self) -> Result<Option<String>> { ... } fn rpc_ws(&self, _default_listen_port: u16) -> Result<Option<SocketAddr>> { ... } fn rpc_methods(&self) -> Result<RpcMethods> { ... } fn rpc_ws_max_connections(&self) -> Result<Option<usize>> { ... } fn rpc_http_threads(&self) -> Result<Option<usize>> { ... } fn rpc_cors(&self, _is_dev: bool) -> Result<Option<Vec<String>>> { ... } fn rpc_max_payload(&self) -> Result<Option<usize>> { ... } fn prometheus_config(
&self,
_default_listen_port: u16
) -> Result<Option<PrometheusConfig>> { ... } fn telemetry_endpoints(
&self,
chain_spec: &Box<dyn ChainSpec>
) -> Result<Option<TelemetryEndpoints>> { ... } fn telemetry_external_transport(&self) -> Result<Option<ExtTransport>> { ... } fn default_heap_pages(&self) -> Result<Option<u64>> { ... } fn offchain_worker(&self, role: &Role) -> Result<OffchainWorkerConfig> { ... } fn force_authoring(&self) -> Result<bool> { ... } fn disable_grandpa(&self) -> Result<bool> { ... } fn dev_key_seed(&self, _is_dev: bool) -> Result<Option<String>> { ... } fn tracing_targets(&self) -> Result<Option<String>> { ... } fn tracing_receiver(&self) -> Result<TracingReceiver> { ... } fn node_key(&self, net_config_dir: &PathBuf) -> Result<NodeKeyConfig> { ... } fn max_runtime_instances(&self) -> Result<Option<usize>> { ... } fn announce_block(&self) -> Result<bool> { ... } fn create_configuration<C: SubstrateCli>(
&self,
cli: &C,
task_executor: TaskExecutor
) -> Result<Configuration> { ... } fn log_filters(&self) -> Result<String> { ... } fn is_log_filter_reloading_disabled(&self) -> Result<bool> { ... } fn disable_log_color(&self) -> Result<bool> { ... } fn init<C: SubstrateCli>(&self) -> Result<()> { ... }
Expand description
A trait that allows converting an object to a Configuration
Required methods
Get the SharedParams for this object
Provided methods
fn import_params(&self) -> Option<&ImportParams>
fn import_params(&self) -> Option<&ImportParams>Get the ImportParams for this object
fn pruning_params(&self) -> Option<&PruningParams>
fn pruning_params(&self) -> Option<&PruningParams>Get the PruningParams for this object
fn keystore_params(&self) -> Option<&KeystoreParams>
fn keystore_params(&self) -> Option<&KeystoreParams>Get the KeystoreParams for this object
fn network_params(&self) -> Option<&NetworkParams>
fn network_params(&self) -> Option<&NetworkParams>Get the NetworkParams for this object
fn offchain_worker_params(&self) -> Option<&OffchainWorkerParams>
fn offchain_worker_params(&self) -> Option<&OffchainWorkerParams>Get a reference to OffchainWorkerParams for this object.
fn node_key_params(&self) -> Option<&NodeKeyParams>
fn node_key_params(&self) -> Option<&NodeKeyParams>Get the NodeKeyParams for this object
fn database_params(&self) -> Option<&DatabaseParams>
fn database_params(&self) -> Option<&DatabaseParams>Get the DatabaseParams for this object
Get the base path of the configuration (if any)
By default this is retrieved from SharedParams.
Returns true if the node is for development or not
By default this is retrieved from SharedParams.
fn transaction_pool(&self) -> Result<TransactionPoolOptions>
fn transaction_pool(&self) -> Result<TransactionPoolOptions>Get the transaction pool options
By default this is TransactionPoolOptions::default().
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>
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
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.
fn 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.
By default this is retrieved from KeystoreParams if it is available. Otherwise it uses
KeystoreConfig::InMemory.
fn database_cache_size(&self) -> Result<Option<usize>>
fn database_cache_size(&self) -> Result<Option<usize>>Get the database cache size.
By default this is retrieved from DatabaseParams if it is available. Otherwise its None.
fn database_transaction_storage(&self) -> Result<TransactionStorageMode>
fn database_transaction_storage(&self) -> Result<TransactionStorageMode>Get the database transaction storage scheme.
Get the database backend variant.
By default this is retrieved from DatabaseParams if it is available. Otherwise its None.
fn database_config(
&self,
base_path: &PathBuf,
cache_size: usize,
database: Database
) -> Result<DatabaseSource>
fn database_config(
&self,
base_path: &PathBuf,
cache_size: usize,
database: Database
) -> Result<DatabaseSource>Get the database configuration object for the parameters provided
fn state_cache_size(&self) -> Result<usize>
fn state_cache_size(&self) -> Result<usize>Get the state cache size.
By default this is retrieved from ImportParams if it is available. Otherwise its 0.
fn 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).
By default this is None.
fn 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.
By default this is retrieved from PruningMode if it is available. Otherwise its
PruningMode::default().
fn keep_blocks(&self) -> Result<KeepBlocks>
fn keep_blocks(&self) -> Result<KeepBlocks>Get the block pruning mode.
By default this is retrieved from block_pruning if it is available. Otherwise its
KeepBlocks::All.
Get the chain ID (string).
By default this is retrieved from SharedParams.
Get the name of the node.
By default a random name is generated.
fn wasm_method(&self) -> Result<WasmExecutionMethod>
fn wasm_method(&self) -> Result<WasmExecutionMethod>Get the WASM execution method.
By default this is retrieved from ImportParams if it is available. Otherwise its
WasmExecutionMethod::default().
fn wasm_runtime_overrides(&self) -> Option<PathBuf>
fn wasm_runtime_overrides(&self) -> Option<PathBuf>Get the path where WASM overrides live.
By default this is None.
fn 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.
By default this is retrieved from ImportParams if it is available. Otherwise its
ExecutionStrategies::default().
Get the RPC HTTP address (None if disabled).
By default this is None.
Get the RPC IPC path (None if disabled).
By default this is None.
Get the RPC websocket address (None if disabled).
By default this is None.
fn rpc_methods(&self) -> Result<RpcMethods>
fn rpc_methods(&self) -> Result<RpcMethods>Returns the RPC method set to expose.
By default this is RpcMethods::Auto (unsafe RPCs are denied iff
{rpc,ws}_external returns true, respectively).
fn 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).
By default this is None.
fn rpc_http_threads(&self) -> Result<Option<usize>>
fn rpc_http_threads(&self) -> Result<Option<usize>>Get the RPC HTTP thread pool size (None for a default 4-thread pool config).
By default this is None.
Get the RPC cors (None if disabled)
By default this is Some(Vec::new()).
fn rpc_max_payload(&self) -> Result<Option<usize>>
fn rpc_max_payload(&self) -> Result<Option<usize>>Get maximum RPC payload.
fn 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)
By default this is None.
fn 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)
By default this is retrieved from the chain spec loaded by load_spec.
fn telemetry_external_transport(&self) -> Result<Option<ExtTransport>>
fn telemetry_external_transport(&self) -> Result<Option<ExtTransport>>Get the telemetry external transport
By default this is None.
fn default_heap_pages(&self) -> Result<Option<u64>>
fn default_heap_pages(&self) -> Result<Option<u64>>Get the default value for heap pages
By default this is None.
fn offchain_worker(&self, role: &Role) -> Result<OffchainWorkerConfig>
fn offchain_worker(&self, role: &Role) -> Result<OffchainWorkerConfig>Returns an offchain worker config wrapped in Ok(_)
By default offchain workers are disabled.
Returns Ok(true) if authoring should be forced
By default this is false.
fn disable_grandpa(&self) -> Result<bool>
fn disable_grandpa(&self) -> Result<bool>Returns Ok(true) if grandpa should be disabled
By default this is false.
Get the development key seed from the current object
By default this is None.
fn tracing_targets(&self) -> Result<Option<String>>
fn tracing_targets(&self) -> Result<Option<String>>Get the tracing targets from the current object (if any)
By default this is retrieved from SharedParams if it is available. Otherwise its
None.
fn tracing_receiver(&self) -> Result<TracingReceiver>
fn tracing_receiver(&self) -> Result<TracingReceiver>Get the TracingReceiver value from the current object
By default this is retrieved from SharedParams if it is available. Otherwise its
TracingReceiver::default().
fn 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
By default this is retrieved from NodeKeyParams if it is available. Otherwise its
NodeKeyConfig::default().
fn max_runtime_instances(&self) -> Result<Option<usize>>
fn max_runtime_instances(&self) -> Result<Option<usize>>Get maximum runtime instances
By default this is None.
fn announce_block(&self) -> Result<bool>
fn announce_block(&self) -> Result<bool>Activate or not the automatic announcing of blocks after import
By default this is false.
fn create_configuration<C: SubstrateCli>(
&self,
cli: &C,
task_executor: TaskExecutor
) -> Result<Configuration>
fn create_configuration<C: SubstrateCli>(
&self,
cli: &C,
task_executor: TaskExecutor
) -> Result<Configuration>Create a Configuration object from the current object
fn log_filters(&self) -> Result<String>
fn log_filters(&self) -> Result<String>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.
fn is_log_filter_reloading_disabled(&self) -> Result<bool>
fn is_log_filter_reloading_disabled(&self) -> Result<bool>Is log reloading disabled (enabled by default)
fn disable_log_color(&self) -> Result<bool>
fn disable_log_color(&self) -> Result<bool>Should the log color output be disabled?
fn init<C: SubstrateCli>(&self) -> Result<()>
fn init<C: SubstrateCli>(&self) -> Result<()>Initialize substrate. This must be done only once per process.
This method:
- Sets the panic handler
- Initializes the logger
- Raises the FD limit