Page MenuHomePhabricator

[Chronik] Add `/blocks/:start_height/:end_height` HTTP endpoint
ClosedPublic

Authored by tobias_ruck on Apr 29 2023, 21:07.

Details

Summary

Allows querying a long range of blocks by start and end height (inclusive).

The limit of 500 may seem high, but this is a very cheap call with no extra calls to the DB, so this is fine.

Depends on D13829.

Test Plan

ninja && ./test/functional/test_runner.py chronik_blocks

Diff Detail

Event Timeline

Fabien requested changes to this revision.May 1 2023, 10:30
Fabien added inline comments.
test/functional/chronik_blocks.py
15
52

Please also add:

assert_equal(chronik.blocks(0, 0).ok(), pb.Blocks(blocks=[genesis_info]))

To check for >= vs > issues

This revision now requires changes to proceed.May 1 2023, 10:30

Rename test class, add some missing cases

This revision is now accepted and ready to land.May 1 2023, 15:42
This revision was landed with ongoing or failed builds.May 1 2023, 15:52
This revision was automatically updated to reflect the committed changes.