config

package
v1.5.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2022 License: Apache-2.0, Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FuzzModeDrop is a mode in which we randomly drop reads/writes, connections or sleep
	FuzzModeDrop = iota
	// FuzzModeDelay is a mode in which we randomly sleep
	FuzzModeDelay

	// LogFormatPlain is a format for colored text
	LogFormatPlain = "plain"
	// LogFormatJSON is a format for json output
	LogFormatJSON = "json"
)
View Source
const DefaultDirPerm = 0700

DefaultDirPerm is the default permissions used when creating directories.

Variables

View Source
var (
	DefaultTendermintDir = ".tendermint"

	DefaultLogPath = os.ExpandEnv("$HOME/.exchaind")
)

NOTE: Most of the structs & relevant comments + the default configuration options were used to manually generate the config.toml. Please reflect any changes made here in the defaultConfigTemplate constant in config/toml.go NOTE: libs/cli must know to look in the config dir!

Functions

func DefaultLogLevel

func DefaultLogLevel() string

DefaultLogLevel returns a default log level of "error"

func DefaultPackageLogLevels

func DefaultPackageLogLevels() string

DefaultPackageLogLevels returns a default log level setting so all packages log at "error", while the `state` and `main` packages log at "info"

func EnsureRoot

func EnsureRoot(rootDir string)

EnsureRoot creates the root, config, and data directories if they don't exist, and panics if it fails.

func SetDynamicConfig

func SetDynamicConfig(c IDynamicConfig)

func WriteConfigFile

func WriteConfigFile(configFilePath string, config *Config)

WriteConfigFile renders config using the template and writes it to configFilePath.

Types

type BaseConfig

type BaseConfig struct {

	// The root directory for all data.
	// This should be set in viper so it can unmarshal into this struct
	RootDir string `mapstructure:"home"`

	// TCP or UNIX socket address of the ABCI application,
	// or the name of an ABCI application compiled in with the Tendermint binary
	ProxyApp string `mapstructure:"proxy_app"`

	// A custom human readable name for this node
	Moniker string `mapstructure:"moniker"`

	// If this node is many blocks behind the tip of the chain, FastSync
	// allows them to catchup quickly by downloading blocks in parallel
	// and verifying their commits
	FastSyncMode bool `mapstructure:"fast_sync"`

	// AutoFastSync allows this node switches from consensus mode to fast-sync mode automatically
	// when it is many blocks behind the tip of the chain.
	AutoFastSync bool `mapstructure:"auto_fast_sync"`

	// Database backend: goleveldb | cleveldb | boltdb | rocksdb
	// * goleveldb (github.com/syndtr/goleveldb - most popular implementation)
	//   - pure go
	//   - stable
	// * cleveldb (uses levigo wrapper)
	//   - fast
	//   - requires gcc
	//   - use cleveldb build tag (go build -tags cleveldb)
	// * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt)
	//   - EXPERIMENTAL
	//   - may be faster is some use-cases (random reads - indexer)
	//   - use boltdb build tag (go build -tags boltdb)
	// * rocksdb (uses github.com/tecbot/gorocksdb)
	//   - EXPERIMENTAL
	//   - requires gcc
	//   - use rocksdb build tag (go build -tags rocksdb)
	DBBackend string `mapstructure:"db_backend"`

	// Database directory
	DBPath string `mapstructure:"db_dir"`

	// Output level for logging
	LogLevel string `mapstructure:"log_level"`

	// Output format: 'plain' (colored text) or 'json'
	LogFormat string `mapstructure:"log_format"`

	// Path to the JSON file containing the initial validator set and other meta data
	Genesis string `mapstructure:"genesis_file"`

	// Path to the JSON file containing the private key to use as a validator in the consensus protocol
	PrivValidatorKey string `mapstructure:"priv_validator_key_file"`

	// Path to the JSON file containing the last sign state of a validator
	PrivValidatorState string `mapstructure:"priv_validator_state_file"`

	// TCP or UNIX socket address for Tendermint to listen on for
	// connections from an external PrivValidator process
	PrivValidatorListenAddr string `mapstructure:"priv_validator_laddr"`

	// A JSON file containing the private key to use for p2p authenticated encryption
	NodeKey string `mapstructure:"node_key_file"`

	// Mechanism to connect to the ABCI application: socket | grpc
	ABCI string `mapstructure:"abci"`

	// TCP or UNIX socket address for the profiling server to listen on
	ProfListenAddress string `mapstructure:"prof_laddr"`

	// 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
	FilterPeers bool `mapstructure:"filter_peers"` // false

	// Logging file directory
	LogFile string `mapstructure:"log_file"`

	// Logging stdout
	LogStdout bool `mapstructure:"log_stdout"`
	// contains filtered or unexported fields
}

