genesisstore

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 25 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func OpenGenesisStore

func OpenGenesisStore(rawReader io.Reader) (h hash.Hash, readGenesisStore func(*Store) error, err error)

func WriteGenesisStore

func WriteGenesisStore(rawWriter io.Writer, genesisStore *Store) error

Types

type Accounts

type Accounts struct {
	Raw kvdb.Iteratee
}

func (*Accounts) ForEach

func (s *Accounts) ForEach(fn func(common.Address, genesis.Account))

type Blocks

type Blocks struct {
	Raw kvdb.Iteratee
}

func (*Blocks) ForEach

func (s *Blocks) ForEach(fn func(idx.Block, genesis.Block))

type Delegations

type Delegations struct {
	Raw kvdb.Iteratee
}

func (*Delegations) ForEach

func (s *Delegations) ForEach(fn func(common.Address, idx.ValidatorID, genesis.Delegation))

type Metadata

type Metadata struct {
	Validators    gpos.Validators
	FirstEpoch    idx.Epoch
	Time          inter.Timestamp
	PrevEpochTime inter.Timestamp
	ExtraData     []byte
	DriverOwner   common.Address
	TotalSupply   *big.Int
}

type Storage

type Storage struct {
	Raw kvdb.Iteratee
}

func (*Storage) ForEach

func (s *Storage) ForEach(fn func(common.Address, common.Hash, common.Hash))

type Store

type Store struct {
	logger.Instance
	// contains filtered or unexported fields
}

Store is a node persistent storage working over physical key-value database.

func NewMemStore

func NewMemStore() *Store

NewMemStore creates store over memory map.

func NewStore

func NewStore(db kvdb.Store) *Store

NewStore creates store over key-value db.

func (*Store) Blocks

func (s *Store) Blocks() genesis.Blocks

func (*Store) Close

func (s *Store) Close()

Close leaves underlying database.

func (*Store) Delegations

func (s *Store) Delegations() genesis.Delegations

func (*Store) EvmAccounts

func (s *Store) EvmAccounts() genesis.Accounts

func (*Store) EvmStorage

func (s *Store) EvmStorage() genesis.Storage

func (*Store) Export

func (s *Store) Export(writer io.Writer) error

func (*Store) GetDelegation

func (s *Store) GetDelegation(addr common.Address, toValidatorID idx.ValidatorID) genesis.Delegation

func (*Store) GetEvmAccount

func (s *Store) GetEvmAccount(addr common.Address) genesis.Account

func (*Store) GetEvmState

func (s *Store) GetEvmState(addr common.Address, key common.Hash) common.Hash

func (*Store) GetGenesis

func (s *Store) GetGenesis() photon.Genesis

func (*Store) GetMetadata

func (s *Store) GetMetadata() Metadata

func (*Store) GetRules

func (s *Store) GetRules() photon.Rules

func (*Store) Hash

func (s *Store) Hash() hash.Hash

func (*Store) Import

func (s *Store) Import(reader io.Reader) error

func (*Store) SetBlock

func (s *Store) SetBlock(index idx.Block, block genesis.Block)

func (*Store) SetDelegation

func (s *Store) SetDelegation(addr common.Address, toValidatorID idx.ValidatorID, delegation genesis.Delegation)

func (*Store) SetEvmAccount

func (s *Store) SetEvmAccount(addr common.Address, acc genesis.Account)

func (*Store) SetEvmState

func (s *Store) SetEvmState(addr common.Address, key common.Hash, value common.Hash)

func (*Store) SetMetadata

func (s *Store) SetMetadata(metadata Metadata)

func (*Store) SetRawEvmItem

func (s *Store) SetRawEvmItem(key, value []byte)

func (*Store) SetRules

func (s *Store) SetRules(cfg photon.Rules)

Jump to

Keyboard shortcuts

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