Annouce Ledger Candid: your missing candid interface to the NNS ledger

I’ll expand a bit on the Bogdan’s answer:

The main ledger canister only stores 1-2K of blocks and everything else is sent to “ledger archive” canisters.
The client is supposed to

  1. Fetch the assignment of blocks to canisters.
  2. Route block fetch requests appropriately.

The issue is that the assignment of the most recent blocks might change while the step (2) is being executed. This interface is error prone and hard to use.

One part of the initiative to allow canisters transfer ICPs is to provide a stable, properly designed Candid interface for ledger. The first version of the interface will only contain transfer and account_balance methods, but we’re planning to extend it to expose all capabilities of ledger.

We’ll later add a block syncing interface that doesn’t use the error-prone communication pattern mentioned above. It will be a single method (something like fetch_blocks_since : (Height, Limit) -> (FetchBlocksResponse) query).
The result will contain

  1. The tip of the chain (with optional certification).
  2. Blocks in the specified range stored by the Ledger.
  3. If some blocks are archived, the result will contain a mapping from block ranges to functions that fetch them.

Unfortunately, I don’t have an ETA for the block fetching interface now.

5 Likes