Skip to content
This repository has been archived by the owner on Nov 15, 2023. It is now read-only.

RPC method for exposing extrinsics/transactions (by block) #562

Closed
emielsebastiaan opened this issue Aug 13, 2018 · 3 comments
Closed

RPC method for exposing extrinsics/transactions (by block) #562

emielsebastiaan opened this issue Aug 13, 2018 · 3 comments
Assignees
Labels
J0-enhancement An additional feature request.
Milestone

Comments

@emielsebastiaan
Copy link

I started building a Polkadot Explorer (or more generalized a Substrate Explorer). Check: w3f github for details. This is the first issue posted to request for some additional JSON-RPC methods.

I am currently able to fetch all blockheaders from chaintip back to genesis. This allows for a basic block entity in the Explorer. Next step is create the transaction (extrinsics) entity in the explorer. I'd like to have an additional method available for this. Goal of this request is to allow for the Block Explorer to harvest, index, enrich and aggregate all available Txs/Extrinsics which are included in the chain.

Allowing the txs/extrinsics to be fetched by block allows for some optimizations in the block explorer harvester in case of chain reorganizations and allows for minimized number of JSON-RPC calls.

Suggestions (open for discussion): Experience with building a EVM/Ethereum explorer allows me to make additional suggestions (to minimize) the number of RPC calls. Ideally the txs/extrinsics data should be callable by blocknumber and blockhash and return an array with basic tx/extrinsic data. Perhaps similar to the Ethereum JSON-RPC method "eth_getBlock" with the flag to include txs. And in addition perhaps a aditional methods such as: getExtrinsic(hash), getExtrinsicsByBlockNumber, getExtrinsicsByBlockHash or other more elegant solutions...

Let's discuss how to best implement this.

@tomusdrw
Copy link
Contributor

tomusdrw commented Aug 14, 2018

Hi @emielvanderhoek I've actually discussed that recently with @jacogr, will make a PR with a proposal shortly.

@tomusdrw
Copy link
Contributor

So the whole block querying is done in #564. I'll see into providing getExtrinsic(hash) method now.

@gavofyork gavofyork added J0-enhancement An additional feature request. M6-rpcapi labels Aug 15, 2018
@gavofyork gavofyork added this to the PoC-3 (AFG) milestone Aug 15, 2018
@gavofyork
Copy link
Member

Closing issue, since main RPC is implemented and I'm not convinced we want to build further indexing into core DB.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
J0-enhancement An additional feature request.
Projects
No open projects
SDK Node (deprecated)
  
Awaiting triage
Development

No branches or pull requests

3 participants