BaseConfig defines the base configuration for a Tendermint node

func DefaultBaseConfig

func DefaultBaseConfig() BaseConfig

DefaultBaseConfig returns a default base configuration for a Tendermint node

func TestBaseConfig

func TestBaseConfig() BaseConfig

TestBaseConfig returns a base configuration for testing a Tendermint node

func (BaseConfig) ChainID

func (cfg BaseConfig) ChainID() string

func (BaseConfig) DBDir

func (cfg BaseConfig) DBDir() string

DBDir returns the full path to the database directory

func (BaseConfig) GenesisFile

func (cfg BaseConfig) GenesisFile() string

GenesisFile returns the full path to the genesis.json file

func (BaseConfig) NodeKeyFile

func (cfg BaseConfig) NodeKeyFile() string

NodeKeyFile returns the full path to the node_key.json file

func (BaseConfig) PrivValidatorKeyFile

func (cfg BaseConfig) PrivValidatorKeyFile() string

PrivValidatorKeyFile returns the full path to the priv_validator_key.json file

func (BaseConfig) PrivValidatorStateFile

func (cfg BaseConfig) PrivValidatorStateFile() string

PrivValidatorFile returns the full path to the priv_validator_state.json file

func (BaseConfig) ValidateBasic

func (cfg BaseConfig) ValidateBasic() error

ValidateBasic performs basic validation (checking param bounds, etc.) and returns an error if any check fails.

type Config

type Config struct {
	// Top level options use an anonymous struct
	BaseConfig `mapstructure:",squash"`

	// Options for services
	RPC             *RPCConfig             `mapstructure:"rpc"`
	P2P             *P2PConfig             `mapstructure:"p2p"`
	Mempool         *MempoolConfig         `mapstructure:"mempool"`
	FastSync        *FastSyncConfig        `mapstructure:"fastsync"`
	Consensus       *ConsensusConfig       `mapstructure:"consensus"`
	TxIndex         *TxIndexConfig         `mapstructure:"tx_index"`
	Instrumentation *InstrumentationConfig `mapstructure:"instrumentation"`
}

Config defines the top level configuration for a Tendermint node

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a default configuration for a Tendermint node

func ResetTestRoot

func ResetTestRoot(testName string) *Config

func ResetTestRootWithChainID

func ResetTestRootWithChainID(testName string, chainID string) *Config

func TestConfig

func TestConfig() *Config

TestConfig returns a configuration that can be used for testing

func (*Config) SetRoot

func (cfg *Config) SetRoot(root string) *Config

SetRoot sets the RootDir for all Config structs

func (*Config) ValidateBasic

func (cfg *Config) ValidateBasic() error

ValidateBasic performs basic validation (checking param bounds, etc.) and returns an error if any check fails.

type ConsensusConfig

type ConsensusConfig struct {
	RootDir string `mapstructure:"home"`
	WalPath string `mapstructure:"wal_file"`

	TimeoutPropose        time.Duration `mapstructure:"timeout_propose"`
	TimeoutProposeDelta   time.Duration `mapstructure:"timeout_propose_delta"`
	TimeoutPrevote        time.Duration `mapstructure:"timeout_prevote"`
	TimeoutPrevoteDelta   time.Duration `mapstructure:"timeout_prevote_delta"`
	TimeoutPrecommit      time.Duration `mapstructure:"timeout_precommit"`
	TimeoutPrecommitDelta time.Duration `mapstructure:"timeout_precommit_delta"`
	TimeoutCommit         time.Duration `mapstructure:"timeout_commit"`
	TimeoutConsensus      time.Duration `mapstructure:"timeout_consensus"`

	// Make progress as soon as we have all the precommits (as if TimeoutCommit = 0)
	SkipTimeoutCommit bool `mapstructure:"skip_timeout_commit"`

	// EmptyBlocks mode and possible interval between empty blocks
	CreateEmptyBlocks         bool          `mapstructure:"create_empty_blocks"`
	CreateEmptyBlocksInterval time.Duration `mapstructure:"create_empty_blocks_interval"`
	TimeoutToFastSync         time.Duration `mapstructure:"switch_to_fast_sync_interval"`

	// Reactor sleep duration parameters
	PeerGossipSleepDuration     time.Duration `mapstructure:"peer_gossip_sleep_duration"`
	PeerQueryMaj23SleepDuration time.Duration `mapstructure:"peer_query_maj23_sleep_duration"`
	// contains filtered or unexported fields
}

