coreth

package module
v0.3.1-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2020 License: LGPL-3.0 Imports: 18 Imported by: 0

README

coreth

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BlackholeAddr = common.Address{
		1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
		0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
	}
)

Functions

This section is empty.

Types

type Block

type Block = types.Block

type ETHChain

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

func NewETHChain

func NewETHChain(config *eth.Config, nodecfg *node.Config, etherBase *common.Address, chainDB ethdb.Database) *ETHChain

NewETHChain creates an Ethereum blockchain with the given configs.

func (*ETHChain) AddLocalTxs

func (self *ETHChain) AddLocalTxs(txs []*types.Transaction) []error

func (*ETHChain) AddRemoteTxs

func (self *ETHChain) AddRemoteTxs(txs []*types.Transaction) []error

func (*ETHChain) AttachEthService

func (self *ETHChain) AttachEthService(handler *rpc.Server, namespaces []string)

func (*ETHChain) BlockState

func (self *ETHChain) BlockState(block *types.Block) (*state.StateDB, error)

Returns a new mutable state based on the given block.

func (*ETHChain) CurrentState

func (self *ETHChain) CurrentState() (*state.StateDB, error)

Returns a new mutable state based on the current HEAD block.

func (*ETHChain) GenBlock

func (self *ETHChain) GenBlock()

func (*ETHChain) GetBlockByHash

func (self *ETHChain) GetBlockByHash(hash common.Hash) *types.Block

Retrives a block from the database by hash.

func (*ETHChain) GetGenesisBlock

func (self *ETHChain) GetGenesisBlock() *types.Block

func (*ETHChain) GetReceiptsByHash

func (self *ETHChain) GetReceiptsByHash(hash common.Hash) types.Receipts

func (*ETHChain) GetTxPool

func (self *ETHChain) GetTxPool() *core.TxPool

func (*ETHChain) GetTxSubmitCh

func (self *ETHChain) GetTxSubmitCh() <-chan struct{}

TODO: use SubscribeNewTxsEvent()

func (*ETHChain) InsertChain

func (self *ETHChain) InsertChain(chain []*types.Block) (int, error)

func (*ETHChain) NewRPCHandler

func (self *ETHChain) NewRPCHandler() *rpc.Server

func (*ETHChain) PendingSize

func (self *ETHChain) PendingSize() (int, error)

func (*ETHChain) SetOnAPIs

func (self *ETHChain) SetOnAPIs(cb dummy.OnAPIsCallbackType)

func (*ETHChain) SetOnExtraStateChange added in v0.2.12

func (self *ETHChain) SetOnExtraStateChange(cb dummy.OnExtraStateChangeType)

func (*ETHChain) SetOnFinalize

func (self *ETHChain) SetOnFinalize(cb dummy.OnFinalizeCallbackType)

func (*ETHChain) SetOnFinalizeAndAssemble

func (self *ETHChain) SetOnFinalizeAndAssemble(cb dummy.OnFinalizeAndAssembleCallbackType)

func (*ETHChain) SetOnHeaderNew

func (self *ETHChain) SetOnHeaderNew(cb func(*types.Header))

func (*ETHChain) SetOnQueryAcceptedBlock

func (self *ETHChain) SetOnQueryAcceptedBlock(cb func() *types.Block)

func (*ETHChain) SetOnSeal

func (self *ETHChain) SetOnSeal(cb func(*types.Block) error)

func (*ETHChain) SetOnSealDrop

func (self *ETHChain) SetOnSealDrop(cb func(*types.Block))

func (*ETHChain) SetOnSealFinish

func (self *ETHChain) SetOnSealFinish(cb func(*types.Block) error)

func (*ETHChain) SetOnSealHash

func (self *ETHChain) SetOnSealHash(cb func(*types.Header))

func (*ETHChain) SetTail

func (self *ETHChain) SetTail(hash common.Hash) error

SetTail sets the current head block to the one defined by the hash irrelevant what the chain contents were prior.

func (*ETHChain) Start

func (self *ETHChain) Start()

func (*ETHChain) Stop

func (self *ETHChain) Stop()

func (*ETHChain) SubscribeNewMinedBlockEvent added in v0.3.1

func (self *ETHChain) SubscribeNewMinedBlockEvent() *event.TypeMuxSubscription

func (*ETHChain) VerifyBlock added in v0.2.8

func (self *ETHChain) VerifyBlock(block *types.Block) bool

type Hash

type Hash = common.Hash

type Key

type Key struct {
	Address    common.Address
	PrivateKey *ecdsa.PrivateKey
}

func NewKey

func NewKey(rand io.Reader) (*Key, error)

func NewKeyFromECDSA

func NewKeyFromECDSA(privateKeyECDSA *ecdsa.PrivateKey) *Key

type Tx

type Tx = types.Transaction

Directories

Path Synopsis
Package accounts implements high level Ethereum account management.
Package accounts implements high level Ethereum account management.
keystore
Package keystore implements encrypted storage of secp256k1 private keys.
Package keystore implements encrypted storage of secp256k1 private keys.
Package consensus implements different Ethereum consensus engines.
Package consensus implements different Ethereum consensus engines.
clique
Package clique implements the proof-of-authority consensus engine.
Package clique implements the proof-of-authority consensus engine.
ethash
Package ethash implements the ethash proof-of-work consensus engine.
Package ethash implements the ethash proof-of-work consensus engine.
Package core implements the Ethereum consensus protocol.
Package core implements the Ethereum consensus protocol.
bloombits
Package bloombits implements bloom filtering on batches of data.
Package bloombits implements bloom filtering on batches of data.
forkid
Package forkid implements EIP-2124 (https://eips.ethereum.org/EIPS/eip-2124).
Package forkid implements EIP-2124 (https://eips.ethereum.org/EIPS/eip-2124).
rawdb
Package rawdb contains a collection of low level database accessors.
Package rawdb contains a collection of low level database accessors.
state
Package state provides a caching layer atop the Ethereum state trie.
Package state provides a caching layer atop the Ethereum state trie.
state/snapshot
Package snapshot implements a journalled, dynamic state dump.
Package snapshot implements a journalled, dynamic state dump.
types
Package types contains data types related to Ethereum consensus.
Package types contains data types related to Ethereum consensus.
vm
Package vm implements the Ethereum Virtual Machine.
Package vm implements the Ethereum Virtual Machine.
eth
Package eth implements the Ethereum protocol.
Package eth implements the Ethereum protocol.
filters
Package filters implements an ethereum filtering system for block, transactions and log events.
Package filters implements an ethereum filtering system for block, transactions and log events.
tracers
Package tracers is a collection of JavaScript transaction tracers.
Package tracers is a collection of JavaScript transaction tracers.
tracers/internal/tracers
Package tracers contains the actual JavaScript tracer assets.
Package tracers contains the actual JavaScript tracer assets.
Package ethstats implements the network stats reporting service.
Package ethstats implements the network stats reporting service.
examples
internal
debug
Package debug interfaces Go runtime debugging facilities.
Package debug interfaces Go runtime debugging facilities.
ethapi
Package ethapi implements the general Ethereum API functions.
Package ethapi implements the general Ethereum API functions.
Package miner implements Ethereum block creation and mining.
Package miner implements Ethereum block creation and mining.
evm
Package rpc implements bi-directional JSON-RPC 2.0 on multiple transports.
Package rpc implements bi-directional JSON-RPC 2.0 on multiple transports.

Jump to

Keyboard shortcuts

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