genesis

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2025 License: BSD-3-Clause Imports: 14 Imported by: 16

Documentation

Index

Constants

View Source
const CodecVersion = block.CodecVersion

Variables

Functions

This section is empty.

Types

type Allocation added in v1.13.1

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 added in v1.13.1

func (a Allocation) Compare(other Allocation) int

Compare compares two allocations

type Chain added in v1.13.1

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 added in v1.13.1

func New(
	avaxAssetID 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 Avalanche network.) [avaxAssetID] is the ID of the AVAX 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 AVAX asset. [message] is the message to be sent to the genesis UTXOs.

func Parse

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

func (*Genesis) Bytes added in v1.13.1

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

Bytes serializes the Genesis to bytes using the PlatformVM genesis codec

type Owner added in v1.13.1

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

Owner is the repr. of a reward owner at genesis

type PermissionlessValidator added in v1.13.1

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 {
	avax.UTXO `serialize:"true"`
	Message   []byte `serialize:"true" json:"message"`
}

UTXO adds messages to UTXOs

type Validator added in v1.13.1

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