Documentation ¶
Overview ¶
Package configuration holds shared configuration structs for Monet, EVM-Lite and Babble.
Index ¶
Constants ¶
const ( BabbleDir = "babble" EthDir = "eth" KeyStoreDir = "keystore" POADir = "poa" ServerDir = "server" )
Directory Constants
const ( MonetdTomlDirDot = ".monet" MonetdTomlDirCaps = "MONET" )
Monetd Configuration Directory
const ( PeersJSON = "peers.json" PeersGenesisJSON = "peers.genesis.json" GenesisJSON = "genesis.json" MonetTomlFile = "monetd.toml" WalletTomlFile = "wallet.toml" ServerPIDFile = "server.pid" Chaindata = "chaindata" )
Filename constants
const ( DefaultGossipPort = "1337" DefaultAPIAddr = ":8080" )
Network Constants
const ( DefaultKeyfile = "keyfile.json" DefaultPrivateKeyFile = "priv_key" )
Keys constants
const ( DefaultAccountBalance = "1234567890000000000000" DefaultContractAddress = "abbaabbaabbaabbaabbaabbaabbaabbaabbaabba" GenesisContract = "contract0.sol" GenesisABI = "contract0.abi" CompileResultFile = "compile.toml" )
Genesis Constants
Variables ¶
var ( // Global is a global Config object used by commands in cmd/ to manipulate // configuration options. Global = DefaultConfig() )
Functions ¶
func DefaultConfigDir ¶
DefaultConfigDir returns a the full path for the default location for a configuration file.
func DefaultMonetConfigDir ¶
DefaultMonetConfigDir is a wrapper for DefaultConfigDir, but returns the location of the monetd configuration file.
func GlobalTOML ¶
GlobalTOML converts the global Config object into a TOML string
Types ¶
type BabbleConfig ¶
type BabbleConfig struct { // Address of Babble node (where it talks to other Babble nodes) BindAddr string `mapstructure:"listen"` // Gossip heartbeat Heartbeat time.Duration `mapstructure:"heartbeat"` // TCP timeout TCPTimeout time.Duration `mapstructure:"timeout"` // Max number of items in caches CacheSize int `mapstructure:"cache-size"` // Max number of Event in SyncResponse SyncLimit int `mapstructure:"sync-limit"` // Max number of connections in net pool MaxPool int `mapstructure:"max-pool"` // Bootstrap from database Bootstrap bool `mapstructure:"bootstrap"` }
BabbleConfig contains the configuration for the Babble node used by monetd. It only presents a subset of the options Babble can accept, because monetd forces some configurations values. In particular, the --fast-sync and --store flags are disabled because monetd does not support the FastSync protocol, and it requires a persistant database.
func DefaultBabbleConfig ¶
func DefaultBabbleConfig() *BabbleConfig
DefaultBabbleConfig returns the default configuration for a Babble node
type BaseConfig ¶
type BaseConfig struct { // Top-level directory of evm-babble data DataDir string `mapstructure:"datadir"` // Verbose Verbose bool `mapstructure:"verbose"` // IP/PORT of API APIAddr string `mapstructure:"api-listen"` // contains filtered or unexported fields }
BaseConfig contains the top level configuration for an EVM-Babble node
func DefaultBaseConfig ¶
func DefaultBaseConfig() BaseConfig
DefaultBaseConfig returns the default top-level configuration for EVM-Babble
type Config ¶
type Config struct { // Top level options use an anonymous struct BaseConfig `mapstructure:",squash"` // Options for evm-lite Eth *EthConfig `mapstructure:"eth"` // Options for Babble Babble *BabbleConfig `mapstructure:"babble"` }
Config contains the configuration for MONET node
func DefaultConfig ¶
func DefaultConfig() *Config
DefaultConfig returns the default configuration for a MONET node
func (*Config) ToBabbleConfig ¶
func (c *Config) ToBabbleConfig() *babble_config.Config
ToBabbleConfig extracts the babble configuration and returns a config object as used by the Babble library. It enforces the values of Store and EnableFastSync to true and false respectively.
func (*Config) ToEVMLConfig ¶
func (c *Config) ToEVMLConfig() *evml_config.Config
ToEVMLConfig extracts evm-lite configuration and returns a config object as used by the evm-lite library.
type EthConfig ¶
type EthConfig struct { // Megabytes of memory allocated to internal caching (min 16MB / database forced) Cache int `mapstructure:"cache"` }
EthConfig contains the configuration relative to the accounts, EVM, trie/db, and service API
func DefaultEthConfig ¶
func DefaultEthConfig() *EthConfig
DefaultEthConfig return the default configuration for Eth services