genesis

package
v1.0.0-rc.0 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2021 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLocked  = accounts.NewAuthNeededError("password or unlock")
	ErrNoMatch = errors.New("no key for given address or file")
)

Functions

func NewAccountsBackend

func NewAccountsBackend(accs Accounts, unlock ...common.Address) accounts.Backend

Types

type Account

type Account struct {
	Code       []byte                      `json:"code,omitempty"`
	Storage    map[common.Hash]common.Hash `json:"storage,omitempty"`
	Balance    *big.Int                    `json:"balance" gencodec:"required"`
	Nonce      uint64                      `json:"nonce,omitempty"`
	PrivateKey *ecdsa.PrivateKey           `toml:"-"`
}

Account is an account in the state of the genesis block.

type Accounts

type Accounts map[common.Address]Account

Accounts specifies the initial state that is part of the genesis block.

func (Accounts) Add

func (ga Accounts) Add(gb Accounts)

func (Accounts) Addresses

func (ga Accounts) Addresses() []common.Address

Addresses returns not sorted genesis addresses

func (Accounts) Hash

func (ga Accounts) Hash() common.Hash

Hash returns accounts hash

func (*Accounts) UnmarshalJSON

func (ga *Accounts) UnmarshalJSON(data []byte) error

type Genesis

type Genesis struct {
	Alloc     VAccounts
	Time      inter.Timestamp
	ExtraData []byte
}

func FakeGenesis

func FakeGenesis(accs VAccounts) Genesis

FakeGenesis generates fake genesis with n-nodes.

func MainGenesis

func MainGenesis() Genesis

MainGenesis returns builtin genesis keys of mainnet.

func TestGenesis

func TestGenesis() Genesis

TestGenesis returns builtin genesis keys of testnet.

type VAccounts

type VAccounts struct {
	Accounts         Accounts
	Validators       pos.GValidators
	SfcContractAdmin common.Address
}

Accounts specifies the initial state that is part of the genesis block.

func FakeValidators

func FakeValidators(count int, balance *big.Int, stake *big.Int) VAccounts

FakeValidators returns validators accounts for fakenet

Directories

Path Synopsis
sfc

Jump to

Keyboard shortcuts

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