Documentation
¶
Overview ¶
Package sync provides a sync engine that maps chain events to local store CRUD operations. The engine does not run background goroutines — callers invoke HandleEvent for each event received from the pubsub bus.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BackoffDelay ¶
BackoffDelay returns the reconnection delay for the given attempt per SPEC §6.5. Uses exponential backoff with jitter: 1s, 2s, 4s, 8s, 16s, 32s, 60s cap.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
Engine processes chain events and persists them to the local store.
func (*Engine) HandleEvent ¶
HandleEvent processes a single chain event via type-switch. Events for owners not in the tracked set are silently ignored. Unknown event types are also ignored (no error).
type Querier ¶
type Querier interface {
CurrentHeight(ctx context.Context) (int64, error)
Deployments(ctx context.Context, owner string) ([]*store.DeploymentRecord, error)
Leases(ctx context.Context, owner string, dseq uint64) ([]*store.LeaseRecord, error)
Bids(ctx context.Context, owner string, dseq uint64) ([]*store.BidRecord, error)
}
Querier abstracts the chain queries needed for reconciliation. Implementations typically wrap the chain-sdk query clients.