ConsensusConfig defines the configuration for the Tendermint consensus service, including timeouts and details about the WAL and the block structure.

func DefaultConsensusConfig

func DefaultConsensusConfig() *ConsensusConfig

DefaultConsensusConfig returns a default configuration for the consensus service

func TestConsensusConfig

func TestConsensusConfig() *ConsensusConfig

TestConsensusConfig returns a configuration for testing the consensus service

func (*ConsensusConfig) Commit

func (cfg *ConsensusConfig) Commit(t time.Time) time.Time

Commit returns the amount of time to wait for straggler votes after receiving +2/3 precommits for a single block (ie. a commit).

func (*ConsensusConfig) Precommit

func (cfg *ConsensusConfig) Precommit(round int) time.Duration

Precommit returns the amount of time to wait for straggler votes after receiving any +2/3 precommits

func (*ConsensusConfig) Prevote

func (cfg *ConsensusConfig) Prevote(round int) time.Duration

Prevote returns the amount of time to wait for straggler votes after receiving any +2/3 prevotes

func (*ConsensusConfig) Propose

func (cfg *ConsensusConfig) Propose(round int) time.Duration

Propose returns the amount of time to wait for a proposal

func (*ConsensusConfig) SetWalFile

func (cfg *ConsensusConfig) SetWalFile(walFile string)

SetWalFile sets the path to the write-ahead log file

func (*ConsensusConfig) ValidateBasic

func (cfg *ConsensusConfig) ValidateBasic() error

ValidateBasic performs basic validation (checking param bounds, etc.) and returns an error if any check fails.

func (*ConsensusConfig) WaitForTxs

func (cfg *ConsensusConfig) WaitForTxs() bool

WaitForTxs returns true if the consensus should wait for transactions before entering the propose step

func (*ConsensusConfig) WalFile

func (cfg *ConsensusConfig) WalFile() string

WalFile returns the full path to the write-ahead log file

type FastSyncConfig

type FastSyncConfig struct {
	Version string `mapstructure:"version"`
}

FastSyncConfig defines the configuration for the Tendermint fast sync service

func DefaultFastSyncConfig

func DefaultFastSyncConfig() *FastSyncConfig

DefaultFastSyncConfig returns a default configuration for the fast sync service

func TestFastSyncConfig

func TestFastSyncConfig() *FastSyncConfig

TestFastSyncConfig returns a default configuration for the fast sync.

func (*FastSyncConfig) ValidateBasic

func (cfg *FastSyncConfig) ValidateBasic() error

ValidateBasic performs basic validation.

type FuzzConnConfig

type FuzzConnConfig struct {
	Mode         int
	MaxDelay     time.Duration
	ProbDropRW   float64
	ProbDropConn float64
	ProbSleep    float64
}

FuzzConnConfig is a FuzzedConnection configuration.

func DefaultFuzzConnConfig

func DefaultFuzzConnConfig() *FuzzConnConfig

DefaultFuzzConnConfig returns the default config.

type IDynamicConfig

type IDynamicConfig interface {
	GetMempoolRecheck() bool
	GetMempoolForceRecheckGap() int64
	GetMempoolSize() int
	GetMaxTxNumPerBlock() int64
	GetMaxGasUsedPerBlock() int64
	GetMempoolFlush() bool
	GetNodeKeyWhitelist() []string
	GetCsTimeoutPropose() time.Duration
	GetCsTimeoutProposeDelta() time.Duration
	GetCsTimeoutPrevote() time.Duration
	GetCsTimeoutPrevoteDelta() time.Duration
	GetCsTimeoutPrecommit() time.Duration
	GetCsTimeoutPrecommitDelta() time.Duration
	GetCsTimeoutCommit() time.Duration
	GetEnableWtx() bool
	GetDeliverTxsExecuteMode() int
	GetEnableHasBlockPartMsg() bool
}
var DynamicConfig IDynamicConfig = MockDynamicConfig{}

