tenderseed

package
v0.0.0-...-10a64d5 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2023 License: BlueOak-1.0.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MkdirAllPanic

func MkdirAllPanic(path string, perm os.FileMode)

MkdirAllPanic invokes os.MkdirAll but panics if there is an error

func WriteConfigToFile

func WriteConfigToFile(file string, config Config) error

WriteConfigToFile writes the seed config to file

Types

type Config

type Config struct {
	ListenAddress           string `toml:"laddr" comment:"Address to listen for incoming connections"`
	ChainID                 string `toml:"chain_id" comment:"network identifier (todo move to cli flag argument? keeps the config network agnostic)"`
	LogLevel                string `toml:"log_level" comment:"logging level to filter output (\"info\", \"debug\", \"error\" or \"none\")"`
	NodeKeyFile             string `toml:"node_key_file" comment:"path to node_key (relative to tendermint-seed home directory or an absolute path)"`
	AddrBookFile            string `toml:"addr_book_file" comment:"path to address book (relative to tendermint-seed home directory or an absolute path)"`
	AddrBookStrict          bool   `toml:"addr_book_strict" comment:"Set true for strict routability rules\n Set false for private or local networks"`
	MaxNumInboundPeers      int    `toml:"max_num_inbound_peers" comment:"maximum number of inbound connections"`
	MaxNumOutboundPeers     int    `toml:"max_num_outbound_peers" comment:"maximum number of outbound connections"`
	MaxPacketMsgPayloadSize int    `toml:"max_packet_msg_payload_size" comment:"maximum size of a message packet payload, in bytes"`
	Seeds                   string `toml:"seeds" comment:"seed nodes we can use to discover peers"`
}

Config is a tenderseed configuration

func DefaultConfig

func DefaultConfig() *Config

DefaultConfig returns a seed config initialized with default values

func LoadConfigFromFile

func LoadConfigFromFile(file string) (*Config, error)

LoadConfigFromFile loads a seed config from a file

func LoadOrGenConfig

func LoadOrGenConfig(filePath string) (*Config, error)

LoadOrGenConfig loads a seed config from file if the file exists If the file does not exist, make a default config, write it to the file Return either the loaded config or a default config

Jump to

Keyboard shortcuts

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