Documentation
¶
Index ¶
- Constants
- func GetDefaultNetworkID() uint32
- func NewTestGenesisWithFunds(networkID uint32, nodes []*Node, fundedKeys []*secp256k1.PrivateKey) ([]byte, error)
- func ValidateGenesis(genesisBytes []byte) error
- type Allocation
- type Chain
- type GenesisConfig
- type Network
- type Node
- type NodeConfig
- type NodeRuntimeConfig
- type ProcessRuntimeConfig
- type Staker
- type Subnet
- type UnlockPeriod
Constants ¶
const (
DefaultNetworkTimeout = 2 * time.Minute
)
Variables ¶
This section is empty.
Functions ¶
func GetDefaultNetworkID ¶ added in v1.16.56
func GetDefaultNetworkID() uint32
GetDefaultNetworkID returns the default network ID for testing
func NewTestGenesisWithFunds ¶ added in v1.1.11
func NewTestGenesisWithFunds( networkID uint32, nodes []*Node, fundedKeys []*secp256k1.PrivateKey, ) ([]byte, error)
NewTestGenesisWithFunds creates a test genesis configuration with funded accounts
func ValidateGenesis ¶ added in v1.16.56
ValidateGenesis validates a genesis configuration
Types ¶
type Allocation ¶ added in v1.16.56
type Allocation struct {
ETHAddr string `json:"ethAddr"`
LUXAddr string `json:"luxAddr"`
InitialAmount uint64 `json:"initialAmount"`
UnlockSchedule []UnlockPeriod `json:"unlockSchedule,omitempty"`
}
Allocation represents an initial fund allocation
type GenesisConfig ¶ added in v1.16.56
type GenesisConfig struct {
NetworkID uint32 `json:"networkID"`
Allocations []Allocation `json:"allocations"`
StartTime uint64 `json:"startTime"`
InitialStakeDuration uint64 `json:"initialStakeDuration"`
InitialStakeDurationOffset uint64 `json:"initialStakeDurationOffset"`
InitialStakedFunds []string `json:"initialStakedFunds"`
InitialStakers []Staker `json:"initialStakers"`
CChainGenesis string `json:"cChainGenesis"`
Message string `json:"message"`
}
GenesisConfig represents genesis configuration
type Network ¶
type Network struct {
UUID string
NetworkID uint32
Owner string
Dir string
Nodes []*Node
DefaultRuntimeConfig NodeRuntimeConfig
Genesis []byte
// Track subnets/chains
Subnets []*Subnet
}
Network represents a local test network
func ReadNetwork ¶
ReadNetwork reads a network from its directory
func (*Network) GetBootstrapIPsAndIDs ¶
GetBootstrapIPsAndIDs returns the bootstrap IPs and IDs for the network
type Node ¶
type Node struct {
NodeID ids.NodeID
URI string
StakingPort uint64
HTTPPort uint64
DataDir string
RuntimeConfig *NodeRuntimeConfig
Flags map[string]interface{}
// BLS signing key
SigningKey *bls.SecretKey
// Staking credentials
StakingKey []byte
StakingCert []byte
// contains filtered or unexported fields
}
Node represents a node in a local test network
type NodeConfig ¶ added in v1.1.11
type NodeConfig struct {
NodeID string `json:"nodeID"`
URI string `json:"uri"`
StakingPort uint64 `json:"stakingPort"`
HTTPPort uint64 `json:"httpPort"`
DataDir string `json:"dataDir"`
Flags map[string]interface{} `json:"flags"`
}
NodeConfig is the serialized node configuration
type NodeRuntimeConfig ¶
type NodeRuntimeConfig struct {
Process *ProcessRuntimeConfig
}
NodeRuntimeConfig configures how nodes are run
type ProcessRuntimeConfig ¶
type ProcessRuntimeConfig struct {
LuxdPath string
}
ProcessRuntimeConfig configures process execution
type Staker ¶ added in v1.16.56
type Staker struct {
NodeID string `json:"nodeID"`
RewardAddress string `json:"rewardAddress"`
DelegationFee uint32 `json:"delegationFee"`
}
Staker represents an initial staker
type UnlockPeriod ¶ added in v1.16.56
UnlockPeriod represents a vesting unlock period