Documentation ¶
Index ¶
- Constants
- func NewDefaultConfig(binaryPath string) network.Config
- func NewDefaultConfigNNodes(binaryPath string, numNodes uint32) (network.Config, error)
- func NewDefaultNetwork(log logging.Logger, binaryPath string) (network.Network, error)
- func NewNetwork(log logging.Logger, networkConfig network.Config, dir string) (network.Network, error)
- type NodeConfig
- type NodeProcess
- type NodeProcessCreator
Constants ¶
const (
DefaultNumNodes = 5
)
Variables ¶
This section is empty.
Functions ¶
func NewDefaultConfig ¶
NewDefaultConfig creates a new default network config
func NewDefaultConfigNNodes ¶ added in v1.0.9
NewDefaultConfigNNodes creates a new default network config, with an arbitrary number of nodes
func NewDefaultNetwork ¶
NewDefaultNetwork returns a new network using a pre-defined network configuration. The following addresses are pre-funded: X-Chain Address 1: X-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p X-Chain Address 1 Key: PrivateKey-ewoqjP7PxY4yr3iLTpLisriqt94hdyDFNgchSxGGztUrTXtNN X-Chain Address 2: X-custom16045mxr3s2cjycqe2xfluk304xv3ezhkhsvkpr X-Chain Address 2 Key: PrivateKey-2fzYBh3bbWemKxQmMfX6DSuL2BFmDSLQWTvma57xwjQjtf8gFq P-Chain Address 1: P-custom18jma8ppw3nhx5r4ap8clazz0dps7rv5u9xde7p P-Chain Address 1 Key: PrivateKey-ewoqjP7PxY4yr3iLTpLisriqt94hdyDFNgchSxGGztUrTXtNN P-Chain Address 2: P-custom16045mxr3s2cjycqe2xfluk304xv3ezhkhsvkpr P-Chain Address 2 Key: PrivateKey-2fzYBh3bbWemKxQmMfX6DSuL2BFmDSLQWTvma57xwjQjtf8gFq C-Chain Address: 0x8db97C7cEcE249c2b98bDC0226Cc4C2A57BF52FC C-Chain Address Key: 56289e99c94b6912bfc12adc093c9b51124f0dc54ac7a766b2bc5ccf558d8027 The following nodes are validators: * NodeID-7Xhw2mDxuDS44j42TCB6U5579esbSt3Lg * NodeID-MFrZFVCXPv5iCn6M9K6XduxGTYp891xXZ * NodeID-NFBbbJ4qCmNaCzeW7sxErhvWqvEQMnYcN * NodeID-GWPcbFJZFfZreETSoWjPimr846mXEKCtu * NodeID-P7oB2McjBGgW2NXXWVYjV8JEDFoW9xDE5
func NewNetwork ¶
func NewNetwork( log logging.Logger, networkConfig network.Config, dir string, ) (network.Network, error)
NewNetwork returns a new network from the given config that uses the given log. Files (e.g. logs, databases) default to being written at directory [dir]. If there isn't a directory at [dir] one will be created. If len([dir]) == 0, files will be written underneath a new temporary directory.
Types ¶
type NodeConfig ¶
type NodeConfig struct { // What type of node this is BinaryPath string `json:"binaryPath"` // If non-nil, direct this node's Stdout to os.Stdout RedirectStdout bool `json:"redirectStdout"` // If non-nil, direct this node's Stderr to os.Stderr RedirectStderr bool `json:"redirectStderr"` }
NodeConfig configurations which are specific to the local implementation of a network / node.
type NodeProcess ¶
type NodeProcess interface { // Start this process Start() error // Send a SIGTERM to this process Stop() error // Returns when the process finishes exiting Wait() error }
NodeProcess as an interface so we can mock running AvalancheGo binaries in tests
type NodeProcessCreator ¶
type NodeProcessCreator interface {
NewNodeProcess(config node.Config, args ...string) (NodeProcess, error)
}
NodeProcessCreator is an interface for new node process creation