type InstrumentationConfig

type InstrumentationConfig struct {
	// When true, Prometheus metrics are served under /metrics on
	// PrometheusListenAddr.
	// Check out the documentation for the list of available metrics.
	Prometheus bool `mapstructure:"prometheus"`

	// Address to listen for Prometheus collector(s) connections.
	PrometheusListenAddr string `mapstructure:"prometheus_listen_addr"`

	// Maximum number of simultaneous connections.
	// If you want to accept a larger number than the default, make sure
	// you increase your OS limits.
	// 0 - unlimited.
	MaxOpenConnections int `mapstructure:"max_open_connections"`

	// Instrumentation namespace.
	Namespace string `mapstructure:"namespace"`
}

InstrumentationConfig defines the configuration for metrics reporting.

func DefaultInstrumentationConfig

func DefaultInstrumentationConfig() *InstrumentationConfig

DefaultInstrumentationConfig returns a default configuration for metrics reporting.

func TestInstrumentationConfig

func TestInstrumentationConfig() *InstrumentationConfig

TestInstrumentationConfig returns a default configuration for metrics reporting.

func (*InstrumentationConfig) ValidateBasic

func (cfg *InstrumentationConfig) ValidateBasic() error

ValidateBasic performs basic validation (checking param bounds, etc.) and returns an error if any check fails.

type MempoolConfig

type MempoolConfig struct {
	RootDir                    string   `mapstructure:"home"`
	Sealed                     bool     `mapstructure:"sealed"`
	Recheck                    bool     `mapstructure:"recheck"`
	Broadcast                  bool     `mapstructure:"broadcast"`
	WalPath                    string   `mapstructure:"wal_dir"`
	Size                       int      `mapstructure:"size"`
	MaxTxsBytes                int64    `mapstructure:"max_txs_bytes"`
	CacheSize                  int      `mapstructure:"cache_size"`
	MaxTxBytes                 int      `mapstructure:"max_tx_bytes"`
	MaxTxNumPerBlock           int64    `mapstructure:"max_tx_num_per_block"`
	MaxGasUsedPerBlock         int64    `mapstructure:"max_gas_used_per_block"`
	SortTxByGp                 bool     `mapstructure:"sort_tx_by_gp"`
	ForceRecheckGap            int64    `mapstructure:"force_recheck_gap"`
	TxPriceBump                uint64   `mapstructure:"tx_price_bump"`
	EnablePendingPool          bool     `mapstructure:"enable_pending_pool"`
	PendingPoolSize            int      `mapstructure:"pending_pool_size"`
	PendingPoolPeriod          int      `mapstructure:"pending_pool_period"`
	PendingPoolReserveBlocks   int      `mapstructure:"pending_pool_reserve_blocks"`
	PendingPoolMaxTxPerAddress int      `mapstructure:"pending_pool_max_tx_per_address"`
	NodeKeyWhitelist           []string `mapstructure:"node_key_whitelist"`
}

MempoolConfig defines the configuration options for the Tendermint mempool

func DefaultMempoolConfig

func DefaultMempoolConfig() *MempoolConfig

DefaultMempoolConfig returns a default configuration for the Tendermint mempool

func TestMempoolConfig

func TestMempoolConfig() *MempoolConfig

TestMempoolConfig returns a configuration for testing the Tendermint mempool

func (*MempoolConfig) GetNodeKeyWhitelist added in v1.1.6

func (cfg *MempoolConfig) GetNodeKeyWhitelist() []string

GetNodeKeyWhitelist first use the DynamicConfig to get secondly backup to the config file

func (*MempoolConfig) ValidateBasic

func (cfg *MempoolConfig) ValidateBasic() error

ValidateBasic performs basic validation (checking param bounds, etc.) and returns an error if any check fails.

func (*MempoolConfig) WalDir

func (cfg *MempoolConfig) WalDir() string

WalDir returns the full path to the mempool's write-ahead log

func (*MempoolConfig) WalEnabled

func (cfg *MempoolConfig) WalEnabled() bool

WalEnabled returns true if the WAL is enabled.

type MockDynamicConfig

type MockDynamicConfig struct {
}

