genesis

package
v1.2.0-fork5-fix3 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2022 License: LGPL-3.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GenesisNonce = uint64(1001)
)

Variables

This section is empty.

Functions

func FloatToBigInt

func FloatToBigInt(val float64) *big.Int

func LoadVestProfile

func LoadVestProfile() []*accountlock.Profile

func SetAccountLockProfileState

func SetAccountLockProfileState(list []*accountlock.Profile, state *state.State)

func SetProfileList

func SetProfileList(lockList *accountlock.ProfileList, state *state.State)

Types

type Builder

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

Builder helper to build genesis block.

func (*Builder) Build

func (b *Builder) Build(stateCreator *state.Creator) (blk *block.Block, events tx.Events, err error)

Build build genesis block according to presets.

func (*Builder) Call

func (b *Builder) Call(clause *tx.Clause, caller meter.Address) *Builder

Call add a contrct call.

func (*Builder) ComputeID

func (b *Builder) ComputeID() (meter.Bytes32, error)

ComputeID compute genesis ID.

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) GasLimit

func (b *Builder) GasLimit(limit uint64) *Builder

GasLimit set gas limit.

func (*Builder) State

func (b *Builder) State(proc func(state *state.State) error) *Builder

State add a state process

func (*Builder) Timestamp

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

Timestamp set timestamp.

type DevAccount

type DevAccount struct {
	Address    meter.Address
	PrivateKey *ecdsa.PrivateKey
}

DevAccount account for development.

func DevAccounts

func DevAccounts() []DevAccount

DevAccounts returns pre-alloced accounts for solo mode.

type Genesis

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

Genesis to build genesis block.

func NewDevnet

func NewDevnet() *Genesis

NewDevnet create genesis for solo mode.

func NewMainnet

func NewMainnet() *Genesis

NewMainnet create mainnet genesis.

func NewTestnet

func NewTestnet() *Genesis

NewTestnet create genesis for testnet.

func (*Genesis) Build

func (g *Genesis) Build(stateCreator *state.Creator) (*block.Block, tx.Events, error)

Build build the genesis block.

func (*Genesis) ID

func (g *Genesis) ID() meter.Bytes32

ID returns genesis block ID.

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