NethermindEth / nethermind

A robust execution client for Ethereum node operators.
https://nethermind.io/nethermind-client
GNU General Public License v3.0
1.28k stars 449 forks source link

Implement admin_exportChain for admin rpc #7813

Open obasekiosa opened 4 days ago

obasekiosa commented 4 days ago

Is your feature request related to a problem? Please describe. https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-admin#admin-exportchain

Allows for the exportation of a range of blocks.

arnavchhokra commented 4 days ago

Can I tackle this one?

obasekiosa commented 3 days ago

@arnavchhokra feel free to give it a shot.

ask questions within this thread

arnavchhokra commented 2 days ago

Question: for exporting chain data I am supposed to provide the first and the last block, so for fetching it can i use this: https://docs.nethermind.io/interacting/json-rpc-ns/eth#eth_getblockbynumber ?

arnavchhokra commented 2 days ago

The relevant function: public ResultWrapper<BlockForRpc> eth_getBlockByNumber(BlockParameter blockParameter, bool returnFullTransactionObjects) { return GetBlock(blockParameter, returnFullTransactionObjects); }

MarekM25 commented 1 day ago

@obasekiosa Could you elaborate why we need this change?

arnavchhokra commented 1 day ago

@obasekiosa Could you elaborate why we need this change?

Is there some other fn that i am supposed to use to fetch the blocks?

I read the export chain documentation, it says "Exports the current blockchain into a local file. It optionally takes a first and last block number, in which case it exports only that range of blocks ."