Documentation
¶
Index ¶
- Variables
- func AVAXAssetID(avmGenesisBytes []byte) (ids.ID, error)
- func Aliases(genesisBytes []byte) (map[string][]string, map[[32]byte][]string, map[[32]byte][]string, error)
- func FromConfig(config *Config) ([]byte, ids.ID, error)
- func Genesis(networkID uint32) ([]byte, ids.ID, error)
- func SampleBeacons(networkID uint32, count int) ([]string, []string)
- func VMGenesis(networkID uint32, vmID ids.ID) (*platformvm.Tx, error)
- type Allocation
- type Config
- type LockedAmount
- type Params
- type Staker
- type UnparsedAllocation
- type UnparsedConfig
- type UnparsedStaker
Constants ¶
This section is empty.
Variables ¶
View Source
var (
EVMID = ids.NewID([32]byte{'e', 'v', 'm'})
)
ID of the EVM VM
View Source
var ( // FujiParams are the params used for the fuji testnet FujiParams = Params{ TxFee: units.MilliAvax, CreationTxFee: 10 * units.MilliAvax, UptimeRequirement: .6, MinValidatorStake: 1 * units.Avax, MaxValidatorStake: 3 * units.MegaAvax, MinDelegatorStake: 1 * units.Avax, MinDelegationFee: 20000, MinStakeDuration: 24 * time.Hour, MaxStakeDuration: 365 * 24 * time.Hour, StakeMintingPeriod: 365 * 24 * time.Hour, } )
View Source
var ( // LocalParams are the params used for local networks LocalParams = Params{ TxFee: units.MilliAvax, CreationTxFee: 10 * units.MilliAvax, UptimeRequirement: .6, MinValidatorStake: 1 * units.Avax, MaxValidatorStake: 3 * units.MegaAvax, MinDelegatorStake: 1 * units.Avax, MinDelegationFee: 20000, MinStakeDuration: 24 * time.Hour, MaxStakeDuration: 365 * 24 * time.Hour, StakeMintingPeriod: 365 * 24 * time.Hour, } )
View Source
var ( // MainnetParams are the params used for mainnet MainnetParams = Params{ TxFee: units.MilliAvax, CreationTxFee: 10 * units.MilliAvax, UptimeRequirement: .6, MinValidatorStake: 2 * units.KiloAvax, MaxValidatorStake: 3 * units.MegaAvax, MinDelegatorStake: 25 * units.Avax, MinDelegationFee: 20000, MinStakeDuration: 2 * 7 * 24 * time.Hour, MaxStakeDuration: 365 * 24 * time.Hour, StakeMintingPeriod: 365 * 24 * time.Hour, } )
Functions ¶
func AVAXAssetID ¶ added in v0.8.0
AVAXAssetID ...
func Aliases ¶
func Aliases(genesisBytes []byte) (map[string][]string, map[[32]byte][]string, map[[32]byte][]string, error)
Aliases returns the default aliases based on the network ID
func FromConfig ¶
FromConfig returns:
- The byte representation of the genesis state of the platform chain (ie the genesis state of the network)
- The asset ID of AVAX
func Genesis ¶
Genesis returns:
- The byte representation of the genesis state of the platform chain (ie the genesis state of the network)
- The asset ID of AVAX
func SampleBeacons ¶ added in v1.0.0
SampleBeacons returns the some beacons this node should connect to
Types ¶
type Allocation ¶ added in v1.0.0
type Allocation struct {
ETHAddr ids.ShortID `json:"ethAddr"`
AVAXAddr ids.ShortID `json:"avaxAddr"`
InitialAmount uint64 `json:"initialAmount"`
UnlockSchedule []LockedAmount `json:"unlockSchedule"`
}
Allocation ...
func (Allocation) Unparse ¶ added in v1.0.0
func (a Allocation) Unparse(networkID uint32) (UnparsedAllocation, error)
Unparse ...
type Config ¶
type Config struct {
NetworkID uint32 `json:"networkID"`
Allocations []Allocation `json:"allocations"`
StartTime uint64 `json:"startTime"`
InitialStakeDuration uint64 `json:"initialStakeDuration"`
InitialStakeDurationOffset uint64 `json:"initialStakeDurationOffset"`
InitialStakedFunds []ids.ShortID `json:"unitialStakedFunds"`
InitialStakers []Staker `json:"initialStakers"`
CChainGenesis string `json:"cChainGenesis"`
Message string `json:"message"`
}
Config contains the genesis addresses used to construct a genesis
var ( // MainnetConfig is the config that should be used to generate the mainnet // genesis. MainnetConfig Config // FujiConfig is the config that should be used to generate the fuji // genesis. FujiConfig Config // LocalConfig is the config that should be used to generate a local // genesis. LocalConfig Config )
func (*Config) InitialSupply ¶ added in v1.0.0
InitialSupply ...
func (Config) Unparse ¶ added in v1.0.0
func (c Config) Unparse() (UnparsedConfig, error)
Unparse ...
type LockedAmount ¶ added in v1.0.0
LockedAmount ...
type Params ¶ added in v1.0.0
type Params struct {
// Transaction fee
TxFee uint64
// Transaction fee for transactions that create new state
CreationTxFee uint64
// Staking uptime requirements
UptimeRequirement float64
// Minimum stake, in nAVAX, required to validate the primary network
MinValidatorStake uint64
// Maximum stake, in nAVAX, allowed to be placed on a single validator in
// the primary network
MaxValidatorStake uint64
// Minimum stake, in nAVAX, that can be delegated on the primary network
MinDelegatorStake uint64
// Minimum delegation fee, in the range [0, 1000000], that can be charged
// for delegation on the primary network.
MinDelegationFee uint32
// MinStakeDuration is the minimum amount of time a validator can validate
// for in a single period.
MinStakeDuration time.Duration
// MaxStakeDuration is the maximum amount of time a validator can validate
// for in a single period.
MaxStakeDuration time.Duration
// StakeMintingPeriod is the amount of time for a consumption period.
StakeMintingPeriod time.Duration
}
Params ...
type Staker ¶ added in v1.0.0
type Staker struct {
NodeID ids.ShortID `json:"nodeID"`
RewardAddress ids.ShortID `json:"rewardAddress"`
DelegationFee uint32 `json:"delegationFee"`
}
Staker ...
type UnparsedAllocation ¶ added in v1.0.0
type UnparsedAllocation struct {
ETHAddr string `json:"ethAddr"`
AVAXAddr string `json:"avaxAddr"`
InitialAmount uint64 `json:"initialAmount"`
UnlockSchedule []LockedAmount `json:"unlockSchedule"`
}
UnparsedAllocation ...
func (UnparsedAllocation) Parse ¶ added in v1.0.0
func (ua UnparsedAllocation) Parse() (Allocation, error)
Parse ...
type UnparsedConfig ¶ added in v1.0.0
type UnparsedConfig struct {
NetworkID uint32 `json:"networkID"`
Allocations []UnparsedAllocation `json:"allocations"`
StartTime uint64 `json:"startTime"`
InitialStakeDuration uint64 `json:"initialStakeDuration"`
InitialStakeDurationOffset uint64 `json:"initialStakeDurationOffset"`
InitialStakedFunds []string `json:"initialStakedFunds"`
InitialStakers []UnparsedStaker `json:"initialStakers"`
CChainGenesis string `json:"cChainGenesis"`
Message string `json:"message"`
}
UnparsedConfig contains the genesis addresses used to construct a genesis
func (UnparsedConfig) Parse ¶ added in v1.0.0
func (uc UnparsedConfig) Parse() (Config, error)
Parse ...
type UnparsedStaker ¶ added in v1.0.0
type UnparsedStaker struct {
NodeID string `json:"nodeID"`
RewardAddress string `json:"rewardAddress"`
DelegationFee uint32 `json:"delegationFee"`
}
UnparsedStaker ...
func (UnparsedStaker) Parse ¶ added in v1.0.0
func (us UnparsedStaker) Parse() (Staker, error)
Parse ...
Click to show internal directories.
Click to hide internal directories.