config

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Apr 28, 2018 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultDataDir added in v0.4.7

func DefaultDataDir() string

DefaultDataDir is the default data directory to use for the databases and other persistence requirements.

func EnsureRoot

func EnsureRoot(rootDir string, network string)

***** these are for production settings **********

func GenesisBlock added in v0.5.1

func GenesisBlock() *types.Block

GenesisBlock will return genesis block

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

	//The ID of the network to json
	ChainID string `mapstructure:"chain_id"`

	// A JSON file containing the private key to use as a validator in the consensus protocol
	PrivateKey string `mapstructure:"private_key"`

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

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

	// 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
	FastSync bool `mapstructure:"fast_sync"`

	Mining bool `mapstructure:"mining"`

	FilterPeers bool `mapstructure:"filter_peers"` // false

	// What indexer to use for transactions
	TxIndex string `mapstructure:"tx_index"`

	// Database backend: leveldb | memdb
	DBBackend string `mapstructure:"db_backend"`

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

	// Keystore directory
	KeysPath string `mapstructure:"keys_dir"`

	// remote HSM url
	HsmUrl string `mapstructure:"hsm_url"`

	ApiAddress string `mapstructure:"api_addr"`

	Time time.Time
}

----------------------------------------------------------------------------- BaseConfig

func DefaultBaseConfig

func DefaultBaseConfig() BaseConfig

Default configurable base parameters.

func (BaseConfig) DBDir

func (b BaseConfig) DBDir() string

func (BaseConfig) KeysDir

func (b BaseConfig) KeysDir() string

type Config

type Config struct {
	// Top level options use an anonymous struct
	BaseConfig `mapstructure:",squash"`
	// Options for services
	P2P    *P2PConfig     `mapstructure:"p2p"`
	Wallet *WalletConfig  `mapstructure:"wallet"`
	Auth   *RPCAuthConfig `mapstructure:"auth"`
	Web    *WebConfig     `mapstructure:"web"`
}

func DefaultConfig

func DefaultConfig() *Config

Default configurable parameters.

func (*Config) SetRoot

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

Set the RootDir for all Config structs

type P2PConfig

type P2PConfig struct {
	RootDir          string `mapstructure:"home"`
	ListenAddress    string `mapstructure:"laddr"`
	Seeds            string `mapstructure:"seeds"`
	SkipUPNP         bool   `mapstructure:"skip_upnp"`
	AddrBook         string `mapstructure:"addr_book_file"`
	AddrBookStrict   bool   `mapstructure:"addr_book_strict"`
	PexReactor       bool   `mapstructure:"pex"`
	MaxNumPeers      int    `mapstructure:"max_num_peers"`
	HandshakeTimeout int    `mapstructure:"handshake_timeout"`
	DialTimeout      int    `mapstructure:"dial_timeout"`
}

P2PConfig

func DefaultP2PConfig

func DefaultP2PConfig() *P2PConfig

Default configurable p2p parameters.

func (*P2PConfig) AddrBookFile

func (p *P2PConfig) AddrBookFile() string

type RPCAuthConfig added in v0.3.0

type RPCAuthConfig struct {
	Disable bool `mapstructure:"disable"`
}

func DefaultRPCAuthConfig added in v0.3.0

func DefaultRPCAuthConfig() *RPCAuthConfig

Default configurable rpc's auth parameters.

type WalletConfig added in v0.1.1

type WalletConfig struct {
	Disable bool `mapstructure:"disable"`
}

-----------------------------------------------------------------------------

func DefaultWalletConfig added in v0.1.1

func DefaultWalletConfig() *WalletConfig

Default configurable wallet parameters.

type WebConfig added in v0.4.0

type WebConfig struct {
	Closed bool `mapstructure:"closed"`
}

func DefaultWebConfig added in v0.4.0

func DefaultWebConfig() *WebConfig

Default configurable web parameters.

Jump to

Keyboard shortcuts

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