Struct Config

Source
pub struct Config {
Show 15 fields pub log_level: LogLevel, pub moniker: String, pub db_backend: DbBackend, pub log_format: LogFormat, pub priv_validator_laddr: String, pub filter_peers: bool, pub pprof_laddr: String, pub data_dir: String, pub p2p: P2PConfig, pub mempool: MempoolConfig, pub state_sync: Option<StateSyncConfig>, pub fast_sync: Option<FastSyncVersion>, pub consensus: ConsensusConfig, pub tx_index: TxIndexConfig, pub prometheus: Option<PrometheusConfig>,
}
Expand description

Config for tendermint

Fields§

§log_level: LogLevel

Log level

§moniker: String

Readable name of this node. Default is a random name.

§db_backend: DbBackend

Backend storage, default is goleveldb

§log_format: LogFormat

Format for output log,

§priv_validator_laddr: String

TCP or UNIX socket address for Tendermint to listen on for connections from an external PrivValidator process

§filter_peers: bool

If true, query the ABCI app on connecting to a new peer so the app can decide if we should keep the connection or not

§pprof_laddr: String

pprof listen addr. Useful to debug tendermint.

§data_dir: String

Data dis

§p2p: P2PConfig

P2P config

§mempool: MempoolConfig

Mempool config

§state_sync: Option<StateSyncConfig>

State sync rapidly bootstraps a new node by discovering, fetching, and restoring a state machine snapshot from peers instead of fetching and replaying historical blocks. Requires some peers in the network to take and serve state machine snapshots. State sync is not attempted if the node has any local state (LastBlockHeight > 0). The node will have a truncated block history, starting from the height of the snapshot.

§fast_sync: Option<FastSyncVersion>

Version of fast sync.

§consensus: ConsensusConfig

Consensus config

§tx_index: TxIndexConfig

What indexer to use for transactions

The application will set which txs to index. In some cases a node operator will be able to decide which txs to index based on configuration set in the application.

Options:

  1. “null”
  2. “kv” (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend).
  3. “psql” - the indexer services backed by PostgreSQL. When “kv” or “psql” is chosen “tx.height” and “tx.hash” will always be indexed.
§prometheus: Option<PrometheusConfig>

When true, Prometheus metrics are served under /metrics on PrometheusListenAddr. Check out the documentation for the list of available metrics.

Implementations§

Source§

impl Config

Source

pub fn new(data_dir: &str) -> Self

Source§

impl Config

Source

pub fn log_level(self, log_level: LogLevel) -> Self

Source

pub fn moniker(self, moniker: &str) -> Self

Source

pub fn db_backend(self, db_backend: DbBackend) -> Self

Source

pub fn log_format(self, log_format: LogFormat) -> Self

Source

pub fn priv_validator_laddr(self, priv_validator_laddr: &str) -> Self

Source

pub fn filter_peers(self, filter_peers: bool) -> Self

Source

pub fn p2p(self, p2p: P2PConfig) -> Self

Source

pub fn mempool(self, mempool: MempoolConfig) -> Self

Source

pub fn enable_state_sync(self, state_sync: StateSyncConfig) -> Self

Source

pub fn enable_fast_sync(self, fast_sync: FastSyncVersion) -> Self

Source

pub fn consensus(self, consensus: ConsensusConfig) -> Self

Source

pub fn tx_index(self, tx_index: TxIndexConfig) -> Self

Source

pub fn enabel_prometheus(self, prometheus: PrometheusConfig) -> Self

Trait Implementations§

Source§

impl Clone for Config

Source§

fn clone(&self) -> Config

Returns a duplicate of the value. Read more
1.0.0 · Source§

const fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Config

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for Config

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Config

§

impl RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl UnwindSafe for Config

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> 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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, 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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>,

Source§

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