Documentation ¶
Index ¶
- func DisableLog()
- func UseLogger(logger btclog.Logger)
- type BlockConnected
- type BlockDisconnected
- type ClientConnected
- type MissedTickets
- type RPCClient
- func (c *RPCClient) BlockStamp() (*waddrmgr.BlockStamp, error)
- func (c *RPCClient) GetReorganizing() (bool, chainhash.Hash)
- func (c *RPCClient) Notifications() <-chan interface{}
- func (c *RPCClient) NotificationsVoting() <-chan interface{}
- func (c *RPCClient) POSTClient() (*dcrrpcclient.Client, error)
- func (c *RPCClient) SetReorganizingState(is bool, hash chainhash.Hash)
- func (c *RPCClient) Start() error
- func (c *RPCClient) Stop()
- func (c *RPCClient) WaitForShutdown()
- type RelevantTx
- type Reorganization
- type RescanFinished
- type RescanProgress
- type StakeDifficulty
- type WinningTickets
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.
Types ¶
type BlockConnected ¶
BlockConnected is a notification for a newly-attached block to the best chain.
type BlockDisconnected ¶
BlockDisconnected is a notifcation that the block described by the BlockStamp was reorganized out of the best chain.
type ClientConnected ¶
type ClientConnected struct{}
ClientConnected is a notification for when a client connection is opened or reestablished to the chain server.
type MissedTickets ¶
MissedTickets is a notifcation for tickets that have been missed.
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, reconnectAttempts int) (*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 bitcoin network as described by the passed chain parameters, the connection will be disconnected.
func (*RPCClient) BlockStamp ¶
func (c *RPCClient) BlockStamp() (*waddrmgr.BlockStamp, error)
BlockStamp returns the latest block notified by the client, or an error if the client has been shut down.
func (*RPCClient) GetReorganizing ¶
GetReorganizing allows you to get the value of the flag for blockchain reorganization.
func (*RPCClient) Notifications ¶
func (c *RPCClient) Notifications() <-chan interface{}
Notifications returns a channel of parsed notifications sent by the remote decred RPC server. This channel must be continually read or the process may abort for running out memory, as unread notifications are queued for later reads.
func (*RPCClient) NotificationsVoting ¶
func (c *RPCClient) NotificationsVoting() <-chan interface{}
NotificationsVoting returns a channel of parsed voting notifications sent by the remote RPC server. This channel must be continually read or the process may abort for running out memory, as unread notifications are queued for later reads.
func (*RPCClient) POSTClient ¶
func (c *RPCClient) POSTClient() (*dcrrpcclient.Client, error)
POSTClient creates the equivalent HTTP POST dcrrpcclient.Client.
func (*RPCClient) SetReorganizingState ¶
SetReorganizingState allows you to set the flag for blockchain reorganization.
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 RelevantTx ¶
RelevantTx is a notification for a transaction which spends wallet inputs or pays to a watched address.
type Reorganization ¶
type Reorganization struct { OldHash *chainhash.Hash OldHeight int64 NewHash *chainhash.Hash NewHeight int64 }
Reorganization is a notification that a reorg has happen with the new old and new tip included.
type RescanFinished ¶
RescanFinished is a notification that a previous rescan request has finished.
type RescanProgress ¶
RescanProgress is a notification describing the current status of an in-progress rescan.
type StakeDifficulty ¶
StakeDifficulty is a notification for the current stake difficulty.