func (MockDynamicConfig) GetCsTimeoutCommit added in v1.5.0

func (d MockDynamicConfig) GetCsTimeoutCommit() time.Duration

func (MockDynamicConfig) GetCsTimeoutPrecommit added in v0.19.17

func (d MockDynamicConfig) GetCsTimeoutPrecommit() time.Duration

func (MockDynamicConfig) GetCsTimeoutPrecommitDelta added in v0.19.17

func (d MockDynamicConfig) GetCsTimeoutPrecommitDelta() time.Duration

func (MockDynamicConfig) GetCsTimeoutPrevote added in v0.19.17

func (d MockDynamicConfig) GetCsTimeoutPrevote() time.Duration

func (MockDynamicConfig) GetCsTimeoutPrevoteDelta added in v0.19.17

func (d MockDynamicConfig) GetCsTimeoutPrevoteDelta() time.Duration

func (MockDynamicConfig) GetCsTimeoutPropose added in v0.19.17

func (d MockDynamicConfig) GetCsTimeoutPropose() time.Duration

func (MockDynamicConfig) GetCsTimeoutProposeDelta added in v0.19.17

func (d MockDynamicConfig) GetCsTimeoutProposeDelta() time.Duration

func (MockDynamicConfig) GetDeliverTxsExecuteMode added in v1.3.0

func (d MockDynamicConfig) GetDeliverTxsExecuteMode() int

func (MockDynamicConfig) GetEnableHasBlockPartMsg added in v1.5.0

func (d MockDynamicConfig) GetEnableHasBlockPartMsg() bool

func (MockDynamicConfig) GetEnableWtx added in v1.1.10

func (d MockDynamicConfig) GetEnableWtx() bool

func (MockDynamicConfig) GetMaxGasUsedPerBlock added in v0.19.16

func (d MockDynamicConfig) GetMaxGasUsedPerBlock() int64

func (MockDynamicConfig) GetMaxTxNumPerBlock added in v0.19.16

func (d MockDynamicConfig) GetMaxTxNumPerBlock() int64

func (MockDynamicConfig) GetMempoolFlush added in v0.19.16

func (d MockDynamicConfig) GetMempoolFlush() bool

func (MockDynamicConfig) GetMempoolForceRecheckGap

func (d MockDynamicConfig) GetMempoolForceRecheckGap() int64

func (MockDynamicConfig) GetMempoolRecheck

func (d MockDynamicConfig) GetMempoolRecheck() bool

func (MockDynamicConfig) GetMempoolSize

func (d MockDynamicConfig) GetMempoolSize() int

func (MockDynamicConfig) GetNodeKeyWhitelist added in v1.1.6

func (d MockDynamicConfig) GetNodeKeyWhitelist() []string

type P2PConfig

type P2PConfig struct {
	RootDir string `mapstructure:"home"`

	// Address to listen for incoming connections
	ListenAddress string `mapstructure:"laddr"`

	// Address to advertise to peers for them to dial
	ExternalAddress string `mapstructure:"external_address"`

	// Comma separated list of seed nodes to connect to
	// We only use these if we can’t connect to peers in the addrbook
	Seeds string `mapstructure:"seeds"`

	// Comma separated list of nodes to keep persistent connections to
	PersistentPeers string `mapstructure:"persistent_peers"`

	// UPNP port forwarding
	UPNP bool `mapstructure:"upnp"`

	// Path to address book
	AddrBook string `mapstructure:"addr_book_file"`

	// Set true for strict address routability rules
	// Set false for private or local networks
	AddrBookStrict bool `mapstructure:"addr_book_strict"`

	// Maximum number of inbound peers
	MaxNumInboundPeers int `mapstructure:"max_num_inbound_peers"`

	// Maximum number of outbound peers to connect to, excluding persistent peers
	MaxNumOutboundPeers int `mapstructure:"max_num_outbound_peers"`

	// List of node IDs, to which a connection will be (re)established ignoring any existing limits
	UnconditionalPeerIDs string `mapstructure:"unconditional_peer_ids"`

	// Maximum pause when redialing a persistent peer (if zero, exponential backoff is used)
	PersistentPeersMaxDialPeriod time.Duration `mapstructure:"persistent_peers_max_dial_period"`

	// Time to wait before flushing messages out on the connection
	FlushThrottleTimeout time.Duration `mapstructure:"flush_throttle_timeout"`

	// Maximum size of a message packet payload, in bytes
	MaxPacketMsgPayloadSize int `mapstructure:"max_packet_msg_payload_size"`

	// Rate at which packets can be sent, in bytes/second
	SendRate int64 `mapstructure:"send_rate"`

	// Rate at which packets can be received, in bytes/second
	RecvRate int64 `mapstructure:"recv_rate"`

	// Set true to enable the peer-exchange reactor
	PexReactor bool `mapstructure:"pex"`

	// Seed mode, in which node constantly crawls the network and looks for
	// peers. If another node asks it for addresses, it responds and disconnects.
	//
	// Does not work if the peer-exchange reactor is disabled.
	SeedMode bool `mapstructure:"seed_mode"`

	// Comma separated list of peer IDs to keep private (will not be gossiped to
	// other peers)
	PrivatePeerIDs string `mapstructure:"private_peer_ids"`

	// Toggle to disable guard against peers connecting from the same ip.
	AllowDuplicateIP bool `mapstructure:"allow_duplicate_ip"`

	// Peer connection configuration.
	HandshakeTimeout time.Duration `mapstructure:"handshake_timeout"`
	DialTimeout      time.Duration `mapstructure:"dial_timeout"`

	// Testing params.
	// Force dial to fail
	TestDialFail bool `mapstructure:"test_dial_fail"`
	// FUzz connection
	TestFuzz       bool            `mapstructure:"test_fuzz"`
	TestFuzzConfig *FuzzConnConfig `mapstructure:"test_fuzz_config"`
}

