genesis

package
v0.0.0-...-7640ebf Latest Latest
Warning

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

Go to latest
Published: Sep 30, 2024 License: BSD-3-Clause Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StateLockupField = "state_lockup"
)

Variables

View Source
var (
	ErrInvalidTarget      = errors.New("invalid target")
	ErrStateLockupMissing = errors.New("state lockup parameter missing")
)

Functions

This section is empty.

Types

type CustomAllocation

type CustomAllocation struct {
	Address string `json:"address"` // bech32 address
	Balance uint64 `json:"balance"`
}

type Genesis

type Genesis struct {
	// Address prefix
	HRP string `json:"hrp"`

	// Block params
	MaxBlockTxs   int    `json:"maxBlockTxs"`
	MaxBlockUnits uint64 `json:"maxBlockUnits"` // must be possible to reach before block too large

	// Tx params
	BaseUnits      uint64 `json:"baseUnits"`
	ValidityWindow int64  `json:"validityWindow"` // seconds

	// Unit pricing
	MinUnitPrice               uint64 `json:"minUnitPrice"`
	UnitPriceChangeDenominator uint64 `json:"unitPriceChangeDenominator"`
	WindowTargetUnits          uint64 `json:"windowTargetUnits"` // 10s

	// Block pricing
	MinBlockCost               uint64 `json:"minBlockCost"`
	BlockCostChangeDenominator uint64 `json:"blockCostChangeDenominator"`
	WindowTargetBlocks         uint64 `json:"windowTargetBlocks"` // 10s

	// Warp pricing
	WarpBaseFee      uint64 `json:"warpBaseFee"`
	WarpFeePerSigner uint64 `json:"warpFeePerSigner"`

	// Allocations
	CustomAllocation []*CustomAllocation `json:"customAllocation"`
}

func Default

func Default() *Genesis

func New

func New(b []byte, _ []byte) (*Genesis, error)

func (*Genesis) GetHRP

func (g *Genesis) GetHRP() string

func (*Genesis) Load

func (g *Genesis) Load(ctx context.Context, tracer trace.Tracer, db chain.Database) error

func (*Genesis) Rules

func (g *Genesis) Rules(int64) *Rules

TODO: use upgradeBytes

type Rules

type Rules struct {
	// contains filtered or unexported fields
}

func (*Rules) FetchCustom

func (*Rules) FetchCustom(string) (any, bool)

func (*Rules) GetBaseUnits

func (r *Rules) GetBaseUnits() uint64

func (*Rules) GetBlockCostChangeDenominator

func (r *Rules) GetBlockCostChangeDenominator() uint64

func (*Rules) GetMaxBlockTxs

func (r *Rules) GetMaxBlockTxs() int

func (*Rules) GetMaxBlockUnits

func (r *Rules) GetMaxBlockUnits() uint64

func (*Rules) GetMinBlockCost

func (r *Rules) GetMinBlockCost() uint64

func (*Rules) GetMinUnitPrice

func (r *Rules) GetMinUnitPrice() uint64

func (*Rules) GetUnitPriceChangeDenominator

func (r *Rules) GetUnitPriceChangeDenominator() uint64

func (*Rules) GetValidityWindow

func (r *Rules) GetValidityWindow() int64

func (*Rules) GetWarpBaseFee

func (r *Rules) GetWarpBaseFee() uint64

func (*Rules) GetWarpConfig

func (*Rules) GetWarpConfig(ids.ID) (bool, uint64, uint64)

func (*Rules) GetWarpFeePerSigner

func (r *Rules) GetWarpFeePerSigner() uint64

func (*Rules) GetWindowTargetBlocks

func (r *Rules) GetWindowTargetBlocks() uint64

func (*Rules) GetWindowTargetUnits

func (r *Rules) GetWindowTargetUnits() uint64

Jump to

Keyboard shortcuts

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