Documentation ¶
Index ¶
- Variables
- type RPCClient
- func (c *RPCClient) AddPeer(address string, isPermanent bool) error
- func (c *RPCClient) Address() string
- func (c *RPCClient) Close() error
- func (c *RPCClient) GetBlock(hash string, includeTransactionVerboseData bool) (*appmessage.GetBlockResponseMessage, error)
- func (c *RPCClient) GetBlockCount() (*appmessage.GetBlockCountResponseMessage, error)
- func (c *RPCClient) GetBlockDAGInfo() (*appmessage.GetBlockDAGInfoResponseMessage, error)
- func (c *RPCClient) GetBlockTemplate(miningAddress string) (*appmessage.GetBlockTemplateResponseMessage, error)
- func (c *RPCClient) GetBlocks(lowHash string, includeBlocks bool, includeTransactionVerboseData bool) (*appmessage.GetBlocksResponseMessage, error)
- func (c *RPCClient) GetConnectedPeerInfo() (*appmessage.GetConnectedPeerInfoResponseMessage, error)
- func (c *RPCClient) GetHeaders(startHash string, limit uint64, isAscending bool) (*appmessage.GetHeadersResponseMessage, error)
- func (c *RPCClient) GetMempoolEntries() (*appmessage.GetMempoolEntriesResponseMessage, error)
- func (c *RPCClient) GetMempoolEntry(txID string) (*appmessage.GetMempoolEntryResponseMessage, error)
- func (c *RPCClient) GetPeerAddresses() (*appmessage.GetPeerAddressesResponseMessage, error)
- func (c *RPCClient) GetSelectedTipHash() (*appmessage.GetSelectedTipHashResponseMessage, error)
- func (c *RPCClient) GetSubnetwork(subnetworkID string) (*appmessage.GetSubnetworkResponseMessage, error)
- func (c *RPCClient) GetUTXOsByAddresses(addresses []string) (*appmessage.GetUTXOsByAddressesResponseMessage, error)
- func (c *RPCClient) GetVirtualSelectedParentBlueScore() (*appmessage.GetVirtualSelectedParentBlueScoreResponseMessage, error)
- func (c *RPCClient) GetVirtualSelectedParentChainFromBlock(startHash string) (*appmessage.GetVirtualSelectedParentChainFromBlockResponseMessage, error)
- func (c *RPCClient) Reconnect() error
- func (c *RPCClient) RegisterForBlockAddedNotifications(onBlockAdded func(notification *appmessage.BlockAddedNotificationMessage)) error
- func (c *RPCClient) RegisterForFinalityConflictsNotifications(...) error
- func (c *RPCClient) RegisterForUTXOsChangedNotifications(addresses []string, ...) error
- func (c *RPCClient) RegisterForVirtualSelectedParentBlueScoreChangedNotifications(onVirtualSelectedParentBlueScoreChanged func(...)) error
- func (c *RPCClient) RegisterForVirtualSelectedParentChainChangedNotifications(...) error
- func (c *RPCClient) RegisterPruningPointUTXOSetNotifications(onPruningPointUTXOSetNotifications func()) error
- func (c *RPCClient) ResolveFinalityConflict(finalityBlockHash string) (*appmessage.ResolveFinalityConflictResponseMessage, error)
- func (c *RPCClient) SetLogger(backend *logger.Backend, level logger.Level)
- func (c *RPCClient) SetTimeout(timeout time.Duration)
- func (c *RPCClient) SubmitBlock(block *externalapi.DomainBlock) (appmessage.RejectReason, error)
- func (c *RPCClient) SubmitTransaction(transaction *appmessage.RPCTransaction) (*appmessage.SubmitTransactionResponseMessage, error)
- func (c *RPCClient) UnregisterPruningPointUTXOSetNotifications() error
Constants ¶
This section is empty.
Variables ¶
var ErrRPC = errors.New("rpc error")
ErrRPC is an error in the RPC protocol
Functions ¶
This section is empty.
Types ¶
type RPCClient ¶
type RPCClient struct { *grpcclient.GRPCClient // contains filtered or unexported fields }
RPCClient is an RPC client
func NewRPCClient ¶
NewRPCClient creates a new RPC client
func (*RPCClient) AddPeer ¶
AddPeer sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetBlock ¶
func (c *RPCClient) GetBlock(hash string, includeTransactionVerboseData bool) ( *appmessage.GetBlockResponseMessage, error)
GetBlock sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetBlockCount ¶
func (c *RPCClient) GetBlockCount() (*appmessage.GetBlockCountResponseMessage, error)
GetBlockCount sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetBlockDAGInfo ¶
func (c *RPCClient) GetBlockDAGInfo() (*appmessage.GetBlockDAGInfoResponseMessage, error)
GetBlockDAGInfo sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetBlockTemplate ¶
func (c *RPCClient) GetBlockTemplate(miningAddress string) (*appmessage.GetBlockTemplateResponseMessage, error)
GetBlockTemplate sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetBlocks ¶
func (c *RPCClient) GetBlocks(lowHash string, includeBlocks bool, includeTransactionVerboseData bool) (*appmessage.GetBlocksResponseMessage, error)
GetBlocks sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetConnectedPeerInfo ¶
func (c *RPCClient) GetConnectedPeerInfo() (*appmessage.GetConnectedPeerInfoResponseMessage, error)
GetConnectedPeerInfo sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetHeaders ¶
func (c *RPCClient) GetHeaders(startHash string, limit uint64, isAscending bool) (*appmessage.GetHeadersResponseMessage, error)
GetHeaders sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetMempoolEntries ¶
func (c *RPCClient) GetMempoolEntries() (*appmessage.GetMempoolEntriesResponseMessage, error)
GetMempoolEntries sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetMempoolEntry ¶
func (c *RPCClient) GetMempoolEntry(txID string) (*appmessage.GetMempoolEntryResponseMessage, error)
GetMempoolEntry sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetPeerAddresses ¶
func (c *RPCClient) GetPeerAddresses() (*appmessage.GetPeerAddressesResponseMessage, error)
GetPeerAddresses sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetSelectedTipHash ¶
func (c *RPCClient) GetSelectedTipHash() (*appmessage.GetSelectedTipHashResponseMessage, error)
GetSelectedTipHash sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetSubnetwork ¶
func (c *RPCClient) GetSubnetwork(subnetworkID string) (*appmessage.GetSubnetworkResponseMessage, error)
GetSubnetwork sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetUTXOsByAddresses ¶
func (c *RPCClient) GetUTXOsByAddresses(addresses []string) (*appmessage.GetUTXOsByAddressesResponseMessage, error)
GetUTXOsByAddresses sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetVirtualSelectedParentBlueScore ¶
func (c *RPCClient) GetVirtualSelectedParentBlueScore() (*appmessage.GetVirtualSelectedParentBlueScoreResponseMessage, error)
GetVirtualSelectedParentBlueScore sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetVirtualSelectedParentChainFromBlock ¶
func (c *RPCClient) GetVirtualSelectedParentChainFromBlock(startHash string) (*appmessage.GetVirtualSelectedParentChainFromBlockResponseMessage, error)
GetVirtualSelectedParentChainFromBlock sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) Reconnect ¶ added in v0.10.0
Reconnect forces the client to attempt to reconnect to the address this client initially was connected to
func (*RPCClient) RegisterForBlockAddedNotifications ¶
func (c *RPCClient) RegisterForBlockAddedNotifications(onBlockAdded func(notification *appmessage.BlockAddedNotificationMessage)) error
RegisterForBlockAddedNotifications sends an RPC request respective to the function's name and returns the RPC server's response. Additionally, it starts listening for the appropriate notification using the given handler function
func (*RPCClient) RegisterForFinalityConflictsNotifications ¶
func (c *RPCClient) RegisterForFinalityConflictsNotifications( onFinalityConflict func(notification *appmessage.FinalityConflictNotificationMessage), onFinalityConflictResolved func(notification *appmessage.FinalityConflictResolvedNotificationMessage)) error
RegisterForFinalityConflictsNotifications sends an RPC request respective to the function's name and returns the RPC server's response. Additionally, it starts listening for the appropriate notification using the given handler function
func (*RPCClient) RegisterForUTXOsChangedNotifications ¶
func (c *RPCClient) RegisterForUTXOsChangedNotifications(addresses []string, onUTXOsChanged func(notification *appmessage.UTXOsChangedNotificationMessage)) error
RegisterForUTXOsChangedNotifications sends an RPC request respective to the function's name and returns the RPC server's response. Additionally, it starts listening for the appropriate notification using the given handler function
func (*RPCClient) RegisterForVirtualSelectedParentBlueScoreChangedNotifications ¶
func (c *RPCClient) RegisterForVirtualSelectedParentBlueScoreChangedNotifications( onVirtualSelectedParentBlueScoreChanged func(notification *appmessage.VirtualSelectedParentBlueScoreChangedNotificationMessage)) error
RegisterForVirtualSelectedParentBlueScoreChangedNotifications sends an RPC request respective to the function's name and returns the RPC server's response. Additionally, it starts listening for the appropriate notification using the given handler function
func (*RPCClient) RegisterForVirtualSelectedParentChainChangedNotifications ¶
func (c *RPCClient) RegisterForVirtualSelectedParentChainChangedNotifications(onChainChanged func(notification *appmessage.VirtualSelectedParentChainChangedNotificationMessage)) error
RegisterForVirtualSelectedParentChainChangedNotifications sends an RPC request respective to the function's name and returns the RPC server's response. Additionally, it starts listening for the appropriate notification using the given handler function
func (*RPCClient) RegisterPruningPointUTXOSetNotifications ¶ added in v0.8.10
func (c *RPCClient) RegisterPruningPointUTXOSetNotifications(onPruningPointUTXOSetNotifications func()) error
RegisterPruningPointUTXOSetNotifications sends an RPC request respective to the function's name and returns the RPC server's response. Additionally, it starts listening for the appropriate notification using the given handler function
func (*RPCClient) ResolveFinalityConflict ¶
func (c *RPCClient) ResolveFinalityConflict(finalityBlockHash string) (*appmessage.ResolveFinalityConflictResponseMessage, error)
ResolveFinalityConflict sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) SetTimeout ¶
SetTimeout sets the timeout by which to wait for RPC responses
func (*RPCClient) SubmitBlock ¶
func (c *RPCClient) SubmitBlock(block *externalapi.DomainBlock) (appmessage.RejectReason, error)
SubmitBlock sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) SubmitTransaction ¶
func (c *RPCClient) SubmitTransaction(transaction *appmessage.RPCTransaction) (*appmessage.SubmitTransactionResponseMessage, error)
SubmitTransaction sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) UnregisterPruningPointUTXOSetNotifications ¶ added in v0.8.10
UnregisterPruningPointUTXOSetNotifications sends an RPC request respective to the function's name and returns the RPC server's response. Additionally, it stops listening for the appropriate notification using the given handler function
Source Files ¶
- log.go
- rpc_connect_to_peer.go
- rpc_get_block.go
- rpc_get_block_count.go
- rpc_get_block_dag_info.go
- rpc_get_block_template.go
- rpc_get_blocks.go
- rpc_get_chain_from_block.go
- rpc_get_connected_peer_info.go
- rpc_get_headers.go
- rpc_get_mempool_entries.go
- rpc_get_mempool_entry.go
- rpc_get_peer_addresses.go
- rpc_get_selected_tip_hash.go
- rpc_get_subnetwork.go
- rpc_get_utxos_by_addresses.go
- rpc_get_virtual_selected_parent_blue_score.go
- rpc_on_block_added.go
- rpc_on_chain_changed.go
- rpc_on_finality_conflicts.go
- rpc_on_pruning_point_utxo_set_override.go
- rpc_on_utxos_changed.go
- rpc_on_virtual_selected_parent_blue_score_changed.go
- rpc_resolve_finality_conflict.go
- rpc_send_raw_transaction.go
- rpc_submit_block.go
- rpcclient.go
- rpcrouter.go