Documentation ¶
Index ¶
- func NewBloomIndexer(db ethdb.Database, size, confirms uint64) *core.ChainIndexer
- type APIBackend
- func (b *APIBackend) AccountManager() *accounts.Manager
- func (b *APIBackend) BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error)
- func (b *APIBackend) BloomStatus() (uint64, uint64)
- func (b *APIBackend) ChainConfig() *params.ChainConfig
- func (b *APIBackend) ChainDb() ethdb.Database
- func (b *APIBackend) CurrentBlock() *types.Block
- func (b *APIBackend) EventMux() *event.TypeMux
- func (b *APIBackend) GetBalance(address common.Address) (*big.Int, error)
- func (b *APIBackend) GetBlock(ctx context.Context, hash common.Hash) (*types.Block, error)
- func (b *APIBackend) GetCommittee(epoch *big.Int) (*shard.Committee, error)
- func (b *APIBackend) GetCurrentTransactionErrorSink() []types.RPCTransactionError
- func (b *APIBackend) GetEVM(ctx context.Context, msg core.Message, state *state.DB, header *block.Header) (*vm.EVM, func() error, error)
- func (b *APIBackend) GetLogs(ctx context.Context, blockHash common.Hash) ([][]*types.Log, error)
- func (b *APIBackend) GetPendingCXReceipts() []*types.CXReceiptsProof
- func (b *APIBackend) GetPendingCrossLinks() []*block.Header
- func (b *APIBackend) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error)
- func (b *APIBackend) GetPoolTransaction(hash common.Hash) *types.Transaction
- func (b *APIBackend) GetPoolTransactions() (types.Transactions, error)
- func (b *APIBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error)
- func (b *APIBackend) GetShardID() uint32
- func (b *APIBackend) GetTransactionsHistory(address, txType, order string) ([]common.Hash, error)
- func (b *APIBackend) HeaderByHash(ctx context.Context, blockHash common.Hash) (*block.Header, error)
- func (b *APIBackend) HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*block.Header, error)
- func (b *APIBackend) IsLeader() bool
- func (b *APIBackend) NetVersion() uint64
- func (b *APIBackend) ProtocolVersion() int
- func (b *APIBackend) RPCGasCap() *big.Int
- func (b *APIBackend) ResendCx(ctx context.Context, txID common.Hash) (uint64, bool)
- func (b *APIBackend) SendStakingTx(ctx context.Context, newStakingTx *staking.StakingTransaction) error
- func (b *APIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error
- func (b *APIBackend) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession)
- func (b *APIBackend) StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.DB, *block.Header, error)
- func (b *APIBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription
- func (b *APIBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription
- func (b *APIBackend) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription
- func (b *APIBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription
- func (b *APIBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription
- func (b *APIBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription
- type BloomIndexer
- type Harmony
- type NodeAPI
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewBloomIndexer ¶
func NewBloomIndexer(db ethdb.Database, size, confirms uint64) *core.ChainIndexer
NewBloomIndexer returns a chain indexer that generates bloom bits data for the canonical chain for fast logs filtering.
Types ¶
type APIBackend ¶
type APIBackend struct {
// contains filtered or unexported fields
}
APIBackend An implementation of internal/hmyapi/Backend. Full client.
func (*APIBackend) AccountManager ¶
func (b *APIBackend) AccountManager() *accounts.Manager
AccountManager ...
func (*APIBackend) BlockByNumber ¶
func (b *APIBackend) BlockByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*types.Block, error)
BlockByNumber ...
func (*APIBackend) BloomStatus ¶
func (b *APIBackend) BloomStatus() (uint64, uint64)
BloomStatus ... TODO: this is not implemented or verified yet for harmony.
func (*APIBackend) ChainConfig ¶
func (b *APIBackend) ChainConfig() *params.ChainConfig
ChainConfig ...
func (*APIBackend) EventMux ¶
func (b *APIBackend) EventMux() *event.TypeMux
EventMux ... TODO: this is not implemented or verified yet for harmony.
func (*APIBackend) GetBalance ¶
GetBalance returns balance of an given address.
func (*APIBackend) GetCommittee ¶
GetCommittee returns committee for a particular epoch.
func (*APIBackend) GetCurrentTransactionErrorSink ¶
func (b *APIBackend) GetCurrentTransactionErrorSink() []types.RPCTransactionError
GetCurrentTransactionErrorSink ..
func (*APIBackend) GetEVM ¶
func (b *APIBackend) GetEVM(ctx context.Context, msg core.Message, state *state.DB, header *block.Header) (*vm.EVM, func() error, error)
GetEVM returns a new EVM entity
func (*APIBackend) GetPendingCXReceipts ¶ added in v1.1.1
func (b *APIBackend) GetPendingCXReceipts() []*types.CXReceiptsProof
GetPendingCXReceipts ..
func (*APIBackend) GetPendingCrossLinks ¶ added in v1.2.0
func (b *APIBackend) GetPendingCrossLinks() []*block.Header
GetPendingCrossLinks ..
func (*APIBackend) GetPoolNonce ¶
GetPoolNonce ...
func (*APIBackend) GetPoolTransaction ¶
func (b *APIBackend) GetPoolTransaction(hash common.Hash) *types.Transaction
GetPoolTransaction ...
func (*APIBackend) GetPoolTransactions ¶
func (b *APIBackend) GetPoolTransactions() (types.Transactions, error)
GetPoolTransactions returns pool transactions. TODO: this is not implemented or verified yet for harmony.
func (*APIBackend) GetReceipts ¶
GetReceipts ...
func (*APIBackend) GetShardID ¶
func (b *APIBackend) GetShardID() uint32
GetShardID returns shardID of this node
func (*APIBackend) GetTransactionsHistory ¶
func (b *APIBackend) GetTransactionsHistory(address, txType, order string) ([]common.Hash, error)
GetTransactionsHistory returns list of transactions hashes of address.
func (*APIBackend) HeaderByHash ¶
func (b *APIBackend) HeaderByHash(ctx context.Context, blockHash common.Hash) (*block.Header, error)
HeaderByHash ...
func (*APIBackend) HeaderByNumber ¶
func (b *APIBackend) HeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*block.Header, error)
HeaderByNumber ...
func (*APIBackend) IsLeader ¶
func (b *APIBackend) IsLeader() bool
IsLeader exposes if node is currently leader
func (*APIBackend) NetVersion ¶
func (b *APIBackend) NetVersion() uint64
NetVersion returns net version
func (*APIBackend) RPCGasCap ¶
func (b *APIBackend) RPCGasCap() *big.Int
RPCGasCap returns the gas cap of rpc
func (*APIBackend) ResendCx ¶
ResendCx retrieve blockHash from txID and add blockHash to CxPool for resending
func (*APIBackend) SendStakingTx ¶
func (b *APIBackend) SendStakingTx( ctx context.Context, newStakingTx *staking.StakingTransaction) error
SendStakingTx adds a staking transaction
func (*APIBackend) SendTx ¶
func (b *APIBackend) SendTx(ctx context.Context, signedTx *types.Transaction) error
SendTx ...
func (*APIBackend) ServiceFilter ¶
func (b *APIBackend) ServiceFilter(ctx context.Context, session *bloombits.MatcherSession)
ServiceFilter ...
func (*APIBackend) StateAndHeaderByNumber ¶
func (b *APIBackend) StateAndHeaderByNumber(ctx context.Context, blockNr rpc.BlockNumber) (*state.DB, *block.Header, error)
StateAndHeaderByNumber ...
func (*APIBackend) SubscribeChainEvent ¶
func (b *APIBackend) SubscribeChainEvent(ch chan<- core.ChainEvent) event.Subscription
SubscribeChainEvent subcribes chain event. TODO: this is not implemented or verified yet for harmony.
func (*APIBackend) SubscribeChainHeadEvent ¶
func (b *APIBackend) SubscribeChainHeadEvent(ch chan<- core.ChainHeadEvent) event.Subscription
SubscribeChainHeadEvent subcribes chain head event. TODO: this is not implemented or verified yet for harmony.
func (*APIBackend) SubscribeChainSideEvent ¶
func (b *APIBackend) SubscribeChainSideEvent(ch chan<- core.ChainSideEvent) event.Subscription
SubscribeChainSideEvent subcribes chain side event. TODO: this is not implemented or verified yet for harmony.
func (*APIBackend) SubscribeLogsEvent ¶
func (b *APIBackend) SubscribeLogsEvent(ch chan<- []*types.Log) event.Subscription
SubscribeLogsEvent subcribes log event. TODO: this is not implemented or verified yet for harmony.
func (*APIBackend) SubscribeNewTxsEvent ¶
func (b *APIBackend) SubscribeNewTxsEvent(ch chan<- core.NewTxsEvent) event.Subscription
SubscribeNewTxsEvent subcribes new tx event. TODO: this is not implemented or verified yet for harmony.
func (*APIBackend) SubscribeRemovedLogsEvent ¶
func (b *APIBackend) SubscribeRemovedLogsEvent(ch chan<- core.RemovedLogsEvent) event.Subscription
SubscribeRemovedLogsEvent subcribes removed logs event. TODO: this is not implemented or verified yet for harmony.
type BloomIndexer ¶
type BloomIndexer struct {
// contains filtered or unexported fields
}
BloomIndexer implements a core.ChainIndexer, building up a rotated bloom bits index for the Ethereum header bloom filters, permitting blazing fast filtering.
func (*BloomIndexer) Commit ¶
func (b *BloomIndexer) Commit() error
Commit implements core.ChainIndexerBackend, finalizing the bloom section and writing it out into the database.
type Harmony ¶
type Harmony struct { APIBackend *APIBackend // TODO(ricl): put this into config object // TODO(ricl): this is never set. Will result in nil pointer bug // RPCGasCap is the global gas cap for eth-call variants. RPCGasCap *big.Int `toml:",omitempty"` // contains filtered or unexported fields }
Harmony implements the Harmony full node service.
func New ¶
func New(nodeAPI NodeAPI, txPool *core.TxPool, cxPool *core.CxPool, eventMux *event.TypeMux, shardID uint32) (*Harmony, error)
New creates a new Harmony object (including the initialisation of the common Harmony object)
func (*Harmony) CxPool ¶
CxPool is used to store the blockHashes, where the corresponding block contains the cross shard receipts to be sent
func (*Harmony) NetVersion ¶
NetVersion returns the network version, i.e. network ID identifying which network we are using
type NodeAPI ¶
type NodeAPI interface { AddPendingStakingTransaction(*staking.StakingTransaction) AddPendingTransaction(newTx *types.Transaction) Blockchain() *core.BlockChain AccountManager() *accounts.Manager GetBalanceOfAddress(address common.Address) (*big.Int, error) GetNonceOfAddress(address common.Address) uint64 // Get transactions history for an address GetTransactionsHistory(address, txType, order string) ([]common.Hash, error) ErroredTransactionSink() []types.RPCTransactionError IsCurrentlyLeader() bool PendingCrossLinks() []*block.Header PendingCXReceipts() []*types.CXReceiptsProof }
NodeAPI is the list of functions from node used to call rpc apis.