Run NodesReferencetestsFixture

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() uint32

GetDefaultNetworkID 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) error

ValidateGenesis 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) string

GenesisConfig

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) error
func (n *Network) EnsureNodeConfig(node *Node) error
func (n *Network) GetBootstrapIPsAndIDs() ([]string, []string)
func (n *Network) Start(ctx context.Context, log log.Logger) error
func (n *Network) Stop(ctx context.Context) error
func (n *Network) Write() error

Node

Node represents a node in a local test network

func NewNode() *Node
func ReadNode(nodeDir string) (*Node, error)
func (n *Node) EnsureBLSSigningKey() error
func (n *Node) EnsureKeys() error
func (n *Node) GetURI() string
func (n *Node) InitiateStop() error
func (n *Node) IsRunning() bool
func (n *Node) Start(ctx context.Context, log log.Logger) error
func (n *Node) Stop(ctx context.Context) error
func (n *Node) WaitForStopped(ctx context.Context) error
func (n *Node) Write() error

NodeConfig

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