Documentation ¶
Index ¶
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 ¶
type BlockDisconnected struct {
BlockHeader []byte
}
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) 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) 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 RelevantTxAccepted ¶
type RelevantTxAccepted struct {
Transaction []byte
}
RelevantTxAccepted is a notification that a transaction accepted by mempool passed the client's transaction filter.
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 StakeDifficulty ¶
StakeDifficulty is a notification for the current stake difficulty.