client

package
v0.0.0-...-5663add Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package client provides a client for the FISCO BCOS RPC API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client defines typed wrappers for the Ethereum RPC API.

func Dial

func Dial(rawurl string, groupID uint) (*Client, error)

Dial connects a client to the given URL and groupID.

func DialContext

func DialContext(ctx context.Context, rawurl string, groupID uint) (*Client, error)

DialContext pass the context to the rpc client

func NewClient

func NewClient(c *rpc.Client, groupID uint) *Client

NewClient creates a client that uses the given RPC client.

func (*Client) CallContract

func (gc *Client) CallContract(ctx context.Context, msg common.CallMsg, blockNumber *big.Int) ([]byte, error)

CallContract invoke the call method of rpc api

func (*Client) Close

func (gc *Client) Close()

Close disconnects the rpc

func (*Client) CodeAt

func (gc *Client) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)

CodeAt returns the contract code of the given account. The block number can be nil, in which case the code is taken from the latest known block.

func (*Client) FilterLogs

func (gc *Client) FilterLogs(ctx context.Context, q common.FilterQuery) ([]types.Log, error)

FilterLogs executes a filter query.

func (*Client) GetBlockByHash

func (gc *Client) GetBlockByHash(ctx context.Context, bhash string, includetx bool) ([]byte, error)

GetBlockByHash returns the block information according to the given block hash

func (*Client) GetBlockByNumber

func (gc *Client) GetBlockByNumber(ctx context.Context, bnum string, includetx bool) ([]byte, error)

GetBlockByNumber returns the block information according to the given block number(hex format)

func (*Client) GetBlockHashByNumber

func (gc *Client) GetBlockHashByNumber(ctx context.Context, bnum string) ([]byte, error)

GetBlockHashByNumber returns the block hash according to the given block number

func (*Client) GetBlockLimit

func (gc *Client) GetBlockLimit(ctx context.Context) (*big.Int, error)

GetBlockLimit returns the blocklimit for current blocknumber

func (*Client) GetBlockNumber

func (gc *Client) GetBlockNumber(ctx context.Context) ([]byte, error)

GetBlockNumber returns the latest block height(hex format) on a given groupID.

func (*Client) GetChainID

func (gc *Client) GetChainID(ctx context.Context) (*big.Int, error)

GetChainID returns the Chain ID of the FISCO BCOS running on the nodes.

func (*Client) GetClientVersion

func (gc *Client) GetClientVersion(ctx context.Context) ([]byte, error)

GetClientVersion returns the version of FISCO BCOS running on the nodes.

func (*Client) GetCode

func (gc *Client) GetCode(ctx context.Context, addr string) ([]byte, error)

GetCode returns the contract code according to the contract address

func (*Client) GetConsensusStatus

func (gc *Client) GetConsensusStatus(ctx context.Context) ([]byte, error)

GetConsensusStatus returns the status information about the consensus algorithm on a specific groupID

func (*Client) GetContractAddress

func (gc *Client) GetContractAddress(ctx context.Context, txhash string) (common.Address, error)

GetContractAddress returns a contract address according to the transaction hash

func (*Client) GetGroupID

func (gc *Client) GetGroupID() *big.Int

GetGroupID returns the groupID of the client

func (*Client) GetGroupList

func (gc *Client) GetGroupList(ctx context.Context) ([]byte, error)

GetGroupList returns the groupID list that the node belongs to

func (*Client) GetGroupPeers

func (gc *Client) GetGroupPeers(ctx context.Context) ([]byte, error)

GetGroupPeers returns the nodes and the overser nodes list on a specific group

func (*Client) GetNodeIDList

func (gc *Client) GetNodeIDList(ctx context.Context) ([]byte, error)

GetNodeIDList returns the ID information of the connected peers and itself

func (*Client) GetObserverList

func (gc *Client) GetObserverList(ctx context.Context) ([]byte, error)

