Skip to content

Expose sync progress via an onSyncProgress callback #3206

@BigTava

Description

@BigTava

Problem

Consumers have no way to observe warp-sync progress.

Proposed API

A new optional callback on addChain:

export type SyncProgress =
  | { type: "warp-sync"; verified: number }
  | { type: "chain-sync"; current: number; target: number }
  | { type: "in-sync" };

chain = await client.addChain({
  chainSpec,
  onSyncProgress: (p: SyncProgress) => void,
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions