Documentation ¶
Index ¶
- Variables
- type RPCClient
- func (c *RPCClient) AddPeer(address string, isPermanent bool) error
- func (c *RPCClient) Address() string
- func (c *RPCClient) Ban(ip string) (*appmessage.BanResponseMessage, error)
- func (c *RPCClient) Close() error
- func (c *RPCClient) EstimateNetworkHashesPerSecond(startHash string, windowSize uint32) (*appmessage.EstimateNetworkHashesPerSecondResponseMessage, error)
- func (c *RPCClient) GetBalanceByAddress(address string) (*appmessage.GetBalanceByAddressResponseMessage, error)
- func (c *RPCClient) GetBalancesByAddresses(addresses []string) (*appmessage.GetBalancesByAddressesResponseMessage, error)
- func (c *RPCClient) GetBlock(hash string, includeTransactions bool) (*appmessage.GetBlockResponseMessage, error)
- func (c *RPCClient) GetBlockCount() (*appmessage.GetBlockCountResponseMessage, error)
- func (c *RPCClient) GetBlockDAGInfo() (*appmessage.GetBlockDAGInfoResponseMessage, error)
- func (c *RPCClient) GetBlockTemplate(miningAddress, extraData string) (*appmessage.GetBlockTemplateResponseMessage, error)
- func (c *RPCClient) GetBlocks(lowHash string, includeBlocks bool, includeTransactions bool) (*appmessage.GetBlocksResponseMessage, error)
- func (c *RPCClient) GetCoinSupply() (*appmessage.GetCoinSupplyResponseMessage, error)
- func (c *RPCClient) GetConnectedPeerInfo() (*appmessage.GetConnectedPeerInfoResponseMessage, error)
- func (c *RPCClient) GetHeaders(startHash string, limit uint64, isAscending bool) (*appmessage.GetHeadersResponseMessage, error)
- func (c *RPCClient) GetInfo() (*appmessage.GetInfoResponseMessage, error)
- func (c *RPCClient) GetMempoolEntries(includeOrphanPool bool, filterTransactionPool bool) (*appmessage.GetMempoolEntriesResponseMessage, error)
- func (c *RPCClient) GetMempoolEntriesByAddresses(addresses []string, includeOrphanPool bool, filterTransactionPool bool) (*appmessage.GetMempoolEntriesByAddressesResponseMessage, error)
- func (c *RPCClient) GetMempoolEntry(txID string, includeOrphanPool bool, filterTransactionPool bool) (*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, includeAcceptedTransactionIDs bool) (*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) RegisterForNewBlockTemplateNotifications(...) error
- func (c *RPCClient) RegisterForUTXOsChangedNotifications(addresses []string, ...) error
- func (c *RPCClient) RegisterForVirtualDaaScoreChangedNotifications(...) error
- func (c *RPCClient) RegisterForVirtualSelectedParentBlueScoreChangedNotifications(onVirtualSelectedParentBlueScoreChanged func(...)) error
- func (c *RPCClient) RegisterForVirtualSelectedParentChainChangedNotifications(includeAcceptedTransactionIDs bool, ...) 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) SubmitBlockAlsoIfNonDAA(block *externalapi.DomainBlock) (appmessage.RejectReason, error)
- func (c *RPCClient) SubmitTransaction(transaction *appmessage.RPCTransaction, allowOrphan bool) (*appmessage.SubmitTransactionResponseMessage, error)
- func (c *RPCClient) Unban(ip string) (*appmessage.UnbanResponseMessage, 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 сreates a new RPC client with a default call timeout value
func (*RPCClient) AddPeer ¶
AddPeer sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) Ban ¶
func (c *RPCClient) Ban(ip string) (*appmessage.BanResponseMessage, error)
Ban sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) EstimateNetworkHashesPerSecond ¶
func (c *RPCClient) EstimateNetworkHashesPerSecond(startHash string, windowSize uint32) (*appmessage.EstimateNetworkHashesPerSecondResponseMessage, error)
EstimateNetworkHashesPerSecond sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetBalanceByAddress ¶
func (c *RPCClient) GetBalanceByAddress(address string) (*appmessage.GetBalanceByAddressResponseMessage, error)
GetBalanceByAddress sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetBalancesByAddresses ¶
func (c *RPCClient) GetBalancesByAddresses(addresses []string) (*appmessage.GetBalancesByAddressesResponseMessage, error)
GetBalancesByAddresses 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, includeTransactions 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, extraData 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, includeTransactions bool) (*appmessage.GetBlocksResponseMessage, error)
GetBlocks sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetCoinSupply ¶
func (c *RPCClient) GetCoinSupply() (*appmessage.GetCoinSupplyResponseMessage, error)
GetCoinSupply 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) GetInfo ¶
func (c *RPCClient) GetInfo() (*appmessage.GetInfoResponseMessage, error)
GetInfo sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetMempoolEntries ¶
func (c *RPCClient) GetMempoolEntries(includeOrphanPool bool, filterTransactionPool bool) (*appmessage.GetMempoolEntriesResponseMessage, error)
GetMempoolEntries sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) GetMempoolEntriesByAddresses ¶
func (c *RPCClient) GetMempoolEntriesByAddresses(addresses []string, includeOrphanPool bool, filterTransactionPool bool) (*appmessage.GetMempoolEntriesByAddressesResponseMessage, error)
GetMempoolEntriesByAddresses 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, includeOrphanPool bool, filterTransactionPool bool) (*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, includeAcceptedTransactionIDs bool) ( *appmessage.GetVirtualSelectedParentChainFromBlockResponseMessage, error)
GetVirtualSelectedParentChainFromBlock sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) Reconnect ¶
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) RegisterForNewBlockTemplateNotifications ¶
func (c *RPCClient) RegisterForNewBlockTemplateNotifications(onNewBlockTemplate func(notification *appmessage.NewBlockTemplateNotificationMessage)) error
RegisterForNewBlockTemplateNotifications 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) RegisterForVirtualDaaScoreChangedNotifications ¶
func (c *RPCClient) RegisterForVirtualDaaScoreChangedNotifications( onVirtualDaaScoreChanged func(notification *appmessage.VirtualDaaScoreChangedNotificationMessage)) error
RegisterForVirtualDaaScoreChangedNotifications 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(includeAcceptedTransactionIDs bool, 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 ¶
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) SubmitBlockAlsoIfNonDAA ¶
func (c *RPCClient) SubmitBlockAlsoIfNonDAA(block *externalapi.DomainBlock) (appmessage.RejectReason, error)
SubmitBlockAlsoIfNonDAA operates the same as SubmitBlock with the exception that `allowNonDAABlocks` is set to true
func (*RPCClient) SubmitTransaction ¶
func (c *RPCClient) SubmitTransaction(transaction *appmessage.RPCTransaction, allowOrphan bool) (*appmessage.SubmitTransactionResponseMessage, error)
SubmitTransaction sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) Unban ¶
func (c *RPCClient) Unban(ip string) (*appmessage.UnbanResponseMessage, error)
Unban sends an RPC request respective to the function's name and returns the RPC server's response
func (*RPCClient) UnregisterPruningPointUTXOSetNotifications ¶
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_ban.go
- rpc_connect_to_peer.go
- rpc_estimate_network_hashes_per_second.go
- rpc_get_balance_by_address.go
- rpc_get_balances_by_addresses.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_coin_supply.go
- rpc_get_connected_peer_info.go
- rpc_get_headers.go
- rpc_get_info.go
- rpc_get_mempool_entries.go
- rpc_get_mempool_entries_by_address.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_new_block_template.go
- rpc_on_pruning_point_utxo_set_override.go
- rpc_on_utxos_changed.go
- rpc_on_virtual_daa_score_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
- rpc_unban.go
- rpcclient.go
- rpcrouter.go