pub struct Configuration {
Show 41 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 rpc_message_buffer_capacity: u32, pub rpc_batch_config: RpcBatchRequestConfig, pub rpc_rate_limit: Option<NonZeroU32>, 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.

§rpc_message_buffer_capacity: u32

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

§rpc_batch_config: RpcBatchRequestConfig

JSON-RPC server batch config.

§rpc_rate_limit: Option<NonZeroU32>

RPC rate limit per minute.

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

§force_authoring: bool

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

source

pub fn display_role(&self) -> String

Returns a string displaying the node role.

source

pub fn prometheus_registry(&self) -> Option<&Registry>

Returns the prometheus metrics registry, if available.

source

pub fn protocol_id(&self) -> ProtocolId

Returns the network protocol id from the chain spec, or the default.

source

pub fn no_genesis(&self) -> bool

Returns true if the genesis state writing will be skipped while initializing the genesis block.

source

pub fn db_config(&self) -> DatabaseSettings

Returns the database config for creating the backend.

Trait Implementations§

source§

impl Debug for Configuration

source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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 + Send + Sync>

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> 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, 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, 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> MaybeSend for T
where T: Send,