hmy

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2020 License: MIT Imports: 22 Imported by: 0

Documentation

Index

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) ChainDb

func (b *APIBackend) ChainDb() ethdb.Database

ChainDb ...

func (*APIBackend) CurrentBlock

func (b *APIBackend) CurrentBlock() *types.Block

CurrentBlock ...

func (*APIBackend) EventMux

func (b *APIBackend) EventMux() *event.TypeMux

EventMux ... TODO: this is not implemented or verified yet for harmony.

func (*APIBackend) GetBalance

func (b *APIBackend) GetBalance(address common.Address) (*big.Int, error)

GetBalance returns balance of an given address.

func (*APIBackend) GetBlock

func (b *APIBackend) GetBlock(ctx context.Context, hash common.Hash) (*types.Block, error)

GetBlock ...

func (*APIBackend) GetCommittee

func (b *APIBackend) GetCommittee(epoch *big.Int) (*shard.Committee, error)

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) GetLogs

func (b *APIBackend) GetLogs(ctx context.Context, blockHash common.Hash) ([][]*types.Log, error)

GetLogs ...

func (*APIBackend) GetPendingCXReceipts added in v1.1.1

func (b *APIBackend) GetPendingCXReceipts() []*types.CXReceiptsProof

GetPendingCXReceipts ..

func (b *APIBackend) GetPendingCrossLinks() []*block.Header

GetPendingCrossLinks ..

func (*APIBackend) GetPoolNonce

func (b *APIBackend) GetPoolNonce(ctx context.Context, addr common.Address) (uint64, error)

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

func (b *APIBackend) GetReceipts(ctx context.Context, hash common.Hash) (types.Receipts, error)

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) ProtocolVersion

func (b *APIBackend) ProtocolVersion() int

ProtocolVersion ...

func (*APIBackend) RPCGasCap

func (b *APIBackend) RPCGasCap() *big.Int

RPCGasCap returns the gas cap of rpc

func (*APIBackend) ResendCx

func (b *APIBackend) ResendCx(ctx context.Context, txID common.Hash) (uint64, bool)

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.

func (*BloomIndexer) Process

func (b *BloomIndexer) Process(ctx context.Context, header *block.Header) error

Process implements core.ChainIndexerBackend, adding a new header's bloom into the index.

func (*BloomIndexer) Reset

func (b *BloomIndexer) Reset(ctx context.Context, section uint64, lastSectionHead common.Hash) error

Reset implements core.ChainIndexerBackend, starting a new bloombits index section.

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) BlockChain

func (s *Harmony) BlockChain() *core.BlockChain

BlockChain ...

func (*Harmony) CxPool

func (s *Harmony) CxPool() *core.CxPool

CxPool is used to store the blockHashes, where the corresponding block contains the cross shard receipts to be sent

func (*Harmony) NetVersion

func (s *Harmony) NetVersion() uint64

NetVersion returns the network version, i.e. network ID identifying which network we are using

func (*Harmony) TxPool

func (s *Harmony) TxPool() *core.TxPool

TxPool ...

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.

Jump to

Keyboard shortcuts

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