Documentation
¶
Index ¶
Constants ¶
const ( LocalABCI = "local" SocketABCI = "socket" )
const DefaultDirPerm = 0o700
DefaultDirPerm is the default permissions used when creating directories.
Variables ¶
var ( DefaultDBDir = "db" DefaultConfigDir = "config" DefaultSecretsDir = "secrets" DefaultConfigFileName = "config.toml" )
Functions ¶
func WriteConfigFile ¶
WriteConfigFile renders config using the template and writes it to configFilePath.
Types ¶
type BaseConfig ¶
type BaseConfig struct {
// The root directory for all data.
// The node directory contains:
//
// ┌── db/
// │ ├── blockstore.db (folder)
// │ ├── gnolang.db (folder)
// │ └── state.db (folder)
// ├── wal/
// │ └── cs.wal (folder)
// ├── secrets/
// │ ├── priv_validator_state.json
// │ ├── node_key.json
// │ └── priv_validator_key.json
// └── config/
// └── config.toml (optional)
RootDir string `toml:"home"`
// TCP or UNIX socket address of the ABCI application,
// or the name of an ABCI application compiled in with the Tendermint binary,
// or empty if local application instance.
ProxyApp string `` /* 155-byte string literal not displayed */
// Local application instance in lieu of remote app.
LocalApp abci.Application `toml:"-"`
// A custom human readable name for this node
Moniker string `toml:"moniker" comment:"A custom human readable name for this node"`
// 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 `` /* 189-byte string literal not displayed */
// Database backend: pebbledb | goleveldb | boltdb
// * pebbledb (github.com/cockroachdb/pebble)
// - pure go
// - stable
// * goleveldb (github.com/syndtr/goleveldb)
// - pure go
// - stable
// - use goleveldb build tag
// * boltdb (uses etcd's fork of bolt - go.etcd.io/bbolt)
// - EXPERIMENTAL
// - may be faster is some use-cases (random reads - indexer)
// - use boltdb build tag (go build -tags boltdb)
DBBackend string `` /* 427-byte string literal not displayed */
// Database directory
DBPath string `toml:"db_dir" comment:"Database directory"`
// A JSON file containing the private key to use for p2p authenticated encryption
NodeKey string `` /* 130-byte string literal not displayed */
// Mechanism to connect to the ABCI application: local | socket
ABCI string `toml:"abci" comment:"Mechanism to connect to the ABCI application: socket | grpc"`
// TCP or UNIX socket address for the profiling server to listen on
ProfListenAddress string `toml:"prof_laddr" comment:"TCP or UNIX socket address for the profiling server to listen on"`
// 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 (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) NodeKeyFile ¶
func (cfg BaseConfig) NodeKeyFile() string
NodeKeyFile returns the full path to the node_key.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 `toml:",squash"`
// Options for services
RPC *rpc.RPCConfig `json:"rpc" toml:"rpc" comment:"##### rpc server configuration options #####"`
P2P *p2p.P2PConfig `json:"p2p" toml:"p2p" comment:"##### peer to peer configuration options #####"`
Mempool *mem.MempoolConfig `json:"mempool" toml:"mempool" comment:"##### mempool configuration options #####"`
Consensus *cns.ConsensusConfig `json:"consensus" toml:"consensus" comment:"##### consensus configuration options #####"`
TxEventStore *eventstore.Config `json:"tx_event_store" toml:"tx_event_store" comment:"##### event store #####"`
Telemetry *telemetry.Config `json:"telemetry" toml:"telemetry" comment:"##### node telemetry #####"`
Application *sdk.AppConfig `json:"application" toml:"application" comment:"##### app settings #####"`
}
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 LoadConfig ¶
LoadConfig loads the node configuration from disk
func LoadConfigFile ¶
LoadConfigFile loads the TOML node configuration from the specified path
func LoadOrMakeConfigWithOptions ¶
LoadOrMakeConfigWithOptions loads the configuration located in the given root directory, at [defaultConfigFilePath].
If the config does not exist, it is created, starting from the values in `DefaultConfig` and applying the defaults in opts.
func ResetTestRoot ¶
func TestConfig ¶
func TestConfig() *Config
TestConfig returns a configuration that can be used for testing
func (*Config) EnsureDirs ¶
EnsureDirs ensures default directories in root dir (and root dir).
func (*Config) SetRootDir ¶
SetRootDir sets the RootDir for all Config structs
func (*Config) ValidateBasic ¶
ValidateBasic performs basic validation (checking param bounds, etc.) and returns an error if any check fails.