P2PConfig defines the configuration options for the Tendermint peer-to-peer networking layer

func DefaultP2PConfig

func DefaultP2PConfig() *P2PConfig

DefaultP2PConfig returns a default configuration for the peer-to-peer layer

func TestP2PConfig

func TestP2PConfig() *P2PConfig

TestP2PConfig returns a configuration for testing the peer-to-peer layer

func (*P2PConfig) AddrBookFile

func (cfg *P2PConfig) AddrBookFile() string

AddrBookFile returns the full path to the address book

func (*P2PConfig) ValidateBasic

func (cfg *P2PConfig) ValidateBasic() error

ValidateBasic performs basic validation (checking param bounds, etc.) and returns an error if any check fails.

type RPCConfig

type RPCConfig struct {
	RootDir string `mapstructure:"home"`

	// TCP or UNIX socket address for the RPC server to listen on
	ListenAddress string `mapstructure:"laddr"`

	// A list of origins a cross-domain request can be executed from.
	// If the special '*' value is present in the list, all origins will be allowed.
	// An origin may contain a wildcard (*) to replace 0 or more characters (i.e.: http://*.domain.com).
	// Only one wildcard can be used per origin.
	CORSAllowedOrigins []string `mapstructure:"cors_allowed_origins"`

	// A list of methods the client is allowed to use with cross-domain requests.
	CORSAllowedMethods []string `mapstructure:"cors_allowed_methods"`

	// A list of non simple headers the client is allowed to use with cross-domain requests.
	CORSAllowedHeaders []string `mapstructure:"cors_allowed_headers"`

	// TCP or UNIX socket address for the gRPC server to listen on
	// NOTE: This server only supports /broadcast_tx_commit
	GRPCListenAddress string `mapstructure:"grpc_laddr"`

	// Maximum number of simultaneous connections.
	// Does not include RPC (HTTP&WebSocket) connections. See max_open_connections
	// If you want to accept a larger number than the default, make sure
	// you increase your OS limits.
	// 0 - unlimited.
	GRPCMaxOpenConnections int `mapstructure:"grpc_max_open_connections"`

	// Activate unsafe RPC commands like /dial_persistent_peers and /unsafe_flush_mempool
	Unsafe bool `mapstructure:"unsafe"`

	// Maximum number of simultaneous connections (including WebSocket).
	// Does not include gRPC connections. See grpc_max_open_connections
	// If you want to accept a larger number than the default, make sure
	// you increase your OS limits.
	// 0 - unlimited.
	// Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files}
	// 1024 - 40 - 10 - 50 = 924 = ~900
	MaxOpenConnections int `mapstructure:"max_open_connections"`

	// Maximum number of unique clientIDs that can /subscribe
	// If you're using /broadcast_tx_commit, set to the estimated maximum number
	// of broadcast_tx_commit calls per block.
	MaxSubscriptionClients int `mapstructure:"max_subscription_clients"`

	// Maximum number of unique queries a given client can /subscribe to
	// If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set
	// to the estimated maximum number of broadcast_tx_commit calls per block.
	MaxSubscriptionsPerClient int `mapstructure:"max_subscriptions_per_client"`

	// How long to wait for a tx to be committed during /broadcast_tx_commit
	// WARNING: Using a value larger than 10s will result in increasing the
	// global HTTP write timeout, which applies to all connections and endpoints.
	// See https://github.com/tendermint/tendermint/issues/3435
	TimeoutBroadcastTxCommit time.Duration `mapstructure:"timeout_broadcast_tx_commit"`

	// Maximum size of request body, in bytes
	MaxBodyBytes int64 `mapstructure:"max_body_bytes"`

	// Maximum size of request header, in bytes
	MaxHeaderBytes int `mapstructure:"max_header_bytes"`

	// The path to a file containing certificate that is used to create the HTTPS server.
	// Migth be either absolute path or path related to tendermint's config directory.
	//
	// If the certificate is signed by a certificate authority,
	// the certFile should be the concatenation of the server's certificate, any intermediates,
	// and the CA's certificate.
	//
	// NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server.
	// Otherwise, HTTP server is run.
	TLSCertFile string `mapstructure:"tls_cert_file"`

	// The path to a file containing matching private key that is used to create the HTTPS server.
	// Migth be either absolute path or path related to tendermint's config directory.
	//
	// NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server.
	// Otherwise, HTTP server is run.
	TLSKeyFile string `mapstructure:"tls_key_file"`
}

