Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackendFromRPCClient ¶ added in v1.1.2
func BackendFromRPCClient(rpcClient *rpcclient.Client) wallet.NetworkBackend
BackendFromRPCClient creates a wallet network backend from an RPC client.
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.
func RPCClientFromBackend ¶ added in v1.1.2
func RPCClientFromBackend(n wallet.NetworkBackend) (*rpcclient.Client, error)
RPCClientFromBackend returns the RPC client used to create a wallet network backend. This errors if the backend was not created using BackendFromRPCClient.
Types ¶
type RPCClient ¶
type RPCClient struct { *dcrrpcclient.Client // contains filtered or unexported fields }
RPCClient represents a persistent client connection to a decred RPC server for information regarding the current best block chain.
func NewRPCClient ¶
func NewRPCClient(chainParams *chaincfg.Params, connect, user, pass string, certs []byte, disableTLS bool) (*RPCClient, error)
NewRPCClient creates a client connection to the server described by the connect string. If disableTLS is false, the remote RPC certificate must be provided in the certs slice. The connection is not established immediately, but must be done using the Start method. If the remote server does not operate on the same decred network as described by the passed chain parameters, the connection will be disconnected.
func (*RPCClient) POSTClient ¶
func (c *RPCClient) POSTClient() (*dcrrpcclient.Client, error)
POSTClient creates the equivalent HTTP POST dcrrpcclient.Client.
func (*RPCClient) Start ¶
Start attempts to establish a client connection with the remote server. If successful, handler goroutines are started to process notifications sent by the server. After a limited number of connection attempts, this function gives up, and therefore will not block forever waiting for the connection to be established to a server that may not exist.
func (*RPCClient) Stop ¶
func (c *RPCClient) Stop()
Stop disconnects the client and signals the shutdown of all goroutines started by Start.
func (*RPCClient) WaitForShutdown ¶
func (c *RPCClient) WaitForShutdown()
WaitForShutdown blocks until both the client has finished disconnecting and all handlers have exited.
type RPCSyncer ¶ added in v1.1.2
type RPCSyncer struct {
// contains filtered or unexported fields
}
RPCSyncer implements wallet synchronization services by processing notifications from a dcrd JSON-RPC server.
func NewRPCSyncer ¶ added in v1.1.2
NewRPCSyncer creates an RPCSyncer that will sync the wallet using the RPC client.
func (*RPCSyncer) Run ¶ added in v1.1.2
Run synchronizes the wallet, returning when synchronization fails or the context is cancelled. If startupSync is true, all synchronization tasks needed to fully register the wallet for notifications and synchronize it with the dcrd server are performed. Otherwise, it will listen for notifications but not register for any updates.