Documentation
¶
Index ¶
Constants ¶
const CodecVersion = block.CodecVersion
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Allocation ¶
Allocation is a UTXO on the Platform Chain that exists at the chain's genesis
func (Allocation) Compare ¶
func (a Allocation) Compare(other Allocation) int
Compare compares two allocations
type Chain ¶
Chain defines a chain that exists at the network's genesis [GenesisData] is the initial state of the chain. [VMID] is the ID of the VM this blockchain runs. [FxIDs] are the IDs of the Fxs the blockchain supports. [Name] is a human-readable, non-unique name for the blockchain. [ChainID] is the ID of the chain that validates the blockchain
type Codec ¶
Codec is an alias for block.Codec — same wire codec interface, re-exported under the genesis package name for callers that want to reference the genesis-bound codec by its semantic name. The block genesis codec (block.RegisterTypes bound through a codec.NewManager(math.MaxInt32)) is the canonical concrete instance.
type Genesis ¶
type Genesis struct {
UTXOs []*UTXO `serialize:"true"`
Validators []*txs.Tx `serialize:"true"`
Chains []*txs.Tx `serialize:"true"`
Timestamp uint64 `serialize:"true"`
InitialSupply uint64 `serialize:"true"`
Message string `serialize:"true"`
}
Genesis represents a genesis state of the platform chain
func New ¶
func New( c block.Codec, luxAssetID ids.ID, networkID uint32, allocations []Allocation, validators []PermissionlessValidator, chains []Chain, time uint64, initialSupply uint64, message string, ) (*Genesis, error)
New builds the genesis state of the P-Chain (and thereby the Lux network.) [luxAssetID] is the ID of the LUX asset [networkID] is the ID of the network [allocations] are the UTXOs on the Platform Chain that exist at genesis. [validators] are the validators of the primary network at genesis. [chains] are the chains that exist at genesis. time is the Platform Chain's time at network genesis. [initialSupply] is the initial supply of the LUX asset. [message] is the message to be sent to the genesis UTXOs. New constructs a Genesis from the supplied parameters. The supplied genesis Codec is used to initialize every embedded txs.Tx — callers pass the genesis-sized codec (block.RegisterTypes bound through a codec.NewManager(math.MaxInt32)) here.
func Parse ¶
Parse decodes a Genesis from wire bytes using the supplied block Codec. Both the outer Genesis container and the per-validator / per-chain Tx Initialize calls use the same codec — callers pass the genesis-sized codec (codec.NewManager(math.MaxInt32) bound through block.RegisterTypes) here.
type PermissionlessValidator ¶
type PermissionlessValidator struct {
Validator
RewardOwner *Owner
DelegationFee float32
ExactDelegationFee uint32
Staked []Allocation
Signer *signer.ProofOfPossession
}
GenesisPermissionlessValidator represents a permissionless validator at genesis