Documentation ¶
Overview ¶
Package client provides a client for the FISCO BCOS RPC API.
Index ¶
- type Client
- func (gc *Client) CallContract(ctx context.Context, msg common.CallMsg, blockNumber *big.Int) ([]byte, error)
- func (gc *Client) Close()
- func (gc *Client) CodeAt(ctx context.Context, account common.Address, blockNumber *big.Int) ([]byte, error)
- func (gc *Client) FilterLogs(ctx context.Context, q common.FilterQuery) ([]types.Log, error)
- func (gc *Client) GetBlockByHash(ctx context.Context, bhash string, includetx bool) ([]byte, error)
- func (gc *Client) GetBlockByNumber(ctx context.Context, bnum string, includetx bool) ([]byte, error)
- func (gc *Client) GetBlockHashByNumber(ctx context.Context, bnum string) ([]byte, error)
- func (gc *Client) GetBlockLimit(ctx context.Context) (*big.Int, error)
- func (gc *Client) GetBlockNumber(ctx context.Context) ([]byte, error)
- func (gc *Client) GetChainID(ctx context.Context) (*big.Int, error)
- func (gc *Client) GetClientVersion(ctx context.Context) ([]byte, error)
- func (gc *Client) GetCode(ctx context.Context, addr string) ([]byte, error)
- func (gc *Client) GetConsensusStatus(ctx context.Context) ([]byte, error)
- func (gc *Client) GetContractAddress(ctx context.Context, txhash string) (common.Address, error)
- func (gc *Client) GetGroupID() *big.Int
- func (gc *Client) GetGroupList(ctx context.Context) ([]byte, error)
- func (gc *Client) GetGroupPeers(ctx context.Context) ([]byte, error)
- func (gc *Client) GetNodeIDList(ctx context.Context) ([]byte, error)
- func (gc *Client) GetObserverList(ctx context.Context) ([]byte, error)
- func (gc *Client) GetPBFTView(ctx context.Context) ([]byte, error)
- func (gc *Client) GetPeers(ctx context.Context) ([]byte, error)
- func (gc *Client) GetPendingTransactions(ctx context.Context) ([]byte, error)
- func (gc *Client) GetPendingTxSize(ctx context.Context) ([]byte, error)
- func (gc *Client) GetSealerList(ctx context.Context) ([]byte, error)
- func (gc *Client) GetSyncStatus(ctx context.Context) ([]byte, error)
- func (gc *Client) GetSystemConfigByKey(ctx context.Context, findkey string) ([]byte, error)
- func (gc *Client) GetTotalTransactionCount(ctx context.Context) ([]byte, error)
- func (gc *Client) GetTransactionByBlockHashAndIndex(ctx context.Context, bhash string, txindex string) ([]byte, error)
- func (gc *Client) GetTransactionByBlockNumberAndIndex(ctx context.Context, bnum string, txindex string) ([]byte, error)
- func (gc *Client) GetTransactionByHash(ctx context.Context, txhash string) ([]byte, error)
- func (gc *Client) GetTransactionReceipt(ctx context.Context, txhash string) (*types.Receipt, error)
- func (gc *Client) PendingCallContract(ctx context.Context, msg common.CallMsg) ([]byte, error)
- func (gc *Client) PendingCodeAt(ctx context.Context, account common.Address) ([]byte, error)
- func (gc *Client) SendTransaction(ctx context.Context, tx *types.RawTransaction) error
- func (gc *Client) SetGroupID(newID uint)
- func (gc *Client) SubscribeFilterLogs(ctx context.Context, q common.FilterQuery, ch chan<- types.Log) (common.Subscription, error)
- func (gc *Client) TransactionReceipt(ctx context.Context, txHash common.Hash) (*types.Receipt, error)
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 DialContext ¶
DialContext pass the context to the 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) 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 ¶
FilterLogs executes a filter query.
func (*Client) GetBlockByHash ¶
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 ¶
GetBlockHashByNumber returns the block hash according to the given block number
func (*Client) GetBlockLimit ¶
GetBlockLimit returns the blocklimit for current blocknumber
func (*Client) GetBlockNumber ¶
GetBlockNumber returns the latest block height(hex format) on a given groupID.
func (*Client) GetChainID ¶
GetChainID returns the Chain ID of the FISCO BCOS running on the nodes.
func (*Client) GetClientVersion ¶
GetClientVersion returns the version of FISCO BCOS running on the nodes.
func (*Client) GetConsensusStatus ¶
GetConsensusStatus returns the status information about the consensus algorithm on a specific groupID
func (*Client) GetContractAddress ¶
GetContractAddress returns a contract address according to the transaction hash
func (*Client) GetGroupID ¶
GetGroupID returns the groupID of the client
func (*Client) GetGroupList ¶
GetGroupList returns the groupID list that the node belongs to
func (*Client) GetGroupPeers ¶
GetGroupPeers returns the nodes and the overser nodes list on a specific group
func (*Client) GetNodeIDList ¶
GetNodeIDList returns the ID information of the connected peers and itself
func (*Client) GetObserverList ¶
GetObserverList returns the list of observer nodes' ID according to the groupID
func (*Client) GetPBFTView ¶
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) GetPendingTransactions ¶
GetPendingTransactions returns information of the pending transactions
func (*Client) GetPendingTxSize ¶
GetPendingTxSize returns amount of the pending transactions
func (*Client) GetSealerList ¶
GetSealerList returns the list of consensus nodes' ID according to the groupID
func (*Client) GetSyncStatus ¶
GetSyncStatus returns the synchronization status of the group
func (*Client) GetSystemConfigByKey ¶
GetSystemConfigByKey returns value according to the key(only tx_count_limit, tx_gas_limit could work)
func (*Client) GetTotalTransactionCount ¶
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 ¶
GetTransactionByHash returns the transaction information according to the given transaction hash
func (*Client) GetTransactionReceipt ¶
GetTransactionReceipt returns the transaction receipt according to the given transaction hash
func (*Client) PendingCallContract ¶
PendingCallContract executes a message call transaction using the EVM. The state seen by the contract call is the pending state.
func (*Client) PendingCodeAt ¶
PendingCodeAt returns the contract code of the given account in the pending state.
func (*Client) SendTransaction ¶
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 ¶
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.