Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultKeyfile defines the default name of the file containing the // validator's private key DefaultKeyfile = "priv_key" // DefaultBadgerFile defines the default name of the folder containing the // Badger database DefaultBadgerFile = "badger_db" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct { // DataDir is the top-level directory containing Babble configuration and // data DataDir string `mapstructure:"datadir"` // LogLevel determines the chattiness of the log output. LogLevel string `mapstructure:"log"` // BindAddr is the address:port where this node gossips with other nodes. BindAddr string `mapstructure:"listen"` // ServiceAddr is the address:port that serves the user-facing API. ServiceAddr string `mapstructure:"service-listen"` // HeartbeatTimeout is the frequency of the gossip timer. HeartbeatTimeout time.Duration `mapstructure:"heartbeat"` // MaxPool controls how many connections are pooled per target in the gossip // routines. MaxPool int `mapstructure:"max-pool"` // TCPTimeout is the timeout of gossip TCP connections. TCPTimeout time.Duration `mapstructure:"timeout"` // JoinTimeout is the timeout of Join Requests JoinTimeout time.Duration `mapstructure:"join_timeout"` // SyncLimit defines the max number of hashgraph events to include in a // SyncResponse or EagerSyncRequest SyncLimit int `mapstructure:"sync-limit"` // EnableFastSync determines whether or not to enable the FastSync protocol. EnableFastSync bool `mapstructure:"fast-sync"` // Store is a flag that determines whether or not to use persistant storage. Store bool `mapstructure:"store"` // CacheSize is the max number of items in in-memory caches. CacheSize int `mapstructure:"cache-size"` // Bootstrap determines whether or not to load Babble from an existing // database file. Bootstrap bool `mapstructure:"bootstrap"` // Moniker defines the friendly name of this node Moniker string `mapstructure:"moniker"` // LoadPeers determines whether or not to attempt loading the peer-set from // a local json file. LoadPeers bool // Proxy is the application proxy that enables Babble to communicate with // application. Proxy proxy.AppProxy // Key is the private key of the validator. Key *ecdsa.PrivateKey // contains filtered or unexported fields }
Config contains all the configuration properties of a Babble node.
func NewDefaultConfig ¶
func NewDefaultConfig() *Config
NewDefaultConfig retunrns the a config object with default values.
func NewTestConfig ¶
NewTestConfig returns a config object with default values and a special logger. the logger forces formatting and colors even when there is no tty attached, which makes for more readable logs. The logger also provides info about the calling function.
func (*Config) BadgerDir ¶
BadgerDir returs the full path of the folder containing the Babdger database.
Click to show internal directories.
Click to hide internal directories.