Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

fetch serialised blocks over api

See original GitHub issue

It would be useful if there could be an implementation for the /blocks/ endpoint to fetch full blocks in serialised form over the public API. At the moment it seems the only way to get a full block is by requesting the block header from /blocks/{height|id} and then another request to /blocks/{height|id}/transactions to fetch the transactions, which may span multiple pages to retrieve all transactions in a single block. Being able to fetch full serialised blocks would be more efficient in cases where full blocks, including their transactions, are needed in an application and this would use less bandwidth as the response would be in hex rather than a verbose JSON object.

The public API uses gzip if requested in a HTTP header to conserve bandwidth but this is computationally expensive to compress when making multiple HTTP requests, as is the case to fetch full blocks including transactions, whereas serialised data is readily available to theoretically serve with no overhead.

This would be useful for situations and applications where it is not possible to connect via a websocket to issue a call to p2p.peer.getBlocks. Especially as, by definition, this should only be used by peers and not general purpose applications.

It would be useful if this could be implemented in 2.6 rather than waiting for 3.0. If you do not have the resources to do this yourself, i.e. everyone is working on 3.0, I could submit a PR to do so if you would be willing to add this feature to 2.6.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

alessiodfcommented, May 25, 2020

Thanks, it was kind of what I expected. I’ll look into submitting a PR against develop when I’m more familiar with the 3.0 code base if that’s ok.

ghostcommented, Jun 30, 2020

This issue has been closed. If you wish to re-open it please provide additional information.

Read more comments on GitHub >

github_iconTop Results From Across the Web

prevent property from being serialized in web API
Now I need to prevent some properties to be serialized. I know I can use some LINQ over the list and get only...
Read more >
Block Detected in Web API while writing output #25 - GitHub
I have a pretty standard dotnet Web API which returns JSON. All standard framework stuff. I am getting this in my logs everytime...
Read more >
Serialization | Blockly - Google Developers
Serialization is saving the state of your workspace so that it can be loaded back into the workspace later. This includes serializing the ......
Read more >
wordpress/api-fetch | Block Editor Handbook
Utility to make WordPress REST API requests. It's a wrapper around window.fetch. Installation Install the module [code lang=bash] npm…
Read more >
Serialization – REST API – Usage - Plone 6 Documentation
Throughout the REST API, content needs to be serialized and deserialized to and from JSON representations.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Post

No results found

github_iconTop Related Hashnode Post

No results found