theQRL / QRL

Quantum Resistant Ledger
https://theqrl.org/
MIT License
417 stars 109 forks source link

Downloading a single raw QRL block. #1779

Closed harieamjari closed 10 months ago

harieamjari commented 10 months ago

Hi. I see that the QRL blockchain and the metadata of each block can be viewed in explorer.theqrl.org website. Is there other way to download a single raw block than running a whole node? (Just for analysis for a valid implementation of a QRL block.)

(This is not an issue but more of a question. I wanted to post this in the Discussion since it's more suitably but it isn't available/enabled.)

jplomas commented 10 months ago

The explorer also exports the data via a rudimentary API: eg. https://explorer.theqrl.org/api/block/2891168

There are a number of projects that iterate through the chain and export blocks for various purposes (MySQL/Mongo storage, for example) but I'm not aware of any other public services that directly export a raw block.

harieamjari commented 10 months ago

Hi. Thank you for your reply. I'm looking for a raw binary block as described in https://docs.theqrl.org/api/qrlproto/#block if its possible.

jplomas commented 10 months ago

You can use GRPC to interact with a public node:

https://github.com/theQRL/QRL/blob/7600ec054edecc22f0b86b76b8e00f11a161486a/src/qrl/protos/qrl.proto#L718

The docs-beta site has some examples.

harieamjari commented 10 months ago

Thanks, I manage to interact with the mainnet with grpcurl but recieved a json response. Haven't manage to get grpcurl working with binary so I'm resorting to manually crafting the blocks from the hex since i need only a one or two. Thankfully, "data" can easily be replaced with uint8_t https://explorer.theqrl.org/api/block/2891168