Documentation ¶
Index ¶
- func UseLogger(logger slog.Logger)
- type Callbacks
- type RPCOptions
- type Syncer
- func (s *Syncer) Blocks(ctx context.Context, blockHashes []*chainhash.Hash) ([]*wire.MsgBlock, error)
- func (s *Syncer) CFiltersV2(ctx context.Context, blockHashes []*chainhash.Hash) ([]filterProof, error)
- func (s *Syncer) Deployments(ctx context.Context) (map[string]dcrdtypes.AgendaInfo, error)
- func (s *Syncer) DisableDiscoverAccounts()
- func (s *Syncer) Done() <-chan struct{}
- func (s *Syncer) Err() error
- func (s *Syncer) ExistsLiveTickets(ctx context.Context, tickets []*chainhash.Hash) (bitset.Bytes, error)
- func (s *Syncer) GetConfirmationHeight(ctx context.Context, txHash *chainhash.Hash) (int32, error)
- func (s *Syncer) GetTxOut(ctx context.Context, txHash *chainhash.Hash, index uint32, tree int8, ...) (*dcrdtypes.GetTxOutResult, error)
- func (s *Syncer) LoadTxFilter(ctx context.Context, reload bool, addrs []stdaddr.Address, ...) error
- func (s *Syncer) PublishMixMessages(ctx context.Context, msgs ...mixing.Message) error
- func (s *Syncer) PublishTransactions(ctx context.Context, txs ...*wire.MsgTx) error
- func (s *Syncer) RPC() *dcrd.RPC
- func (s *Syncer) Rescan(ctx context.Context, blocks []chainhash.Hash, ...) error
- func (s *Syncer) Run(ctx context.Context) (err error)
- func (s *Syncer) SetCallbacks(cb *Callbacks)
- func (s *Syncer) StakeDifficulty(ctx context.Context) (dcrutil.Amount, error)
- func (s *Syncer) Synced(ctx context.Context) (bool, int32)
- func (s *Syncer) UsedAddresses(ctx context.Context, addrs []stdaddr.Address) (bitset.Bytes, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Callbacks ¶
type Callbacks struct { Synced func(synced bool) FetchMissingCFiltersStarted func() FetchMissingCFiltersProgress func(startCFiltersHeight, endCFiltersHeight int32) FetchMissingCFiltersFinished func() FetchHeadersStarted func() FetchHeadersProgress func(lastHeaderHeight int32, lastHeaderTime int64) FetchHeadersFinished func() DiscoverAddressesStarted func() DiscoverAddressesFinished func() RescanStarted func() RescanProgress func(rescannedThrough int32) RescanFinished func() }
Callbacks contains optional callback functions to notify events during the syncing process. All callbacks are called synchronously and block the syncer from continuing.
type RPCOptions ¶
type RPCOptions struct { Address string DefaultPort string User string Pass string Dial func(ctx context.Context, network, address string) (net.Conn, error) CA []byte ClientCert []byte ClientKey []byte Insecure bool }
RPCOptions specifies the network and security settings for establishing a websocket connection to a dcrd JSON-RPC server.
type Syncer ¶
type Syncer struct {
// contains filtered or unexported fields
}
Syncer implements wallet synchronization services by processing notifications from a dcrd JSON-RPC server.
func NewSyncer ¶
func NewSyncer(w *wallet.Wallet, r *RPCOptions) *Syncer
NewSyncer creates a Syncer that will sync the wallet using dcrd JSON-RPC.
func (*Syncer) Blocks ¶
func (s *Syncer) Blocks(ctx context.Context, blockHashes []*chainhash.Hash) ([]*wire.MsgBlock, error)
Blocks is part of the wallet.NetworkBackend interface.
func (*Syncer) CFiltersV2 ¶
func (s *Syncer) CFiltersV2(ctx context.Context, blockHashes []*chainhash.Hash) ([]filterProof, error)
CFiltersV2 is part of the wallet.NetworkBackend interface.
func (*Syncer) Deployments ¶
Deployments fulfills the DeploymentQuerier interface.
func (*Syncer) DisableDiscoverAccounts ¶
func (s *Syncer) DisableDiscoverAccounts()
DisableDiscoverAccounts disables account discovery. This has an effect only if called before the main Run() executes the account discovery process.
func (*Syncer) ExistsLiveTickets ¶
func (s *Syncer) ExistsLiveTickets(ctx context.Context, tickets []*chainhash.Hash) (bitset.Bytes, error)
ExistsLiveTickets fulfills the LiveTicketQuerier interface.
func (*Syncer) GetConfirmationHeight ¶
GetConfirmationHeight fulfills the LiveTicketQuerier interface.
func (*Syncer) GetTxOut ¶
func (s *Syncer) GetTxOut(ctx context.Context, txHash *chainhash.Hash, index uint32, tree int8, includeMempool bool) (*dcrdtypes.GetTxOutResult, error)
GetTxOut fulfills the LiveTicketQuerier interface.
func (*Syncer) LoadTxFilter ¶
func (s *Syncer) LoadTxFilter(ctx context.Context, reload bool, addrs []stdaddr.Address, outpoints []wire.OutPoint) error
LoadTxFilter is part of the wallet.NetworkBackend interface.
func (*Syncer) PublishMixMessages ¶
PublishMixMessages submits each mixing message to the dcrd mixpool for acceptance. If accepted, the messages are published to other peers.
func (*Syncer) PublishTransactions ¶
PublishTransactions is part of the wallet.NetworkBackend interface.
func (*Syncer) Rescan ¶
func (s *Syncer) Rescan(ctx context.Context, blocks []chainhash.Hash, save func(block *chainhash.Hash, txs []*wire.MsgTx) error) error
Rescan is part of the wallet.NetworkBackend interface.
func (*Syncer) Run ¶
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.
func (*Syncer) SetCallbacks ¶
SetCallbacks sets the possible various callbacks that are used to notify interested parties to the syncing progress.
func (*Syncer) StakeDifficulty ¶
StakeDifficulty is part of the wallet.NetworkBackend interface.