topology

package
v0.0.0-...-3c986c5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2021 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Genesis

type Genesis struct {
	Address string
	// contains filtered or unexported fields
}

Genesis is a single attribute of the Topology (only one Genesis) that holds the Genesis data

func (*Genesis) FundCChainAddresses

func (g *Genesis) FundCChainAddresses(addrs []common.Address, amount uint64)

func (*Genesis) FundXChainAddresses

func (g *Genesis) FundXChainAddresses(addresses []string, amount uint64) *Genesis

FundXChainAddresses funds the genesis funds into an address on the XChain

func (*Genesis) ImportGenesisFunds

func (g *Genesis) ImportGenesisFunds() error

ImportGenesisFunds fetches the default funded funds and imports them

func (*Genesis) MoveBalanceToCChain

func (g *Genesis) MoveBalanceToCChain(addr common.Address, txFee uint64)

func (*Genesis) MultipleFundXChainAddresses

func (g *Genesis) MultipleFundXChainAddresses(addresses []string, amount uint64, times int) *Genesis

func (*Genesis) MultipleFundXChainAddresses2

func (g *Genesis) MultipleFundXChainAddresses2(addresses []string, amount uint64, times int) *Genesis

type Node

type Node struct {
	UserPass api.UserPass
	PAddress string
	XAddress string

	NodeID string
	// contains filtered or unexported fields
}

Node defines the Node in the Topology

func (*Node) BecomeDelegator

func (n *Node) BecomeDelegator(genesisAmount uint64, seedAmount uint64, delegatorAmount uint64, txFee uint64, stakerNodeID string) *Node

BecomeDelegator is a multi step methods that does the following - exports AVAX from the XChain + waits for acceptance in the XChain - imports the amount to the PChain + waits for acceptance in the PChain - verifies the PChain balance + verifies the XChain balance - adds nodeID as a delegator - waits Tx acceptance in the PChain - waits until the validation period begins

func (*Node) BecomeValidator

func (n *Node) BecomeValidator(genesisAmount uint64, seedAmount uint64, stakeAmount uint64, txFee uint64) *Node

BecomeValidator is a multi step methods that does the following - exports AVAX from the XChain + waits for acceptance in the XChain - imports the amount to the PChain + waits for acceptance in the PChain - verifies the PChain balance + verifies the XChain balance - adds nodeID as a validator - waits Tx acceptance in the PChain - waits until the validation period begins

func (*Node) CreateAddress

func (n *Node) CreateAddress() *Node

CreateAddress creates user and both XChain and PChain addresses for the Node

func (*Node) GetClient

func (n *Node) GetClient() *avalanchegoclient.Client

GetClient returns the RPC API client to access the nodes VMS

func (*Node) GetIPAddress

func (n *Node) GetIPAddress() string

type Topology

type Topology struct {
	// contains filtered or unexported fields
}

Topology defines how the nodes behave/capabilities in the network

func New

func New(network networks.Network, context *testsuite.TestContext) *Topology

New creates a new instance of the Topology

func (*Topology) AddGenesis

func (s *Topology) AddGenesis(nodeID string, username string, password string) *Topology

AddGenesis creates the Genesis property in the Topology

func (*Topology) AddNode

func (s *Topology) AddNode(id string, username string, password string) *Topology

AddNode adds a new now with both PChain and XChain address

func (*Topology) Genesis

func (s *Topology) Genesis() *Genesis

Genesis returns the Topology Genesis

func (*Topology) GetAllNodes

func (s *Topology) GetAllNodes() []*Node

func (*Topology) LoadDefinedNetwork

func (s *Topology) LoadDefinedNetwork(definedNetwork *networkbuilder.Network) *Topology

func (*Topology) Node

func (s *Topology) Node(nodeID string) *Node

Node returns a Node given the [nodeID]

func (*Topology) RemoveNode

func (s *Topology) RemoveNode(id string) *Topology

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL