genesis

package
v1.20.3 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2025 License: BSD-3-Clause Imports: 38 Imported by: 0

README

Genesis

The Genesis package converts formatted JSON files into the genesis of the Primary Network. For the simplest example, see the Local Genesis JSON file.

The genesis JSON file contains the following properties:

  • networkID: A unique identifier for the blockchain, must be a number in the range [0, 2^32).
  • allocations: The list of initial addresses, their initial balances and the unlock schedule for each.
  • startTime: The time of the beginning of the blockchain, it must be a Unix timestamp and it can't be a time in the future.
  • initialStakeDuration: The stake duration, in seconds, of the validators that exist at network genesis.
  • initialStakeDurationOffset: The offset, in seconds, between the end times of the validators that exist at genesis.
  • initialStakedFunds: A list of addresses that own the funds staked at genesis (each address must be present in allocations as well)
  • initialStakers: The validators that exist at genesis. Each element contains the rewardAddress, NodeID and the delegationFee of the validator.
  • cChainGenesis: The genesis info to be passed to the C-Chain.
  • message: A message to include in the genesis. Not required.

Allocations and Genesis Stakers

Each allocation contains the following fields:

  • ethAddr: Annotation of corresponding Ethereum address holding an ERC-20 token
  • luxAddr: X/P Chain address to receive the allocation
  • initialAmount: Initial unlocked amount minted to the luxAddr on the X-Chain
  • unlockSchedule: List of locked, stakeable UTXOs minted to luxAddr on the P-Chain

Note: if an luxAddr from allocations is included in initialStakers, the genesis includes all the UTXOs specified in the unlockSchedule as part of the locked stake of the corresponding genesis validator. Otherwise, the locked UTXO is created directly on the P-Chain.

Documentation

Index

Constants

View Source
const (
	PrivateKeyPrefix = "PrivateKey-"

	VMRQKeyStr          = "vmRQiZeXEXYMyJhEiqdC2z5JhuDbxL8ix9UVvjgMu2Er1NepE"
	VMRQKeyFormattedStr = PrivateKeyPrefix + VMRQKeyStr

	EWOQKeyStr          = "ewoqjP7PxY4yr3iLTpLisriqt94hdyDFNgchSxGGztUrTXtNN"
	EWOQKeyFormattedStr = PrivateKeyPrefix + EWOQKeyStr
)

Variables

View Source
var (
	PChainAliases = []string{"P", "platform"}
	XChainAliases = []string{"X", "xvm"}
	CChainAliases = []string{"C", "evm"}
	VMAliases     = map[ids.ID][]string{
		constants.PlatformVMID: {"platform"},
		constants.XVMID:        {"xvm"},
		constants.EVMID:        {"evm"},
		secp256k1fx.ID:         {"secp256k1fx"},
		nftfx.ID:               {"nftfx"},
		propertyfx.ID:          {"propertyfx"},
	}
)
View Source
var (
	VMRQKey *secp256k1.PrivateKey
	EWOQKey *secp256k1.PrivateKey

	// LocalParams are the params used for local networks
	LocalParams = Params{
		TxFeeConfig: TxFeeConfig{
			CreateAssetTxFee: units.MilliLux,
			TxFee:            units.MilliLux,
			DynamicFeeConfig: gas.Config{
				Weights: gas.Dimensions{
					gas.Bandwidth: 1,
					gas.DBRead:    1_000,
					gas.DBWrite:   1_000,
					gas.Compute:   4,
				},
				MaxCapacity:     1_000_000,
				MaxPerSecond:    100_000,
				TargetPerSecond: 50_000,
				MinPrice:        1,

				ExcessConversionConstant: 2_164_043,
			},
			ValidatorFeeConfig: fee.Config{
				Capacity: 20_000,
				Target:   10_000,
				MinPrice: gas.Price(1 * units.NanoLux),

				ExcessConversionConstant: 865_617,
			},
		},
		StakingConfig: StakingConfig{
			UptimeRequirement: .8,
			MinValidatorStake: 2 * units.KiloLux,
			MaxValidatorStake: 3 * units.MegaLux,
			MinDelegatorStake: 25 * units.Lux,
			MinDelegationFee:  20000,
			MinStakeDuration:  24 * time.Hour,
			MaxStakeDuration:  365 * 24 * time.Hour,
			RewardConfig: reward.Config{
				MaxConsumptionRate: .12 * reward.PercentDenominator,
				MinConsumptionRate: .10 * reward.PercentDenominator,
				MintingPeriod:      365 * 24 * time.Hour,
				SupplyCap:          720 * units.MegaLux,
			},
		},
	}
)
View Source
var (
	QChainMainnetParams = Params{
		TxFeeConfig: TxFeeConfig{
			CreateAssetTxFee: 10 * units.MilliLux,
			TxFee:            units.MilliLux,
			DynamicFeeConfig: gas.Config{
				Weights: gas.Dimensions{
					gas.Bandwidth: 1,
					gas.DBRead:    1_000,
					gas.DBWrite:   1_000,
					gas.Compute:   4,
				},
				MaxCapacity:              1_000_000,
				MaxPerSecond:             100_000,
				TargetPerSecond:          50_000,
				MinPrice:                 1,
				ExcessConversionConstant: 2_164_043,
			},
			ValidatorFeeConfig: fee.Config{
				Capacity:                 20_000,
				Target:                   10_000,
				MinPrice:                 gas.Price(512 * units.NanoLux),
				ExcessConversionConstant: 1_246_488_515,
			},
		},
		StakingConfig: StakingConfig{
			UptimeRequirement: .8,
			MinValidatorStake: 100 * units.Lux,
			MaxValidatorStake: 10_000 * units.Lux,
			MinDelegatorStake: 25 * units.Lux,
			MinDelegationFee:  20000,
			MinStakeDuration:  14 * 24 * time.Hour,
			MaxStakeDuration:  365 * 24 * time.Hour,
			RewardConfig: reward.Config{
				MaxConsumptionRate: .12 * reward.PercentDenominator,
				MinConsumptionRate: .10 * reward.PercentDenominator,
				MintingPeriod:      365 * 24 * time.Hour,
				SupplyCap:          1_000_000_000 * units.Lux,
			},
		},
	}

	QChainTestnetParams = Params{
		TxFeeConfig: TxFeeConfig{
			CreateAssetTxFee: units.Lux / 100,
			TxFee:            units.Lux / 1000,
			DynamicFeeConfig: gas.Config{
				Weights: gas.Dimensions{
					gas.Bandwidth: 1,
					gas.DBRead:    1_000,
					gas.DBWrite:   1_000,
					gas.Compute:   4,
				},
				MaxCapacity:              1_000_000,
				MaxPerSecond:             100_000,
				TargetPerSecond:          50_000,
				MinPrice:                 1,
				ExcessConversionConstant: 2_164_043,
			},
			ValidatorFeeConfig: fee.Config{
				Capacity:                 20_000,
				Target:                   10_000,
				MinPrice:                 gas.Price(512 * units.NanoLux),
				ExcessConversionConstant: 1_246_488_515,
			},
		},
		StakingConfig: StakingConfig{
			UptimeRequirement: .6,
			MinValidatorStake: 10 * units.Lux,
			MaxValidatorStake: 1_000 * units.Lux,
			MinDelegatorStake: 1 * units.Lux,
			MinDelegationFee:  10000,
			MinStakeDuration:  24 * time.Hour,
			MaxStakeDuration:  90 * 24 * time.Hour,
			RewardConfig: reward.Config{
				MaxConsumptionRate: .20 * reward.PercentDenominator,
				MinConsumptionRate: .15 * reward.PercentDenominator,
				MintingPeriod:      90 * 24 * time.Hour,
				SupplyCap:          100_000_000 * units.Lux,
			},
		},
	}
)

QChainParams defines the parameters for Q-Chain

View Source
var CChainGenesisMainnet []byte

Embed the C-chain genesis configuration for network 96369

View Source
var (

	// MainnetParams are the params used for mainnet (network ID 96369)
	MainnetParams = Params{
		TxFeeConfig: TxFeeConfig{
			CreateAssetTxFee: 10 * units.MilliLux,
			TxFee:            units.MilliLux,
			DynamicFeeConfig: gas.Config{
				Weights: gas.Dimensions{
					gas.Bandwidth: 1,
					gas.DBRead:    1_000,
					gas.DBWrite:   1_000,
					gas.Compute:   4,
				},
				MaxCapacity:     1_000_000,
				MaxPerSecond:    100_000,
				TargetPerSecond: 50_000,
				MinPrice:        1,

				ExcessConversionConstant: 2_164_043,
			},
			ValidatorFeeConfig: fee.Config{
				Capacity: 20_000,
				Target:   10_000,
				MinPrice: gas.Price(512 * units.NanoLux),

				ExcessConversionConstant: 1_246_488_515,
			},
		},
		StakingConfig: StakingConfig{
			UptimeRequirement: .8,
			MinValidatorStake: 2 * units.KiloLux,
			MaxValidatorStake: 3 * units.MegaLux,
			MinDelegatorStake: 25 * units.Lux,
			MinDelegationFee:  20000,
			MinStakeDuration:  2 * 7 * 24 * time.Hour,
			MaxStakeDuration:  365 * 24 * time.Hour,
			RewardConfig: reward.Config{
				MaxConsumptionRate: .12 * reward.PercentDenominator,
				MinConsumptionRate: .10 * reward.PercentDenominator,
				MintingPeriod:      365 * 24 * time.Hour,
				SupplyCap:          720 * units.MegaLux,
			},
		},
	}
)
View Source
var (

	// TestnetParams are the params used for the testnet
	TestnetParams = Params{
		TxFeeConfig: TxFeeConfig{
			CreateAssetTxFee: 10 * units.MilliLux,
			TxFee:            units.MilliLux,
			DynamicFeeConfig: gas.Config{
				Weights: gas.Dimensions{
					gas.Bandwidth: 1,
					gas.DBRead:    1_000,
					gas.DBWrite:   1_000,
					gas.Compute:   4,
				},
				MaxCapacity:              1_000_000,
				MaxPerSecond:             100_000,
				TargetPerSecond:          50_000,
				MinPrice:                 1,
				ExcessConversionConstant: 2_164_043,
			},
			ValidatorFeeConfig: fee.Config{
				Capacity:                 20_000,
				Target:                   10_000,
				MinPrice:                 gas.Price(512 * units.NanoLux),
				ExcessConversionConstant: 1_246_488_515,
			},
		},
		StakingConfig: StakingConfig{
			UptimeRequirement: .8,
			MinValidatorStake: 1 * units.MegaLux,
			MaxValidatorStake: 100 * units.MegaLux,
			MinDelegatorStake: 1 * units.KiloLux,
			MinDelegationFee:  20000,
			MinStakeDuration:  24 * time.Hour,
			MaxStakeDuration:  365 * 24 * time.Hour,
			RewardConfig: reward.Config{
				MaxConsumptionRate: .12 * reward.PercentDenominator,
				MinConsumptionRate: .10 * reward.PercentDenominator,
				MintingPeriod:      365 * 24 * time.Hour,
				SupplyCap:          2000 * units.MegaLux,
			},
		},
	}
)

Functions

func Aliases

func Aliases(genesisBytes []byte) (map[string][]string, map[ids.ID][]string, error)

Aliases returns the default aliases based on the network ID

func FromConfig

func FromConfig(config *Config) ([]byte, ids.ID, error)

FromConfig returns:

  1. The byte representation of the genesis state of the platform chain (ie the genesis state of the network)
  2. The asset ID of LUX

func FromDatabase added in v1.1.11

func FromDatabase(networkID uint32, dbPath string, dbType string, stakingCfg *StakingConfig) ([]byte, ids.ID, error)

FromDatabase returns the genesis data using an existing database for replay

func FromFile added in v0.1.1

func FromFile(networkID uint32, filepath string, stakingCfg *StakingConfig) ([]byte, ids.ID, error)

FromFile returns the genesis data of the Platform Chain.

Since an Lux network has exactly one Platform Chain, and the Platform Chain defines the genesis state of the network (who is staking, which chains exist, etc.), defining the genesis state of the Platform Chain is the same as defining the genesis state of the network.

FromFile accepts: 1) The ID of the new network. [networkID] 2) The location of a custom genesis config to load. filepath

If filepath is empty or the given network ID is Mainnet, Testnet, or Local, returns error. If filepath is non-empty and networkID isn't Mainnet, Testnet, or Local, loads the network genesis data from the config at filepath.

FromFile returns:

  1. The byte representation of the genesis state of the platform chain (ie the genesis state of the network)
  2. The asset ID of LUX

func FromFlag added in v0.1.1

func FromFlag(networkID uint32, genesisContent string, stakingCfg *StakingConfig) ([]byte, ids.ID, error)

FromFlag returns the genesis data of the Platform Chain.

Since an Lux network has exactly one Platform Chain, and the Platform Chain defines the genesis state of the network (who is staking, which chains exist, etc.), defining the genesis state of the Platform Chain is the same as defining the genesis state of the network.

FromFlag accepts: 1) The ID of the new network. [networkID] 2) The content of a custom genesis config to load. [genesisContent]

If [genesisContent] is empty or the given network ID is Mainnet, Testnet, or Local, returns error. If [genesisContent] is non-empty and networkID isn't Mainnet, Testnet, or Local, loads the network genesis data from [genesisContent].

FromFlag returns:

  1. The byte representation of the genesis state of the platform chain (ie the genesis state of the network)
  2. The asset ID of LUX

func GetCChainGenesisMainnet added in v1.1.11

func GetCChainGenesisMainnet() string

GetCChainGenesisMainnet returns the C-chain genesis configuration for network 96369

func GetCChainGenesisMainnetBytes added in v1.1.11

func GetCChainGenesisMainnetBytes() []byte

GetCChainGenesisMainnetBytes returns the C-chain genesis as bytes

func GetCheckpoints added in v0.1.1

func GetCheckpoints(networkID uint32, chainID ids.ID) set.Set[ids.ID]

GetCheckpoints returns all known checkpoints for the chain on the requested network.

func GetNFTGenesisState added in v1.20.0

func GetNFTGenesisState() ([]byte, error)

GetNFTGenesisState returns the serialized NFT genesis state

func GetNFTStakingPower added in v1.20.0

func GetNFTStakingPower(tokenID uint64) (uint64, error)

GetNFTStakingPower returns the effective staking power of an NFT

func GetValidators added in v0.1.1

func GetValidators(networkID uint32) set.Set[ids.NodeID]

GetValidators returns recent validators for the requested network.

func VMGenesis

func VMGenesis(genesisBytes []byte, vmID ids.ID) (*pchaintxs.Tx, error)

func ValidateNFTOwnership added in v1.20.0

func ValidateNFTOwnership(chainID string, owner ids.ShortID, tokenID uint64) (bool, error)

ValidateNFTOwnership validates NFT ownership across chains

func XAssetID added in v1.18.8

func XAssetID(xvmGenesisBytes []byte) (ids.ID, error)

Types

type Allocation added in v0.1.1

type Allocation struct {
	ETHAddr        ids.ShortID    `json:"ethAddr"`
	LUXAddr        ids.ShortID    `json:"luxAddr"`
	InitialAmount  uint64         `json:"initialAmount"`
	UnlockSchedule []LockedAmount `json:"unlockSchedule"`
}

func (Allocation) Compare added in v0.1.1

func (a Allocation) Compare(other Allocation) int

func (Allocation) Unparse added in v0.1.1

func (a Allocation) Unparse(networkID uint32) (UnparsedAllocation, error)

type Bootstrapper added in v0.1.1

type Bootstrapper struct {
	ID ids.NodeID     `json:"id"`
	IP netip.AddrPort `json:"ip"`
}

Represents the relationship between the nodeID and the nodeIP. The bootstrapper is sometimes called "anchor" or "beacon" node.

func GetBootstrappers added in v0.1.1

func GetBootstrappers(networkID uint32) []Bootstrapper

GetBootstrappers returns all default bootstrappers for the provided network.

func SampleBootstrappers added in v0.1.1

func SampleBootstrappers(networkID uint32, count int) []Bootstrapper

SampleBootstrappers returns the some beacons this node should connect to

type CollectionMetadata added in v1.20.0

type CollectionMetadata struct {
	Description  string `json:"description"`
	ExternalURL  string `json:"externalUrl"`
	ImageURL     string `json:"imageUrl"`
	AnimationURL string `json:"animationUrl,omitempty"`
}

CollectionMetadata contains collection-level metadata

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:"initialStakedFunds"`
	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

	// TestnetConfig is the config that should be used to generate the testnet
	// genesis.
	TestnetConfig Config

	// LocalConfig is the config that should be used to generate a local
	// genesis.
	LocalConfig Config
)

func GetConfig

func GetConfig(networkID uint32) *Config

func GetConfigContent added in v0.1.1

func GetConfigContent(genesisContent string) (*Config, error)

GetConfigContent loads a *Config from a provided environment variable

func GetConfigFile added in v0.1.1

func GetConfigFile(fp string) (*Config, error)

GetConfigFile loads a *Config from a provided filepath.

func LuxGenesisConfig added in v1.17.2

func LuxGenesisConfig() *Config

LuxGenesisConfig returns the genesis data to use for LUX mainnet

func (*Config) InitialSupply added in v0.1.1

func (c *Config) InitialSupply() (uint64, error)

func (Config) Unparse added in v0.1.1

func (c Config) Unparse() (UnparsedConfig, error)

type LockedAmount added in v0.1.1

type LockedAmount struct {
	Amount   uint64 `json:"amount"`
	Locktime uint64 `json:"locktime"`
}

type MiningPool added in v1.20.0

type MiningPool struct {
	PoolID          string `json:"poolId"`
	ChainID         string `json:"chainId"`
	RequiredNFTTier string `json:"requiredNftTier"`
	RewardPerBlock  uint64 `json:"rewardPerBlock"`
	Active          bool   `json:"active"`
}

MiningPool represents a mining pool configuration

type NFTAttributes added in v1.20.0

type NFTAttributes struct {
	Name        string            `json:"name"`
	Description string            `json:"description"`
	Image       string            `json:"image"`
	Properties  map[string]string `json:"properties"`
}

NFTAttributes contains NFT metadata

type NFTCollection added in v1.20.0

type NFTCollection struct {
	Name            string             `json:"name"`
	Symbol          string             `json:"symbol"`
	ContractAddress string             `json:"contractAddress"`
	ChainID         string             `json:"chainId"` // X, C, or P
	TotalSupply     uint64             `json:"totalSupply"`
	Metadata        CollectionMetadata `json:"metadata"`
	Traits          []NFTTrait         `json:"traits"`
}

NFTCollection represents an NFT collection on Lux

type NFTCrossChainSupport added in v1.20.0

type NFTCrossChainSupport struct {
	// X-Chain: NFT trading and marketplace
	XChainEnabled bool `json:"xChainEnabled"`
	XChainMarket  bool `json:"xChainMarket"`

	// C-Chain: NFT smart contracts and DeFi integration
	CChainEnabled  bool   `json:"cChainEnabled"`
	CChainContract string `json:"cChainContract"`

	// D-Chain: NFT staking and delegation (DAO governance)
	DChainEnabled  bool `json:"dChainEnabled"`
	DChainStaking  bool `json:"dChainStaking"`
	DChainDelegate bool `json:"dChainDelegate"`
}

NFTCrossChainSupport defines cross-chain NFT functionality

func DefaultCrossChainSupport added in v1.20.0

func DefaultCrossChainSupport() *NFTCrossChainSupport

DefaultCrossChainSupport returns default cross-chain configuration

type NFTGenesisConfig added in v1.20.0

type NFTGenesisConfig struct {
	// Genesis NFT collection on Ethereum (lux.town)
	EthereumContract   common.Address `json:"ethereumContract"`
	EthereumDeployment uint64         `json:"ethereumDeployment"`

	// Lux Network NFT collections
	Collections []NFTCollection `json:"collections"`

	// Initial validator NFTs
	ValidatorNFTs []ValidatorNFT `json:"validatorNFTs"`

	// NFT-based mining configuration
	MiningConfig NFTMiningConfig `json:"miningConfig"`
}

NFTGenesisConfig defines the initial NFT distribution

func DefaultNFTGenesis added in v1.20.0

func DefaultNFTGenesis() *NFTGenesisConfig

DefaultNFTGenesis returns the default NFT genesis configuration

type NFTMiningConfig added in v1.20.0

type NFTMiningConfig struct {
	Enabled        bool              `json:"enabled"`
	RequiresNFT    bool              `json:"requiresNFT"`
	BaseReward     uint64            `json:"baseReward"`
	NFTMultipliers map[string]uint32 `json:"nftMultipliers"` // tier -> multiplier
	MiningPools    []MiningPool      `json:"miningPools"`
}

NFTMiningConfig defines NFT-based mining parameters

type NFTTrait added in v1.20.0

type NFTTrait struct {
	TraitType string   `json:"traitType"`
	Values    []string `json:"values"`
	Rarity    []uint32 `json:"rarity"` // Percentage for each value
}

NFTTrait represents possible traits for NFTs

type Params added in v0.1.1

type Params struct {
	StakingConfig
	TxFeeConfig
}

func GetQChainParams added in v1.18.20

func GetQChainParams(networkID uint32) Params

GetQChainParams returns the Q-Chain parameters for the given network ID

type QChainConfig added in v1.18.20

type QChainConfig struct {
	// Quantum-resistant parameters
	QuantumEnabled     bool
	SignatureAlgorithm string
	HashFunction       string
	MinValidators      int
	MaxValidators      int
	ConsensusThreshold int

	// Chain identification
	ChainID    ids.ID
	ChainAlias string
	VMID       ids.ID

	// Network parameters
	NetworkID uint32
}

QChainConfig represents Q-Chain specific configuration

func GetQChainConfig added in v1.18.20

func GetQChainConfig(networkID uint32) QChainConfig

GetQChainConfig returns the Q-Chain configuration for the given network ID

type Staker added in v0.1.1

type Staker struct {
	NodeID        ids.NodeID                `json:"nodeID"`
	RewardAddress ids.ShortID               `json:"rewardAddress"`
	DelegationFee uint32                    `json:"delegationFee"`
	Signer        *signer.ProofOfPossession `json:"signer,omitempty"`
}

func (Staker) Unparse added in v0.1.1

func (s Staker) Unparse(networkID uint32) (UnparsedStaker, error)

type StakingConfig added in v0.1.1

type StakingConfig struct {
	// Staking uptime requirements
	UptimeRequirement float64 `json:"uptimeRequirement"`
	// Minimum stake, in nLUX, required to validate the primary network
	MinValidatorStake uint64 `json:"minValidatorStake"`
	// Maximum stake, in nLUX, allowed to be placed on a single validator in
	// the primary network
	MaxValidatorStake uint64 `json:"maxValidatorStake"`
	// Minimum stake, in nLUX, that can be delegated on the primary network
	MinDelegatorStake uint64 `json:"minDelegatorStake"`
	// Minimum delegation fee, in the range [0, 1000000], that can be charged
	// for delegation on the primary network.
	MinDelegationFee uint32 `json:"minDelegationFee"`
	// MinStakeDuration is the minimum amount of time a validator can validate
	// for in a single period.
	MinStakeDuration time.Duration `json:"minStakeDuration"`
	// MaxStakeDuration is the maximum amount of time a validator can validate
	// for in a single period.
	MaxStakeDuration time.Duration `json:"maxStakeDuration"`
	// RewardConfig is the config for the reward function.
	RewardConfig reward.Config `json:"rewardConfig"`

	// BLS key information for genesis replay
	NodeID               string `json:"nodeID"`
	BLSPublicKey         []byte `json:"blsPublicKey"`
	BLSProofOfPossession []byte `json:"blsProofOfPossession"`
}

func GetStakingConfig added in v0.1.1

func GetStakingConfig(networkID uint32) StakingConfig

type TxFeeConfig added in v0.1.1

type TxFeeConfig struct {
	CreateAssetTxFee   uint64     `json:"createAssetTxFee"`
	TxFee              uint64     `json:"txFee"`
	DynamicFeeConfig   gas.Config `json:"dynamicFeeConfig"`
	ValidatorFeeConfig fee.Config `json:"validatorFeeConfig"`
}

func GetTxFeeConfig added in v0.1.1

func GetTxFeeConfig(networkID uint32) TxFeeConfig

type UnparsedAllocation added in v0.1.1

type UnparsedAllocation struct {
	ETHAddr        string         `json:"ethAddr"`
	LUXAddr        string         `json:"luxAddr"`
	InitialAmount  uint64         `json:"initialAmount"`
	UnlockSchedule []LockedAmount `json:"unlockSchedule"`
}

func (UnparsedAllocation) Parse added in v0.1.1

func (ua UnparsedAllocation) Parse() (Allocation, error)

type UnparsedConfig added in v0.1.1

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 v0.1.1

func (uc UnparsedConfig) Parse() (Config, error)

type UnparsedStaker added in v0.1.1

type UnparsedStaker struct {
	NodeID        ids.NodeID                `json:"nodeID"`
	RewardAddress string                    `json:"rewardAddress"`
	DelegationFee uint32                    `json:"delegationFee"`
	Signer        *signer.ProofOfPossession `json:"signer,omitempty"`
}

func (UnparsedStaker) Parse added in v0.1.1

func (us UnparsedStaker) Parse() (Staker, error)

type ValidatorNFT added in v1.20.0

type ValidatorNFT struct {
	TokenID          uint64         `json:"tokenId"`
	OriginalOwner    common.Address `json:"originalOwner"`    // ETH address from lux.town
	LuxOwner         ids.ShortID    `json:"luxOwner"`         // Lux address
	Tier             string         `json:"tier"`             // Genesis, Pioneer, Standard
	StakingPower     uint64         `json:"stakingPower"`     // Effective staking power
	MiningMultiplier uint32         `json:"miningMultiplier"` // Mining reward multiplier
	Attributes       NFTAttributes  `json:"attributes"`
}

ValidatorNFT represents a validator NFT

Directories

Path Synopsis
generate
checkpoints command
validators command

Jump to

Keyboard shortcuts

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