RPCConfig defines the configuration options for the Tendermint RPC server

func DefaultRPCConfig

func DefaultRPCConfig() *RPCConfig

DefaultRPCConfig returns a default configuration for the RPC server

func TestRPCConfig

func TestRPCConfig() *RPCConfig

TestRPCConfig returns a configuration for testing the RPC server

func (RPCConfig) CertFile

func (cfg RPCConfig) CertFile() string

func (*RPCConfig) IsCorsEnabled

func (cfg *RPCConfig) IsCorsEnabled() bool

IsCorsEnabled returns true if cross-origin resource sharing is enabled.

func (RPCConfig) IsTLSEnabled

func (cfg RPCConfig) IsTLSEnabled() bool

func (RPCConfig) KeyFile

func (cfg RPCConfig) KeyFile() string

func (*RPCConfig) ValidateBasic

func (cfg *RPCConfig) ValidateBasic() error

ValidateBasic performs basic validation (checking param bounds, etc.) and returns an error if any check fails.

type TxIndexConfig

type TxIndexConfig struct {
	// What indexer to use for transactions
	//
	// Options:
	//   1) "null"
	//   2) "kv" (default) - the simplest possible indexer,
	//      backed by key-value storage (defaults to levelDB; see DBBackend).
	Indexer string `mapstructure:"indexer"`

	// Comma-separated list of compositeKeys to index (by default the only key is "tx.hash")
	//
	// You can also index transactions by height by adding "tx.height" key here.
	//
	// It's recommended to index only a subset of keys due to possible memory
	// bloat. This is, of course, depends on the indexer's DB and the volume of
	// transactions.
	IndexKeys string `mapstructure:"index_keys"`

	// When set to true, tells indexer to index all compositeKeys (predefined keys:
	// "tx.hash", "tx.height" and all keys from DeliverTx responses).
	//
	// Note this may be not desirable (see the comment above). IndexKeys has a
	// precedence over IndexAllKeys (i.e. when given both, IndexKeys will be
	// indexed).
	IndexAllKeys bool `mapstructure:"index_all_keys"`
}

----------------------------------------------------------------------------- TxIndexConfig Remember that Event has the following structure: type: [

key: value,
...

]

CompositeKeys are constructed by `type.key` TxIndexConfig defines the configuration for the transaction indexer, including composite keys to index.

func DefaultTxIndexConfig

func DefaultTxIndexConfig() *TxIndexConfig

DefaultTxIndexConfig returns a default configuration for the transaction indexer.

func TestTxIndexConfig

func TestTxIndexConfig() *TxIndexConfig

TestTxIndexConfig returns a default configuration for the transaction indexer.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL