krnx_ namespace with a
frozen contract: result and error shapes do not change without a version bump.
Build indexers against it, not against the pending views.
Ask what is queryable
Callkrnx_getWorkshareCapabilities
first. It always answers, even when the explorer API is disabled, and it tells
you:
- whether the API is enabled,
- the canonical history anchors, including
history.firstAvailableBlock, - the frozen limits,
- the parent-chain mappings for BCH, LTC, RVN and ZEC.
KRNX_EXPLORER_RPC_DISABLED.
Page through workshares
krnx_getWorkshares takes exactly one object:
Both filters, when supplied, are intersected against the frozen
parent/algorithm tuples — a contradictory intersection is an error, not an
empty page.
fromBlock cannot precede history.firstAvailableBlock, and a
numeric toBlock must exist and cannot exceed the canonical head.
Snapshots and reorgs
On the first request the node resolveslatest once, records the resolved
number and hash, materializes defaults, normalizes the filters, and returns the
whole normalized query back to you as snapshot.
Send that snapshot back with the cursor on every subsequent page. The node
re-checks the anchor, so a reorg under your feet surfaces as an error instead of
a silently inconsistent result set. Restart paging from the new head when that
happens.
What not to index
Index the durable view only. A node also keeps in-memory views of work it has not yet bound to a canonical block; those are process-local diagnostics, two nodes will disagree about them, and nothing in them is authenticated as history.Block-level data
For a block-at-a-time view rather than a share-at-a-time one, pairkrnx_getBlockReward, which returns every recipient
and amount for one block, with
krnx_getAuxPowStatus.
