genesis

package
v0.0.0-...-1c03811 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2020 License: LGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var GenesisBlockParentHash common.Hash = common.Hash{0xff, 0xff, 0xff, 0xff}

GenesisBlockParentHash ensure genesis number is 0

Functions

This section is empty.

Types

type BlockConfig

type BlockConfig struct {
	Nonce     uint64   `json:"nonce"`
	Timestamp uint64   `json:"timestamp"`
	ExtraData [28]byte `json:"extraData"`
}

BlockConfig contains all information for the block configuration

type Builder

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

Builder helper to build genesis block.

func (*Builder) Build

func (b *Builder) Build() *block.Block

Build build genesis block according to presets. TODO: implement stateCreator

func (*Builder) ExtraData

func (b *Builder) ExtraData(data [28]byte) *Builder

ExtraData set extra data, which will be put into last 28 bytes of genesis parent id.

func (*Builder) Timestamp

func (b *Builder) Timestamp(t uint64) *Builder

Timestamp set timestamp.

type ChainConfig

type ChainConfig struct {
	Config *params.ChainConfig `json:"config"`
}

ChainConfig defines the chain configuration TODO: implement this feature to handle hard fork switches over the chain configuration

type Genesis

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

Genesis specifies the header fields, state of a genesis block.

func NewCustomnet

func NewCustomnet(chainLaunchTime uint64, extra [28]byte) *Genesis

NewCustomnet create mainnet genesis.

func NewTestnet

func NewTestnet() *Genesis

NewTestnet create mainnet genesis.

func (*Genesis) BuildGenesisBlock

func (g *Genesis) BuildGenesisBlock() *block.Block

BuildGenesisBlock build the genesis block. TODO: implement ID check like in thor

func (*Genesis) Name

func (g *Genesis) Name() string

Name returns network name.

Jump to

Keyboard shortcuts

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