GetObserverList returns the list of observer nodes' ID according to the groupID

func (*Client) GetPBFTView

func (gc *Client) GetPBFTView(ctx context.Context) ([]byte, error)

GetPBFTView returns the latest PBFT view(hex format) of the specific group and it will returns a wrong sentence if the consensus algorithm is not the PBFT.

func (*Client) GetPeers

func (gc *Client) GetPeers(ctx context.Context) ([]byte, error)

GetPeers returns the information of the connected peers

func (*Client) GetPendingTransactions

func (gc *Client) GetPendingTransactions(ctx context.Context) ([]byte, error)

GetPendingTransactions returns information of the pending transactions

func (*Client) GetPendingTxSize

func (gc *Client) GetPendingTxSize(ctx context.Context) ([]byte, error)

GetPendingTxSize returns amount of the pending transactions

func (*Client) GetSealerList

func (gc *Client) GetSealerList(ctx context.Context) ([]byte, error)

GetSealerList returns the list of consensus nodes' ID according to the groupID

func (*Client) GetSyncStatus

func (gc *Client) GetSyncStatus(ctx context.Context) ([]byte, error)

GetSyncStatus returns the synchronization status of the group

func (*Client) GetSystemConfigByKey

func (gc *Client) GetSystemConfigByKey(ctx context.Context, findkey string) ([]byte, error)

GetSystemConfigByKey returns value according to the key(only tx_count_limit, tx_gas_limit could work)

func (*Client) GetTotalTransactionCount

func (gc *Client) GetTotalTransactionCount(ctx context.Context) ([]byte, error)

GetTotalTransactionCount returns the totoal amount of transactions and the block height at present

func (*Client) GetTransactionByBlockHashAndIndex

func (gc *Client) GetTransactionByBlockHashAndIndex(ctx context.Context, bhash string, txindex string) ([]byte, error)

GetTransactionByBlockHashAndIndex returns the transaction information according to the given block hash and transaction index

func (*Client) GetTransactionByBlockNumberAndIndex

func (gc *Client) GetTransactionByBlockNumberAndIndex(ctx context.Context, bnum string, txindex string) ([]byte, error)

GetTransactionByBlockNumberAndIndex returns the transaction information according to the given block number and transaction index

func (*Client) GetTransactionByHash

func (gc *Client) GetTransactionByHash(ctx context.Context, txhash string) ([]byte, error)

GetTransactionByHash returns the transaction information according to the given transaction hash

func (*Client) GetTransactionReceipt

func (gc *Client) GetTransactionReceipt(ctx context.Context, txhash string) (*types.Receipt, error)

GetTransactionReceipt returns the transaction receipt according to the given transaction hash

func (*Client) PendingCallContract

func (gc *Client) PendingCallContract(ctx context.Context, msg common.CallMsg) ([]byte, error)

PendingCallContract executes a message call transaction using the EVM. The state seen by the contract call is the pending state.

func (*Client) PendingCodeAt

func (gc *Client) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)

PendingCodeAt returns the contract code of the given account in the pending state.

func (*Client) SendTransaction

func (gc *Client) SendTransaction(ctx context.Context, tx *types.RawTransaction) error

SendTransaction injects a signed transaction into the pending pool for execution.

If the transaction was a contract creation use the TransactionReceipt method to get the contract address after the transaction has been mined.

func (*Client) SetGroupID

func (gc *Client) SetGroupID(newID uint)

SetGroupID sets the groupID of the client

func (*Client) SubscribeFilterLogs

func (gc *Client) SubscribeFilterLogs(ctx context.Context, q common.FilterQuery, ch chan<- types.Log) (common.Subscription, error)

SubscribeFilterLogs subscribes to the results of a streaming filter query.

func (*Client) TransactionReceipt

func (gc *Client) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)

TransactionReceipt returns the receipt of a transaction by transaction hash. Note that the receipt is not available for pending transactions.

Jump to

Keyboard shortcuts

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