Documentation ¶
Index ¶
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 Insecure bool }
RPCOptions specifies the network and security settings for establishing a websocket connection to a hdfd JSON-RPC server.
type Syncer ¶
type Syncer struct {
// contains filtered or unexported fields
}
Syncer implements wallet synchronization services by processing notifications from a hdfd JSON-RPC server.
func NewSyncer ¶
func NewSyncer(w *wallet.Wallet, r *RPCOptions) *Syncer
NewSyncer creates a Syncer that will sync the wallet using hdfd JSON-RPC.
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 hdfd 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.