rpcclient

package
v0.10.0-alpha7 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2021 License: ISC Imports: 9 Imported by: 19

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

func NewRPCClient(rpcAddress string) (*RPCClient, error)

NewRPCClient creates a new RPC client

func (*RPCClient) AddPeer

func (c *RPCClient) AddPeer(address string, isPermanent bool) error

AddPeer sends an RPC request respective to the function's name and returns the RPC server's response

func (*RPCClient) Address

func (c *RPCClient) Address() string

Address returns the address the RPC client connected to

func (*RPCClient) Close

func (c *RPCClient) Close() error

Close closes the RPC client

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

func (c *RPCClient) Reconnect() error

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) SetLogger

func (c *RPCClient) SetLogger(backend *logger.Backend, level logger.Level)

SetLogger uses a specified Logger to output package logging info

func (*RPCClient) SetTimeout

func (c *RPCClient) SetTimeout(timeout time.Duration)

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

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

func (c *RPCClient) UnregisterPruningPointUTXOSetNotifications() error

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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