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) GetAllValidatorAddresses() []common.Address
- func (b *APIBackend) GetBalance(ctx context.Context, address common.Address, blockNr rpc.BlockNumber) (*big.Int, error)
- func (b *APIBackend) GetBlock(ctx context.Context, hash common.Hash) (*types.Block, error)
- func (b *APIBackend) GetCurrentBadBlocks() []core.BadBlock
- func (b *APIBackend) GetCurrentStakingErrorSink() []staking.RPCTransactionError
- func (b *APIBackend) GetCurrentTransactionErrorSink() []types.RPCTransactionError
- func (b *APIBackend) GetCurrentUtilityMetrics() (*network.UtilityMetric, error)
- func (b *APIBackend) GetDelegationsByDelegator(delegator common.Address) ([]common.Address, []*staking.Delegation)
- func (b *APIBackend) GetDelegationsByValidator(validator common.Address) []*staking.Delegation
- func (b *APIBackend) GetEVM(ctx context.Context, msg core.Message, state *state.DB, header *block.Header) (*vm.EVM, func() error, error)
- func (b *APIBackend) GetElectedValidatorAddresses() []common.Address
- func (b *APIBackend) GetLastCrossLinks() ([]*types.CrossLink, error)
- func (b *APIBackend) GetLogs(ctx context.Context, blockHash common.Hash) ([][]*types.Log, error)
- func (b *APIBackend) GetMedianRawStakeSnapshot() (*committee.CompletedEPoSRound, error)
- func (b *APIBackend) GetPendingCXReceipts() []*types.CXReceiptsProof
- func (b *APIBackend) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error)
- func (b *APIBackend) GetPoolTransaction(hash common.Hash) types.PoolTransaction
- func (b *APIBackend) GetPoolTransactions() (types.PoolTransactions, error)
- func (b *APIBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error)
- func (b *APIBackend) GetShardID() uint32
- func (b *APIBackend) GetShardState() (*shard.State, error)
- func (b *APIBackend) GetSuperCommittees() (*quorum.Transition, error)
- func (b *APIBackend) GetTotalStakingSnapshot() *big.Int
- func (b *APIBackend) GetTransactionsHistory(address, txType, order string) ([]common.Hash, error)
- func (b *APIBackend) GetValidatorInformation(addr common.Address) (*staking.ValidatorRPCEnchanced, error)
- func (b *APIBackend) GetValidatorSelfDelegation(addr common.Address) *big.Int
- func (b *APIBackend) GetValidators(epoch *big.Int) (*shard.Committee, 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 { TotalStakingCache struct { sync.Mutex BlockHeight int64 TotalStaking *big.Int } // 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) GetAllValidatorAddresses ¶ added in v1.3.0
func (b *APIBackend) GetAllValidatorAddresses() []common.Address
GetAllValidatorAddresses returns the up to date validator candidates for next epoch
func (*APIBackend) GetBalance ¶
func (b *APIBackend) GetBalance(ctx context.Context, address common.Address, blockNr rpc.BlockNumber) (*big.Int, error)
GetBalance returns balance of an given address.
func (*APIBackend) GetCurrentBadBlocks ¶ added in v1.3.4
func (b *APIBackend) GetCurrentBadBlocks() []core.BadBlock
GetCurrentBadBlocks ..
func (*APIBackend) GetCurrentStakingErrorSink ¶ added in v1.3.0
func (b *APIBackend) GetCurrentStakingErrorSink() []staking.RPCTransactionError
GetCurrentStakingErrorSink ..
func (*APIBackend) GetCurrentTransactionErrorSink ¶
func (b *APIBackend) GetCurrentTransactionErrorSink() []types.RPCTransactionError
GetCurrentTransactionErrorSink ..
func (*APIBackend) GetCurrentUtilityMetrics ¶ added in v1.3.1
func (b *APIBackend) GetCurrentUtilityMetrics() (*network.UtilityMetric, error)
GetCurrentUtilityMetrics ..
func (*APIBackend) GetDelegationsByDelegator ¶ added in v1.3.0
func (b *APIBackend) GetDelegationsByDelegator( delegator common.Address, ) ([]common.Address, []*staking.Delegation)
GetDelegationsByDelegator returns all delegation information of a delegator
func (*APIBackend) GetDelegationsByValidator ¶ added in v1.3.0
func (b *APIBackend) GetDelegationsByValidator(validator common.Address) []*staking.Delegation
GetDelegationsByValidator returns all delegation information of a validator
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) GetElectedValidatorAddresses ¶ added in v1.3.2
func (b *APIBackend) GetElectedValidatorAddresses() []common.Address
GetElectedValidatorAddresses returns the address of elected validators for current epoch
func (*APIBackend) GetLastCrossLinks ¶ added in v1.3.5
func (b *APIBackend) GetLastCrossLinks() ([]*types.CrossLink, error)
GetLastCrossLinks ..
func (*APIBackend) GetMedianRawStakeSnapshot ¶ added in v1.3.0
func (b *APIBackend) GetMedianRawStakeSnapshot() ( *committee.CompletedEPoSRound, error, )
GetMedianRawStakeSnapshot ..
func (*APIBackend) GetPendingCXReceipts ¶ added in v1.1.1
func (b *APIBackend) GetPendingCXReceipts() []*types.CXReceiptsProof
GetPendingCXReceipts ..
func (*APIBackend) GetPoolNonce ¶
GetPoolNonce ...
func (*APIBackend) GetPoolTransaction ¶
func (b *APIBackend) GetPoolTransaction(hash common.Hash) types.PoolTransaction
GetPoolTransaction ...
func (*APIBackend) GetPoolTransactions ¶
func (b *APIBackend) GetPoolTransactions() (types.PoolTransactions, 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) GetShardState ¶ added in v1.3.0
func (b *APIBackend) GetShardState() (*shard.State, error)
GetShardState ...
func (*APIBackend) GetSuperCommittees ¶ added in v1.3.2
func (b *APIBackend) GetSuperCommittees() (*quorum.Transition, error)
GetSuperCommittees ..
func (*APIBackend) GetTotalStakingSnapshot ¶ added in v1.3.2
func (b *APIBackend) GetTotalStakingSnapshot() *big.Int
GetTotalStakingSnapshot ..
func (*APIBackend) GetTransactionsHistory ¶
func (b *APIBackend) GetTransactionsHistory(address, txType, order string) ([]common.Hash, error)
GetTransactionsHistory returns list of transactions hashes of address.
func (*APIBackend) GetValidatorInformation ¶ added in v1.3.0
func (b *APIBackend) GetValidatorInformation( addr common.Address, ) (*staking.ValidatorRPCEnchanced, error)
GetValidatorInformation returns the information of validator
func (*APIBackend) GetValidatorSelfDelegation ¶ added in v1.3.0
func (b *APIBackend) GetValidatorSelfDelegation(addr common.Address) *big.Int
GetValidatorSelfDelegation returns the amount of staking after applying all delegated stakes
func (*APIBackend) GetValidators ¶ added in v1.3.0
GetValidators returns validators for a particular epoch.
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) error AddPendingTransaction(newTx *types.Transaction) error Blockchain() *core.BlockChain AccountManager() *accounts.Manager GetBalanceOfAddress(address common.Address) (*big.Int, error) GetNonceOfAddress(address common.Address) uint64 GetTransactionsHistory(address, txType, order string) ([]common.Hash, error) IsCurrentlyLeader() bool ErroredStakingTransactionSink() []staking.RPCTransactionError ErroredTransactionSink() []types.RPCTransactionError PendingCXReceipts() []*types.CXReceiptsProof }
NodeAPI is the list of functions from node used to call rpc apis.