tmpnet
Package tmpnet
import "github.com/luxfi/node/tests/fixture/tmpnet"Functions
GenerateNodeID
func GenerateNodeID() (ids.NodeID, error)GenerateNodeID generates a random NodeID for testing purposes
GetDefaultNetworkID
func GetDefaultNetworkID() uint32GetDefaultNetworkID returns the default network ID for testing
NewTestGenesisWithFunds
func NewTestGenesisWithFunds(
networkID uint32,
nodes []*Node,
fundedKeys []*secp256k1.PrivateKey,
) ([]byte, error)NewTestGenesisWithFunds creates a test genesis configuration with funded accounts
ValidateGenesis
func ValidateGenesis(genesisBytes []byte) errorValidateGenesis validates a genesis configuration
Types
Allocation
Allocation represents an initial fund allocation
Chain
Chain represents a blockchain in a net
Flags
Flags is a map of node flags with helper methods
func (f Flags) GetStringVal(key string) stringGenesisConfig
GenesisConfig represents genesis configuration
Net
Net represents a net (non-primary chain) in the network
Network
Network represents a local test network
func ReadNetwork(ctx context.Context, log log.Logger, networkDir string) (*Network, error)func (n *Network) EnsureDefaultConfig(log log.Logger) errorfunc (n *Network) EnsureNodeConfig(node *Node) errorfunc (n *Network) GetBootstrapIPsAndIDs() ([]string, []string)func (n *Network) Start(ctx context.Context, log log.Logger) errorfunc (n *Network) Stop(ctx context.Context) errorfunc (n *Network) Write() errorNode
Node represents a node in a local test network
func NewNode() *Nodefunc ReadNode(nodeDir string) (*Node, error)func (n *Node) EnsureBLSSigningKey() errorfunc (n *Node) EnsureKeys() errorfunc (n *Node) GetURI() stringfunc (n *Node) InitiateStop() errorfunc (n *Node) IsRunning() boolfunc (n *Node) Start(ctx context.Context, log log.Logger) errorfunc (n *Node) Stop(ctx context.Context) errorfunc (n *Node) WaitForStopped(ctx context.Context) errorfunc (n *Node) Write() errorNodeConfig
NodeConfig is the serialized node configuration
NodeRuntimeConfig
NodeRuntimeConfig configures how nodes are run
ProcessRuntimeConfig
ProcessRuntimeConfig configures process execution
Staker
Staker represents an initial staker
UnlockPeriod
UnlockPeriod represents a vesting unlock period