Help us shape the future of Go! Take the 2026 Go Developer Survey

genesis

package
v1.36.184 Latest Latest
Warning

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

Go to latest
Published: Sep 3, 2026 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Block

func Block(genesis *Genesis) (*block.Stateless, error)

Types

type Allocation

type Allocation struct {
	Address ids.ShortID `json:"address"`
	Balance uint64      `json:"balance"`
}

func (*Allocation) MarshalZAP added in v1.36.178

func (x *Allocation) MarshalZAP() ([]byte, error)

MarshalZAP writes Allocation from constant offsets.

func (*Allocation) UnmarshalZAP added in v1.36.178

func (x *Allocation) UnmarshalZAP(data []byte) error

UnmarshalZAP reads Allocation out of the buffer that arrived.

type Genesis

type Genesis struct {
	Timestamp   int64        `json:"timestamp"`
	Allocations []Allocation `json:"allocations"`
}

func Parse

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

func (*Genesis) Marshal added in v1.36.3

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

Marshal encodes the genesis as one native ZAP object.

func (*Genesis) MarshalZAP added in v1.36.178

func (x *Genesis) MarshalZAP() ([]byte, error)

MarshalZAP writes Genesis from constant offsets.

func (*Genesis) UnmarshalZAP added in v1.36.178

func (x *Genesis) UnmarshalZAP(data []byte) error

UnmarshalZAP reads Genesis out of the buffer that arrived.

Jump to

Keyboard shortcuts

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