Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature / Add 'get_blocks_in_range' API method #3677

Open
wants to merge 1 commit into
base: 0.23.x
Choose a base branch
from

Conversation

steemchiller
Copy link

Description

This adds the new API method get_blocks_in_range to the block_api and condenser_api to enable requesting a specified range of blocks at once. The default query limit is set to 250 blocks, but it can be changed to a higher limit in the config.ini (for example, we can set it to 1000 with query-limit-get-blocks-in-range = 1000).

Result

If all blocks in the requested range exist, the request result is an array of blocks and the first element of the returned array contains the first block of the range, the second the next one and so on.

In case an invalid range was requested or a block inside the range does not exist, a corresponding error message will be returned.

Examples

block_api

curl -s --data '{"jsonrpc":"2.0", "method":"block_api.get_blocks_in_range", "params":{"from_num":60000001,"to_num":60000250}, "id":1}' http://127.0.0.1:8090 | python3 -m json.tool

condenser_api

curl -s --data '{"jsonrpc":"2.0", "method":"condenser_api.get_blocks_in_range", "params":[60000001,60000250], "id":1}' http://127.0.0.1:8090 | python3 -m json.tool

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant