config

package
v0.10.4 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Default permissions for writing files
	// These are based on default umask settings
	// User+Group: rw, Other: r
	FilePerms = 0664
	// User+Group: rwx, Other: rx
	DirPerms   = 0775
	FileName   = "config.toml"
	DefaultDir = ".olfullnode"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Node NodeConfig `toml:"node"`

	BroadcastMode string `toml:"async"`
	Proof         bool   `toml:"proof"`
}

type ConsensusConfig

type ConsensusConfig struct {
	LogOutput             string   `toml:"log_output" desc:"Determines where consensus is logged (stdout|<filename>)"`
	LogLevel              string   `toml:"log_level" desc:"Determines the verbosity of consensus logs"`
	TimeoutPropose        Duration `toml:"timeout_propose" desc:"All timeouts are in milliseconds"`
	TimeoutProposeDelta   Duration `toml:"timeout_propose_delta"`
	TimeoutPrevote        Duration `toml:"timeout_prevote"`
	TimeoutPrevoteDelta   Duration `toml:"timeout_prevote_delta"`
	TimeoutPrecommit      Duration `toml:"timeout_precommit"`
	TimeoutPrecommitDelta Duration `toml:"timeout_precommit_delta"`
	TimeoutCommit         Duration `toml:"timeout_commit"`

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

	CreateEmptyBlocks           bool     `toml:"create_empty_blocks" desc:"Should this node create empty blocks"`
	CreateEmptyBlocksInterval   Duration `toml:"create_empty_blocks_interval" desc:"Interval between empty block creation in milliseconds"`
	PeerGossipSleepDuration     Duration `toml:"peer_gossip_sleep_duration" desc:"Duration values in milliseconds"`
	PeerQueryMaj23SleepDuration Duration `toml:"peer_query_maj23_sleep_duration"`
	BlockTimeIota               Duration `toml:"blocktime_iota" desc:"Block time parameter, corresponds to the minimum time increment between consecutive blocks"`
}

ConsensusConfig handles consensus-specific options

func DefaultConsensusConfig

func DefaultConsensusConfig() *ConsensusConfig

func (*ConsensusConfig) TMConfig

func (cfg *ConsensusConfig) TMConfig() *tmconfig.ConsensusConfig

type Duration

type Duration int64

Duration is a time.Duration that marshals and unmarshals with millisecond values

func (Duration) Nanoseconds

func (d Duration) Nanoseconds() time.Duration

Returns a nanosecond duration

type GenesisDoc

type GenesisDoc = tmtypes.GenesisDoc

type MempoolConfig

type MempoolConfig struct {
	Recheck   bool `toml:"recheck"`
	Broadcast bool `toml:"broadcast"`
	Size      int  `toml:"size" desc:"Size of the mempool"`
	CacheSize int  `toml:"cache_size"`
}

MempoolConfig defines configuration options for the mempool

func DefaultMempoolConfig

func DefaultMempoolConfig() *MempoolConfig

func (*MempoolConfig) TMConfig

func (cfg *MempoolConfig) TMConfig() *tmconfig.MempoolConfig

type NetworkConfig

type NetworkConfig struct {
	RPCAddress string `toml:"rpc_address"`
	P2PAddress string `toml:"p2p_address" desc:"Main address for P2P connections"`

	ExternalP2PAddress string `toml:"external_p2p_address" desc:"Address to advertise for incoming peers to connect to"`

	SDKAddress string `toml:"sdk_address"`

	BTCAddress string `toml:"btc_address"`
	ETHAddress string `toml:"eth_address"`

	OLVMAddress  string `toml:"olvm_address"`
	OLVMProtocol string `toml:"olvm_protocol"`
}

NetworkConfig exposes configuration files for the current

func DefaultNetworkConfig

func DefaultNetworkConfig() *NetworkConfig

type NodeConfig

type NodeConfig struct {
	NodeName string `toml:"node_name"`
	FastSync bool   `` /* 143-byte string literal not displayed */
	DB       string `toml:"db" desc:"Specify what backend database to use (goleveldb|cleveldb)"`
	DBDir    string `toml:"db_dir" desc:"Specify the application database directory. This is always relative to the root directory of the app."`
	// List of transaction tags to index in the db, allows them to be searched
	// by this parameter
	IndexTags []string `toml:"index_tags" desc:"List of transaction tags to index in the database, allows them to be searched by the specified tags"`
	// Tells the indexer to index all available tags, IndexTags has precedence
	// over IndexAllTAgs
	IndexAllTags bool `toml:"index_all_tags" desc:"Tells the indexer to index all available tags, IndexTags has precedence over IndexAllTags"`
}

NodeConfig handles general configuration settings for the node

func DefaultNodeConfig

func DefaultNodeConfig() *NodeConfig

type P2PConfig

type P2PConfig struct {
	Seeds []string `toml:"seeds" desc:"List of seed nodes to connect to"`

	SeedMode bool `toml:"seed_mode" desc:"Enables seed mode, which will make the node crawl the network looking for peers"`

	PersistentPeers []string `toml:"persistent_peers" desc:"List of peers to maintain a persistent connection to"`

	UPNP bool `toml:"upnp" desc:"Enable UPNP port forwarding"`

	AddrBookStrict bool `` /* 155-byte string literal not displayed */

	MaxNumInboundPeers int `toml:"max_num_inbound_peers" desc:"Max number of inbound peers"`

	MaxNumOutboundPeers int `toml:"max_num_outbound_peers" desc:"Max number of outbound peers to connect to, excluding persistent peers"`

	FlushThrottleTimeout Duration `toml:"flush_throttle_timeout" desc:"Time to wait before flushing messages out on the connection in milliseconds"`

	MaxPacketMsgPayloadSize int `toml:"max_packet_msg_payload_size" desc:"Max size of a message packet payload, in bytes"`

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

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

	PexReactor bool `toml:"pex" desc:"Set true to enable the peer-exchange reactor"`

	PrivatePeerIDs []string `toml:"private_peer_ids" desc:"List of peer IDs to keep private (will not be gossiped to other peers)"`

	AllowDuplicateIP bool `toml:"allow_duplicate_ip" desc:"Toggle to disable guard against peers connecting from the same IP"`

	HandshakeTimeout Duration `toml:"handshake_timeout" desc:"In milliseconds"`
	DialTimeout      Duration `toml:"dial_timeout" desc:"In milliseconds"`
}

P2PConfig defines the options for P2P networking layer

func DefaultP2PConfig

func DefaultP2PConfig() *P2PConfig

func (*P2PConfig) TMConfig

func (cfg *P2PConfig) TMConfig() *tmconfig.P2PConfig

type Server

type Server struct {
	Node      *NodeConfig      `toml:"node"`
	Network   *NetworkConfig   `toml:"network"`
	P2P       *P2PConfig       `toml:"p2p"`
	Mempool   *MempoolConfig   `toml:"mempool"`
	Consensus *ConsensusConfig `toml:"consensus"`
	// contains filtered or unexported fields
}

Struct for holding the configuration details for the node

func DefaultServerConfig

func DefaultServerConfig() *Server

func (*Server) ChainID

func (cfg *Server) ChainID() string

func (*Server) Marshal

func (cfg *Server) Marshal() (text []byte, err error)

Marshal returns the text form of Server as TOML

func (*Server) ReadFile

func (cfg *Server) ReadFile(path string) error

ReadFile accepts a filepath and returns the

func (*Server) RootDir

func (cfg *Server) RootDir() string

func (*Server) SaveFile

func (cfg *Server) SaveFile(filepath string) error

SaveFile saves the current config to a file at the specified path

func (*Server) TMConfig

func (cfg *Server) TMConfig() tmconfig.Config

func (*Server) Unmarshal

func (cfg *Server) Unmarshal(text []byte) error

Marshal accepts the text form of a TOML configuration file and fills Server with its values

Jump to

Keyboard shortcuts

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