genesis

package
v0.15.6 Latest Latest
Warning

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

Go to latest
Published: Jul 20, 2025 License: BSD-3-Clause Imports: 14 Imported by: 3

Documentation

Index

Constants

View Source
const CodecVersion = block.CodecVersion

Variables

Functions

This section is empty.

Types

type Allocation

type Allocation struct {
	Locktime uint64
	Amount   uint64
	Address  string
	Message  []byte
}

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

type Chain struct {
	GenesisData []byte
	VMID        ids.ID
	FxIDs       []ids.ID
	Name        string
	SubnetID    ids.ID
}

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 chain runs. [FxIDs] are the IDs of the Fxs the chain supports. [Name] is a human-readable, non-unique name for the chain. [SubnetID] is the ID of the subnet that validates the chain

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(
	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.

func Parse

func Parse(genesisBytes []byte) (*Genesis, error)

func (*Genesis) Bytes

func (g *Genesis) Bytes() ([]byte, error)

Bytes serializes the Genesis to bytes using the PlatformVM genesis codec

type Owner

type Owner struct {
	Locktime  uint64
	Threshold uint32
	Addresses []string
}

Owner is the repr. of a reward owner at genesis

type PermissionlessValidator

type PermissionlessValidator struct {
	Validator
	RewardOwner        *Owner
	DelegationFee      float32
	ExactDelegationFee uint32
	Staked             []Allocation
	Signer             *signer.ProofOfPossession
}

GenesisPermissionlessValidator represents a permissionless validator at genesis

type UTXO

type UTXO struct {
	lux.UTXO `serialize:"true"`
	Message  []byte `serialize:"true" json:"message"`
}

UTXO adds messages to UTXOs

type Validator

type Validator struct {
	TxID      ids.ID
	StartTime uint64
	EndTime   uint64
	Weight    uint64
	NodeID    ids.NodeID
}

Validator represents a validator at genesis

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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