Documentation ¶
Index ¶
- Variables
- type Block
- type ETHChain
- func (self *ETHChain) APIBackend() *eth.EthAPIBackend
- func (self *ETHChain) Accept(block *types.Block) error
- func (self *ETHChain) AddLocalTxs(txs []*types.Transaction) []error
- func (self *ETHChain) AddRemoteTxs(txs []*types.Transaction) []error
- func (self *ETHChain) AttachEthService(handler *rpc.Server, namespaces []string)
- func (self *ETHChain) BlockChain() *core.BlockChain
- func (self *ETHChain) BlockState(block *types.Block) (*state.StateDB, error)
- func (self *ETHChain) CurrentState() (*state.StateDB, error)
- func (self *ETHChain) GenerateBlock() (*types.Block, error)
- func (self *ETHChain) GetBlockByHash(hash common.Hash) *types.Block
- func (self *ETHChain) GetBlockByNumber(num uint64) *types.Block
- func (self *ETHChain) GetGenesisBlock() *types.Block
- func (self *ETHChain) GetReceiptsByHash(hash common.Hash) types.Receipts
- func (self *ETHChain) GetTxAcceptedSubmitCh() <-chan core.NewTxsEvent
- func (self *ETHChain) GetTxPool() *core.TxPool
- func (self *ETHChain) GetTxSubmitCh() <-chan core.NewTxsEvent
- func (self *ETHChain) InsertBlock(block *types.Block) error
- func (self *ETHChain) LastAcceptedBlock() *types.Block
- func (self *ETHChain) NewRPCHandler(maximumDuration time.Duration) *rpc.Server
- func (self *ETHChain) PendingSize() (int, error)
- func (self *ETHChain) Reject(block *types.Block) error
- func (self *ETHChain) RemoveRejectedBlocks(start, end uint64) error
- func (self *ETHChain) SetGasPrice(newGasPrice *big.Int)
- func (self *ETHChain) SetPreference(block *types.Block) error
- func (self *ETHChain) Start()
- func (self *ETHChain) Stop()
- func (self *ETHChain) ValidateCanonicalChain() error
- type Hash
- type Tx
Constants ¶
This section is empty.
Variables ¶
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 ETHChain ¶
type ETHChain struct {
// contains filtered or unexported fields
}
func NewDefaultChain ¶
func NewDefaultChain(t *testing.T) (*ETHChain, chan core.NewTxPoolHeadEvent, <-chan core.NewTxsEvent)
func NewETHChain ¶
func NewETHChain(config *eth.Config, nodecfg *node.Config, chainDB ethdb.Database, settings eth.Settings, consensusCallbacks *dummy.ConsensusCallbacks, lastAcceptedHash common.Hash) (*ETHChain, error)
NewETHChain creates an Ethereum blockchain with the given configs.
func (*ETHChain) APIBackend ¶
func (self *ETHChain) APIBackend() *eth.EthAPIBackend
func (*ETHChain) Accept ¶
Accept sets a minimum height at which no reorg can pass. Additionally, this function may trigger a reorg if the block being accepted is not in the canonical chain.
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 (*ETHChain) BlockChain ¶
func (self *ETHChain) BlockChain() *core.BlockChain
func (*ETHChain) BlockState ¶
Returns a new mutable state based on the given block.
func (*ETHChain) CurrentState ¶
Returns a new mutable state based on the current HEAD block.
func (*ETHChain) GenerateBlock ¶ added in v0.5.2
func (*ETHChain) GetBlockByHash ¶
Retrives a block from the database by hash.
func (*ETHChain) GetBlockByNumber ¶
Retrives a block from the database by number.
func (*ETHChain) GetGenesisBlock ¶
func (*ETHChain) GetReceiptsByHash ¶
func (*ETHChain) GetTxAcceptedSubmitCh ¶
func (self *ETHChain) GetTxAcceptedSubmitCh() <-chan core.NewTxsEvent
func (*ETHChain) GetTxSubmitCh ¶
func (self *ETHChain) GetTxSubmitCh() <-chan core.NewTxsEvent
func (*ETHChain) InsertBlock ¶ added in v0.5.4
func (*ETHChain) LastAcceptedBlock ¶
LastAcceptedBlock returns the last block to be marked as accepted.
func (*ETHChain) NewRPCHandler ¶
func (*ETHChain) PendingSize ¶
func (*ETHChain) RemoveRejectedBlocks ¶ added in v0.5.4
RemoveRejectedBlocks removes the rejected blocks between heights [start] and [end].
func (*ETHChain) SetGasPrice ¶
SetGasPrice sets the gas price on the backend
func (*ETHChain) SetPreference ¶
SetPreference sets the current head block to the one provided as an argument regardless of what the chain contents were prior.
func (*ETHChain) ValidateCanonicalChain ¶
Validate the canonical chain from current block to the genesis. This should only be called as a convenience method in tests, not in production as it traverses the entire chain.
type Tx ¶
type Tx = types.Transaction