Documentation
¶
Index ¶
- Variables
- func ActivationCursor(tip int64, n chains.Network) int64
- func ConfigureNetworks(s *Store, networks map[string]chains.Network, ...)
- func ConsumerHandler(s *Store, consumers map[string]string) (http.Handler, error)
- func Database(s *Store) *sql.DB
- func RunWithSource(ctx context.Context, s *Store, n chains.Network, ...)
- func SetTransactionHandler(s *Store, h http.Handler)
- type ScanProgress
- type Store
- func (s *Store) Ack(ctx context.Context, consumer string, id int64) error
- func (s *Store) Close() error
- func (s *Store) Draining(n string) bool
- func (s *Store) Height(ctx context.Context, network string) (int64, error)
- func (s *Store) LastFailedHeight(ctx context.Context, network string) (int64, error)
- func (s *Store) PendingNetwork(ctx context.Context, consumer, network string, wait time.Duration) (*feed.Delivery, error)
- func (s *Store) Pump(ctx context.Context, n chains.Network, source chains.Source) (bool, error)
- func (s *Store) Reconcile(ctx context.Context, consumer string, watches []feed.Watch) (feed.Reconciliation, error)
- func (s *Store) RecordScanHead(ctx context.Context, network string, target int64, at time.Time)
- func (s *Store) Run(ctx context.Context, n chains.Network)
- func (s *Store) ScanProgress(ctx context.Context) ([]ScanProgress, error)
- func (s *Store) SeedCursor(ctx context.Context, network string, height int64) error
- func (s *Store) Step(ctx context.Context, n chains.Network, source chains.Source) (bool, error)
- func (s *Store) Subscribe(ctx context.Context, consumer string, watches []feed.Watch) (feed.SubscriptionReceipt, error)
- func (s *Store) Watching(network string) bool
- func (s *Store) WhileWatched(ctx context.Context, network string, run func(context.Context))
Constants ¶
This section is empty.
Variables ¶
var ErrNetworkNotConfigured = errors.New("network has no configured node")
Functions ¶
func ActivationCursor ¶
The normal start is the next observed block. An explicit lookback opts in to a bounded historical window on activation for clients doing recovery.
func ConfigureNetworks ¶
func ConsumerHandler ¶
func RunWithSource ¶
func SetTransactionHandler ¶
Types ¶
type ScanProgress ¶
type ScanProgress struct {
Network string `json:"network"`
Status string `json:"status"`
Target *int64 `json:"target_height"`
Cursor *int64 `json:"cursor_height"`
LagMS *int64 `json:"lag_ms"`
// ScanSuccessCount counts committed scan ranges in the current watch period.
ScanSuccessCount uint64 `json:"scan_success_count"`
// ScanFailureCount counts terminal range failures after provider failover.
ScanFailureCount uint64 `json:"scan_failure_count"`
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) Draining ¶
Draining reports whether only retiring subscriptions keep the worker active.
func (*Store) LastFailedHeight ¶
LastFailedHeight bounds repairs when regular providers cannot report a head.
func (*Store) PendingNetwork ¶
func (*Store) Pump ¶
Pump fills free provider lanes while earlier reads remain in flight. Run it serially inside WhileWatched with one pool owned by that watch period.
func (*Store) Reconcile ¶
func (s *Store) Reconcile(ctx context.Context, consumer string, watches []feed.Watch) (feed.Reconciliation, error)
Reconcile commits each network independently. A failed or slow boundary lookup cannot prevent other networks from closing their old coverage intervals.
func (*Store) RecordScanHead ¶
RecordScanHead consumes an observation already made by the active scanner.
func (*Store) ScanProgress ¶
func (s *Store) ScanProgress(ctx context.Context) ([]ScanProgress, error)
func (*Store) SeedCursor ¶
SeedCursor imports a last processed height only on the first start.
func (*Store) Step ¶
Step reserves confirmed work and atomically queues deliveries as each read completes.