encointer / accounting-backend

Subquery backend for Encointer Network
0 stars 0 forks source link

index block numbers vs hashes #1

Open brenzi opened 7 months ago

brenzi commented 7 months ago

we currently have no way of querying the block hash of a specific block number. This, however, is necessary for certain historical queries using the cli with --at <HASH>

brenzi commented 7 months ago

we might workaround theis missing index by using the public subquery of novawallet. but it seems only extrinsics are indexed: https://explorer.subquery.network/subquery/nova-wallet/nova-wallet-encointer

{
  historyElements(first: 5) {
    nodes {
      blockNumber
      extrinsic
    }
  }
}
brenzi commented 7 months ago

hmm, our rpc supports this: image so we may not even need it and implement this rpc in cli directly

test:

polkadot-js-api rpc.chain.getBlockHash 5555 --ws wss://kusama.api.encointer.org:443