Struct sc_service::config::Configuration
source · pub struct Configuration {Show 38 fields
pub impl_name: String,
pub impl_version: String,
pub role: Role,
pub tokio_handle: Handle,
pub transaction_pool: TransactionPoolOptions,
pub network: NetworkConfiguration,
pub keystore: KeystoreConfig,
pub database: DatabaseSource,
pub trie_cache_maximum_size: Option<usize>,
pub state_pruning: Option<PruningMode>,
pub blocks_pruning: BlocksPruning,
pub chain_spec: Box<dyn ChainSpec>,
pub wasm_method: WasmExecutionMethod,
pub wasm_runtime_overrides: Option<PathBuf>,
pub rpc_addr: Option<SocketAddr>,
pub rpc_max_connections: u32,
pub rpc_cors: Option<Vec<String>>,
pub rpc_methods: RpcMethods,
pub rpc_max_request_size: u32,
pub rpc_max_response_size: u32,
pub rpc_id_provider: Option<Box<dyn RpcSubscriptionIdProvider>>,
pub rpc_max_subs_per_conn: u32,
pub rpc_port: u16,
pub prometheus_config: Option<PrometheusConfig>,
pub telemetry_endpoints: Option<TelemetryEndpoints>,
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 tracing_receiver: TracingReceiver,
pub max_runtime_instances: usize,
pub announce_block: bool,
pub data_path: PathBuf,
pub base_path: BasePath,
pub informant_output_format: OutputFormat,
pub runtime_cache_size: u8,
}
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.
tokio_handle: Handle
Handle to the tokio runtime. Will be used to spawn futures by the task manager.
transaction_pool: TransactionPoolOptions
Extrinsic pool configuration.
network: NetworkConfiguration
Network configuration.
keystore: KeystoreConfig
Configuration for the keystore.
database: DatabaseSource
Configuration for the database.
trie_cache_maximum_size: Option<usize>
Maximum size of internal trie cache in bytes.
If None
is given the cache is disabled.
state_pruning: Option<PruningMode>
State pruning settings.
blocks_pruning: BlocksPruning
Number of blocks to keep in the db.
NOTE: only finalized blocks are subject for removal!
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).
rpc_addr: Option<SocketAddr>
JSON-RPC server binding address.
rpc_max_connections: u32
Maximum number of connections for JSON-RPC server.
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).
rpc_max_request_size: u32
Maximum payload of a rpc request
rpc_max_response_size: u32
Maximum payload of a rpc response.
rpc_id_provider: Option<Box<dyn RpcSubscriptionIdProvider>>
Custom JSON-RPC subscription ID provider.
Default: crate::RandomStringSubscriptionId
.
rpc_max_subs_per_conn: u32
Maximum allowed subscriptions per rpc connection
rpc_port: u16
JSON-RPC server default port.
prometheus_config: Option<PrometheusConfig>
Prometheus endpoint configuration. None
if disabled.
telemetry_endpoints: Option<TelemetryEndpoints>
Telemetry service URL. None
if disabled.
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
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
data_path: PathBuf
Data path root for the configured chain.
base_path: BasePath
Base path of the configuration. This is shared between chains.
informant_output_format: OutputFormat
Configuration of the output format that the informant uses.
runtime_cache_size: u8
Maximum number of different runtime versions that can be cached.
Implementations§
source§impl 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.
sourcepub fn no_genesis(&self) -> bool
pub fn no_genesis(&self) -> bool
Returns true if the genesis state writting will be skipped while initializing the genesis block.
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§
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T, Outer> IsWrappedBy<Outer> for Twhere
Outer: AsRef<T> + AsMut<T> + From<T>,
T: From<Outer>,
impl<T, Outer> IsWrappedBy<Outer> for Twhere Outer: AsRef<T> + AsMut<T> + From<T>, T: From<Outer>,
§impl<T> Pointable for T
impl<T> Pointable for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere Self: UniqueSaturatedInto<T>,
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for Swhere
T: Bounded,
S: TryInto<T>,
impl<T, S> UniqueSaturatedInto<T> for Swhere T: Bounded, S: TryInto<T>,
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.