Documentation ¶
Index ¶
Constants ¶
const ( DefaultNodeCount = 5 DefaultFundedKeyCount = 50 )
Variables ¶
This section is empty.
Functions ¶
func DefaultJSONMarshal ¶
Marshal to json with default prefix and indent.
func NewTestGenesis ¶
func NewTestGenesis( networkID uint32, xChainBalances []AddrAndBalance, validatorIDs []ids.NodeID, ) (*genesis.UnparsedConfig, error)
Create a genesis struct valid for bootstrapping a test network. Note that many of the genesis fields (e.g. reward addresses) are randomly generated or hard-coded.
Types ¶
type AddrAndBalance ¶
type FlagsMap ¶
type FlagsMap map[string]interface{}
Defines a mapping of flag keys to values intended to be supplied to an invocation of an AvalancheGo node.
func ReadFlagsMap ¶
Utility function simplifying construction of a FlagsMap from a file.
func (FlagsMap) GetStringVal ¶
GetStringVal simplifies retrieving a map value as a string.
func (FlagsMap) SetDefaults ¶
SetDefaults ensures the effectiveness of flag overrides by only setting values supplied in the defaults map that are not already explicitly set.
type Network ¶
type Network interface { GetConfig() NetworkConfig GetNodes() []Node }
Defines network capabilities supportable regardless of how a network is orchestrated.
type NetworkConfig ¶
type NetworkConfig struct { Genesis *genesis.UnparsedConfig CChainConfig FlagsMap DefaultFlags FlagsMap FundedKeys []*secp256k1.PrivateKey }
NetworkConfig defines configuration shared or common to all nodes in a given network.
func (*NetworkConfig) EnsureGenesis ¶
func (c *NetworkConfig) EnsureGenesis(networkID uint32, validatorIDs []ids.NodeID) error
Ensure genesis is generated if not already present.
type Node ¶
type Node interface { GetID() ids.NodeID GetConfig() NodeConfig GetProcessContext() node.NodeProcessContext }
Defines node capabilities supportable regardless of how a network is orchestrated.
type NodeConfig ¶
NodeConfig defines configuration for an AvalancheGo node.
func NewNodeConfig ¶
func NewNodeConfig() *NodeConfig
func (*NodeConfig) EnsureBLSSigningKey ¶
func (nc *NodeConfig) EnsureBLSSigningKey() error
Ensures a BLS signing key is generated if not already present.
func (*NodeConfig) EnsureKeys ¶
func (nc *NodeConfig) EnsureKeys() error
Ensures staking and signing keys are generated if not already present and that the node ID (derived from the staking keypair) is set.
func (*NodeConfig) EnsureNodeID ¶
func (nc *NodeConfig) EnsureNodeID() error
Attempt to derive the node ID from the node configuration.
func (*NodeConfig) EnsureStakingKeypair ¶
func (nc *NodeConfig) EnsureStakingKeypair() error
Ensures a staking keypair is generated if not already present.
func (*NodeConfig) SetNetworkingConfigDefaults ¶
func (nc *NodeConfig) SetNetworkingConfigDefaults( httpPort uint16, stakingPort uint16, bootstrapIDs []string, bootstrapIPs []string, )
Convenience method for setting networking flags.