db

package
v0.0.0-...-985d544 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: CC0-1.0 Imports: 14 Imported by: 0

Documentation

Overview

Package db implements functions to create and read Ethereum database dumps.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Dump

func Dump(
	dataDir, testnet string,
	blockHeight uint64,
	blockHash string,
	defrost bool,
) error

Dump dumps the Ethereum database for the given testnet stored in dataDir up to blockHeight with given blockHash into the evm-bully cache directory:

~/.config/evm-bully/tetstnet/dbdump.

func Open

func Open(
	dataDir, testnet, cacheDir string,
	blockHeight uint64,
	blockHash string,
	defrost bool,
) (ethdb.Database, []common.Hash, error)

Open database.

Types

type Block

type Block struct {
	Header       *types.Header
	Coinbase     common.Address
	Time         uint64
	Hash         common.Hash
	Transactions []*Transaction
}

Block defines an Ethereum block.

type Reader

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

Reader implments a DB dump reader.

func NewReader

func NewReader(testnet string) (*Reader, error)

NewReader returns a new DB dump reader for the given testnet.

func (*Reader) Close

func (r *Reader) Close() error

Close closes the reader.

func (*Reader) Next

func (r *Reader) Next() (*Block, error)

Next returns the next Block for the given reader or nil.

type Transaction

type Transaction struct {
	RLP      []byte
	Nonce    uint64
	GasPrice *big.Int
	GasLimit uint64
	To       *common.Address
	Value    *big.Int
	Data     []byte
}

Transaction defines an Ethereum transaction.

Jump to

Keyboard shortcuts

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