Documentation
¶
Overview ¶
Package config provides DAG configuration helper methods and structs. Most notably, config provides the DagConfig struct, that of which is used to specify supply allocations, the dag identifier, and other metadata.
Package config provides DAG configuration helper methods and structs. Most notably, config provides the DagConfig struct, that of which is used to specify supply allocations, the dag identifier, and other metadata.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ( // DagConfigRequest represents the global dag config request message byte value. DagConfigRequest = []byte("dag_config_req") )
var ( // ErrCouldNotDeserializeConfig represents an invalidly serialized dag config--that of which cannot be correctly deserialized. ErrCouldNotDeserializeConfig = errors.New("could not deserialize dag config") )
Functions ¶
This section is empty.
Types ¶
type DagConfig ¶
type DagConfig struct { Alloc map[string]float64 `json:"alloc"` // Account balances at genesis Identifier string `json:"identifier"` // Dag/network name (e.g. "mainnet_beta", "mainnet_alpha") Network uint64 `json:"network"` // Dag version (e.g. 0 => mainnet, 1 => testnet, etc...) }
DagConfig represents a DAG configuration.
func DagConfigFromBytes ¶
DagConfigFromBytes deserializes a dag config from the given byte array b.
func NewDagConfig ¶
NewDagConfig initializes a new DagConfig from a given set of parameters.
func NewDagConfigFromGenesis ¶
NewDagConfigFromGenesis generates a new DagConfig from the given genesis.json file.
func ReadDagConfigFromMemory ¶
ReadDagConfigFromMemory reads a dag config with the given identifier from persistent memory.
func (*DagConfig) WriteToMemory ¶
WriteToMemory writes the given dag config to persistent memory.