rpc

package
v0.0.0-...-98400ad Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2020 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EthBlockChainRPC

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

func NewEthRPC

func NewEthRPC(api string) *EthBlockChainRPC

func (EthBlockChainRPC) GetBlockByNum

func (rpc EthBlockChainRPC) GetBlockByNum(num uint64) (blockchain.Block, error)

func (EthBlockChainRPC) GetCurrentBlockNum

func (rpc EthBlockChainRPC) GetCurrentBlockNum() (uint64, error)

func (EthBlockChainRPC) GetLiteBlockByNum

func (rpc EthBlockChainRPC) GetLiteBlockByNum(num uint64) (blockchain.Block, error)

func (EthBlockChainRPC) GetLogs

func (rpc EthBlockChainRPC) GetLogs(
	fromBlockNum, toBlockNum uint64,
	address string,
	topics []string,
) ([]blockchain.IReceiptLog, error)

func (EthBlockChainRPC) GetTransactionReceipt

func (rpc EthBlockChainRPC) GetTransactionReceipt(txHash string) (blockchain.TransactionReceipt, error)

type EthBlockChainRPCWithRetry

type EthBlockChainRPCWithRetry struct {
	*EthBlockChainRPC
	// contains filtered or unexported fields
}

func NewEthRPCWithRetry

func NewEthRPCWithRetry(api string, maxRetryCount int) *EthBlockChainRPCWithRetry

func (EthBlockChainRPCWithRetry) GetBlockByNum

func (rpc EthBlockChainRPCWithRetry) GetBlockByNum(num uint64) (rst blockchain.Block, err error)

func (EthBlockChainRPCWithRetry) GetCurrentBlockNum

func (rpc EthBlockChainRPCWithRetry) GetCurrentBlockNum() (rst uint64, err error)

func (EthBlockChainRPCWithRetry) GetLiteBlockByNum

func (rpc EthBlockChainRPCWithRetry) GetLiteBlockByNum(num uint64) (rst blockchain.Block, err error)

func (EthBlockChainRPCWithRetry) GetLogs

func (rpc EthBlockChainRPCWithRetry) GetLogs(
	fromBlockNum, toBlockNum uint64,
	address string,
	topics []string,
) (rst []blockchain.IReceiptLog, err error)

func (EthBlockChainRPCWithRetry) GetTransactionReceipt

func (rpc EthBlockChainRPCWithRetry) GetTransactionReceipt(txHash string) (rst blockchain.TransactionReceipt, err error)

type IBlockChainRPC

type IBlockChainRPC interface {
	GetCurrentBlockNum() (uint64, error)

	GetBlockByNum(uint64) (blockchain.Block, error)
	GetLiteBlockByNum(uint64) (blockchain.Block, error)
	GetTransactionReceipt(txHash string) (blockchain.TransactionReceipt, error)

	GetLogs(from, to uint64, address string, topics []string) ([]blockchain.IReceiptLog, error)
}

Jump to

Keyboard shortcuts

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