Documentation
¶
Overview ¶
Package node wires storage, state, consensus, chain, mempool and networking into a runnable ShadowLedger daemon.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
DataDir string `yaml:"data_dir"`
ControlAddr string `yaml:"control_addr"` // e.g. ":4004"
ShardAddr string `yaml:"shard_addr"` // e.g. ":4005"
Advertise string `yaml:"advertise"` // host others reach us at (default localhost)
NodeKey string `yaml:"node_key"` // path to identity wallet json
Validators []crypto.Address `yaml:"validators"` // authorized producer addresses
Seeds []string `yaml:"seeds"` // bootstrap control URLs (entry points)
DNSSeeds []string `yaml:"dns_seeds"` // DNS seed hostnames (A/AAAA list live node IPs)
Consensus string `yaml:"consensus"` // "authority" (default) | "postorage"
BlockTimeMS int `yaml:"block_time_ms"`
Genesis map[string]uint64 `yaml:"genesis"` // address -> funding (producer bootstrap)
}
Config is the node daemon configuration (YAML).
NOTE: erasure parameters (K/M) and shard replication are NOT configured here. The network decides them adaptively from the live node count (package netparams). Operators only choose identity, endpoints, who they trust as validators, and how to find the network.
func LoadConfig ¶
LoadConfig reads and defaults a config file.
func LoadConfigOrMainnet ¶ added in v0.7.0
LoadConfigOrMainnet loads the config at path, or — if it does not exist — returns the embedded mainnet config so `slnode` runs with ZERO setup (like `bitcoind` connecting to Bitcoin mainnet out of the box). A partial config is merged over the embedded network params, so an operator only overrides what they care about (e.g. node_key + advertise for the validator node).
func MainnetConfig ¶ added in v0.7.0
func MainnetConfig() *Config
MainnetConfig is the fully-defaulted embedded mainnet configuration.