client

package
v0.0.0-...-c17f0e7 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BlockByNumber

func BlockByNumber(c Client, blockNum uint64) (types.RawBlock, error)

func CallBalanceOfERC20

func CallBalanceOfERC20(c Client, contract types.Address, holder types.Address, blockNum uint64) (types.HexData, error)

func CallEIP165

func CallEIP165(c Client, address types.Address, interfaceId []byte, blockNum uint64) (bool, error)

func Consensus

func Consensus(c Client) (string, error)

func CurrentBlock

func CurrentBlock(c Client) (uint64, error)

func CurrentBlockQuery

func CurrentBlockQuery() string

func DumpAddress

func DumpAddress(c Client, address types.Address, blockNumber uint64) (*types.AccountState, error)

func GetCode

func GetCode(c Client, address types.Address, blockNumber uint64) (types.HexData, error)

func StorageRoot

func StorageRoot(c Client, account types.Address, blockNum uint64) (types.Hash, error)

func TraceTransaction

func TraceTransaction(c Client, txHash types.Hash) (types.RawOuterCall, error)

func TransactionDetailQuery

func TransactionDetailQuery(hash types.Hash) string

Types

type Address

type Address struct {
	Address types.Address
}

type Block

type Block struct {
	Number types.HexNumber
}

type Client

type Client interface {
	// SubscribeChainHead subscribes to new chain header
	SubscribeChainHead(chan<- types.RawHeader) error
	// ExecuteGraphQLQuery performs a fully constructed query against the Geth
	// GraphQL server
	ExecuteGraphQLQuery(interface{}, string) error
	// RPCCall makes a JSON RPC call to the Geth RPC server
	RPCCall(interface{}, string, ...interface{}) error
	// Stop quorum client connection
	Stop()
}

type CurrentBlockResult

type CurrentBlockResult struct {
	Block Block
}

type Event

type Event struct {
	Index   uint64
	Account Address
	Topics  []types.Hash
	Data    types.HexData
}

type QuorumClient

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

QuorumClient provides access to quorum blockchain node.

func NewQuorumClient

func NewQuorumClient(rawUrl string) (*QuorumClient, error)

func NewQuorumGraphQLClient

func NewQuorumGraphQLClient(rawUrl, qgUrl string) (*QuorumClient, error)

func (*QuorumClient) ExecuteGraphQLQuery

func (qc *QuorumClient) ExecuteGraphQLQuery(result interface{}, query string) error

Execute customized graphql query.

func (*QuorumClient) RPCCall

func (qc *QuorumClient) RPCCall(result interface{}, method string, args ...interface{}) error

Execute customized rpc call.

func (*QuorumClient) RPCCallWithTimeout

func (qc *QuorumClient) RPCCallWithTimeout(timeout time.Duration, result interface{}, method string, args ...interface{}) error

func (*QuorumClient) Stop

func (qc *QuorumClient) Stop()

func (*QuorumClient) SubscribeChainHead

func (qc *QuorumClient) SubscribeChainHead(ch chan<- types.RawHeader) error

Subscribe to chain head event.

type StubQuorumClient

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

StubQuorumClient is used for unit test.

func NewStubQuorumClient

func NewStubQuorumClient(mockGraphQL map[string]map[string]interface{}, mockRPC map[string]interface{}) *StubQuorumClient

func (*StubQuorumClient) ExecuteGraphQLQuery

func (qc *StubQuorumClient) ExecuteGraphQLQuery(result interface{}, query string) error

func (*StubQuorumClient) RPCCall

func (qc *StubQuorumClient) RPCCall(result interface{}, method string, args ...interface{}) error

func (*StubQuorumClient) Stop

func (qc *StubQuorumClient) Stop()

func (*StubQuorumClient) SubscribeChainHead

func (qc *StubQuorumClient) SubscribeChainHead(chan<- types.RawHeader) error

type Transaction

type Transaction struct {
	Hash              types.Hash
	Status            string
	Index             uint64
	Nonce             types.HexNumber
	From              Address
	To                Address
	Value             types.HexNumber
	GasPrice          types.HexNumber
	Gas               types.HexNumber
	GasUsed           types.HexNumber
	CumulativeGasUsed types.HexNumber
	CreatedContract   Address
	InputData         types.HexData
	PrivateInputData  types.HexData
	IsPrivate         bool
	Logs              []Event
}

func TransactionWithReceipt

func TransactionWithReceipt(c Client, transactionHash types.Hash) (Transaction, error)

type TransactionResult

type TransactionResult struct {
	Transaction Transaction
}

Jump to

Keyboard shortcuts

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