Struct sc_service::config::Configuration
source · [−]pub struct Configuration {Show 41 fields
pub impl_name: String,
pub impl_version: String,
pub role: Role,
pub task_executor: TaskExecutor,
pub transaction_pool: TransactionPoolOptions,
pub network: NetworkConfiguration,
pub keystore: KeystoreConfig,
pub keystore_remote: Option<String>,
pub database: DatabaseConfig,
pub state_cache_size: usize,
pub state_cache_child_ratio: Option<usize>,
pub state_pruning: PruningMode,
pub keep_blocks: KeepBlocks,
pub transaction_storage: TransactionStorageMode,
pub chain_spec: Box<dyn ChainSpec>,
pub wasm_method: WasmExecutionMethod,
pub wasm_runtime_overrides: Option<PathBuf>,
pub execution_strategies: ExecutionStrategies,
pub rpc_http: Option<SocketAddr>,
pub rpc_ws: Option<SocketAddr>,
pub rpc_ipc: Option<String>,
pub rpc_ws_max_connections: Option<usize>,
pub rpc_cors: Option<Vec<String>>,
pub rpc_methods: RpcMethods,
pub prometheus_config: Option<PrometheusConfig>,
pub telemetry_endpoints: Option<TelemetryEndpoints>,
pub telemetry_external_transport: Option<ExtTransport>,
pub telemetry_handle: Option<TelemetryHandle>,
pub telemetry_span: Option<TelemetrySpan>,
pub default_heap_pages: Option<u64>,
pub offchain_worker: OffchainWorkerConfig,
pub force_authoring: bool,
pub disable_grandpa: bool,
pub dev_key_seed: Option<String>,
pub tracing_targets: Option<String>,
pub disable_log_reloading: bool,
pub tracing_receiver: TracingReceiver,
pub max_runtime_instances: usize,
pub announce_block: bool,
pub base_path: Option<BasePath>,
pub informant_output_format: OutputFormat,
}
Expand description
Service configuration.
Fields
impl_name: String
Implementation name
impl_version: String
Implementation version (see sc-cli to see an example of format)
role: Role
Node role.
task_executor: TaskExecutor
How to spawn background tasks. Mandatory, otherwise creating a Service
will error.
transaction_pool: TransactionPoolOptions
Extrinsic pool configuration.
network: NetworkConfiguration
Network configuration.
keystore: KeystoreConfig
Configuration for the keystore.
keystore_remote: Option<String>
Remote URI to connect to for async keystore support
database: DatabaseConfig
Configuration for the database.
state_cache_size: usize
Size of internal state cache in Bytes
state_cache_child_ratio: Option<usize>
Size in percent of cache size dedicated to child tries
state_pruning: PruningMode
State pruning settings.
keep_blocks: KeepBlocks
Number of blocks to keep in the db.
transaction_storage: TransactionStorageMode
Transaction storage scheme.
chain_spec: Box<dyn ChainSpec>
Chain configuration.
wasm_method: WasmExecutionMethod
Wasm execution method.
wasm_runtime_overrides: Option<PathBuf>
Directory where local WASM runtimes live. These runtimes take precedence
over on-chain runtimes when the spec version matches. Set to None
to
disable overrides (default).
execution_strategies: ExecutionStrategies
Execution strategies.
rpc_http: Option<SocketAddr>
RPC over HTTP binding address. None
if disabled.
rpc_ws: Option<SocketAddr>
RPC over Websockets binding address. None
if disabled.
rpc_ipc: Option<String>
RPC over IPC binding path. None
if disabled.
rpc_ws_max_connections: Option<usize>
Maximum number of connections for WebSockets RPC server. None
if default.
rpc_cors: Option<Vec<String>>
CORS settings for HTTP & WS servers. None
if all origins are allowed.
rpc_methods: RpcMethods
RPC methods to expose (by default only a safe subset or all of them).
prometheus_config: Option<PrometheusConfig>
Prometheus endpoint configuration. None
if disabled.
telemetry_endpoints: Option<TelemetryEndpoints>
Telemetry service URL. None
if disabled.
telemetry_external_transport: Option<ExtTransport>
External WASM transport for the telemetry. If Some
, when connection to a telemetry
endpoint, this transport will be tried in priority before all others.
telemetry_handle: Option<TelemetryHandle>
Telemetry handle.
This is a handle to a TelemetryWorker
instance. It is used to initialize the telemetry for
a substrate node.
telemetry_span: Option<TelemetrySpan>
Telemetry span.
This span is entered for every background task spawned using the TaskManager.
default_heap_pages: Option<u64>
The default number of 64KB pages to allocate for Wasm execution
offchain_worker: OffchainWorkerConfig
Should offchain workers be executed.
Enable authoring even when offline.
disable_grandpa: bool
Disable GRANDPA when running in validator mode
dev_key_seed: Option<String>
Development key seed.
When running in development mode, the seed will be used to generate authority keys by the keystore.
Should only be set when node
is running development mode.
tracing_targets: Option<String>
Tracing targets
disable_log_reloading: bool
Is log filter reloading disabled
tracing_receiver: TracingReceiver
Tracing receiver
max_runtime_instances: usize
The size of the instances cache.
The default value is 8.
announce_block: bool
Announce block automatically after they have been imported
base_path: Option<BasePath>
Base path of the configuration
informant_output_format: OutputFormat
Configuration of the output format that the informant uses.
Implementations
sourceimpl Configuration
impl Configuration
sourcepub fn display_role(&self) -> String
pub fn display_role(&self) -> String
Returns a string displaying the node role.
sourcepub fn prometheus_registry(&self) -> Option<&Registry>
pub fn prometheus_registry(&self) -> Option<&Registry>
Returns the prometheus metrics registry, if available.
sourcepub fn protocol_id(&self) -> ProtocolId
pub fn protocol_id(&self) -> ProtocolId
Returns the network protocol id from the chain spec, or the default.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Configuration
impl Send for Configuration
impl Sync for Configuration
impl Unpin for Configuration
impl !UnwindSafe for Configuration
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