-
Notifications
You must be signed in to change notification settings - Fork 1
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 block_headers
and blocks
streams full APIs (w/ checkpoint and reorg handling)
#10
Merged
oleonardolima
merged 18 commits into
main
from
feature/add-block-height-checkpoint-feature
Aug 11, 2022
Merged
feature: add block_headers
and blocks
streams full APIs (w/ checkpoint and reorg handling)
#10
oleonardolima
merged 18 commits into
main
from
feature/add-block-height-checkpoint-feature
Aug 11, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
oleonardolima
force-pushed
the
feature/add-block-height-checkpoint-feature
branch
from
July 1, 2022 02:25
0ef1850
to
c6492e0
Compare
LLFourn
reviewed
Jul 6, 2022
oleonardolima
changed the title
feature: add block height checkpoint feature
feature: add block height checkpoint feature, and add reorganization handling
Jul 6, 2022
oleonardolima
changed the base branch from
feature/add-unit-and-integration-tests-to-block-events
to
main
July 7, 2022 00:06
oleonardolima
force-pushed
the
feature/add-block-height-checkpoint-feature
branch
from
July 7, 2022 00:16
14af46c
to
2ad93bc
Compare
This was referenced Jul 7, 2022
22 tasks
- use TryStream instead of stream, returning result instead - use `?` operator instead of unwraping and panicking - add new mempool.space endpoints for http client - add features for wss:// and https:// usage - add features for api versioning based on mempool.space backend
oleonardolima
force-pushed
the
feature/add-block-height-checkpoint-feature
branch
from
July 26, 2022 13:15
4b05122
to
2b9e908
Compare
…e error handling - refactor and update http client, url usage and methods - refactor and add creation methods for cache struct, use specific method to build initial one - add `get_block_header` method in http client, and refactor lib to use `bitcoin::BlockHeader` instead of custom mempool.space `BlockExtended` struct - refactor lib and websocket to improve error handling, update some `unwrap()` usage and match errors for messages in `WebSocketStream` - remove duplicated/unused deps, and use only necessary features
oleonardolima
force-pushed
the
feature/add-block-height-checkpoint-feature
branch
from
August 9, 2022 19:54
af3a572
to
fa4775f
Compare
oleonardolima
changed the title
feature: add block height checkpoint feature, and add reorganization handling
feature: add Aug 9, 2022
block_headers
and blocks
streams APIs, block_height
and checkpoint feature, and add reorganization handling
oleonardolima
changed the title
feature: add
feature: add Aug 9, 2022
block_headers
and blocks
streams APIs, block_height
and checkpoint feature, and add reorganization handlingblock_headers
and blocks
streams APIs, checkpoint feature, and add reorganization handling
- bump mempool/backend docker container version to v2.4.1 - update api+websocket client to handle genesis blocks without prev_blockhash - update and fix integration tests to new fns and structure
oleonardolima
force-pushed
the
feature/add-block-height-checkpoint-feature
branch
from
August 11, 2022 16:33
7bd795f
to
c52c1b4
Compare
oleonardolima
changed the title
feature: add
feature: add Aug 11, 2022
block_headers
and blocks
streams APIs, checkpoint feature, and add reorganization handlingblock_headers
and blocks
streams full APIs (w/ checkpoint and reorg handling)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR focus on solving the issues:
This PR refactors the project on top of the other two PRs:
It adds two main features (critical for the project):
(height: u32, hash: bitcoin::BlockHash)
, it fetches and emits all the blocks starting from the checkpoint (inclusive) up to the current tip and listens to all new blocks events from the WebSocket client.BlockEvent::Connected() and BlockEvent::Disconnected()
as it now handles block reorganization, it currently emits a disconnected event for all found stale blocks during reorganization, and a new connected event for the now active branch up to the tip.This PR also adds documentation for the functions, structures, and enums and updates README examples and doc.rs examples.
Notes to the reviewers
If you would like to check out the other implementations before current updates and reactors, please check out PRs #3 and #8. I'm planning to close and squash them into this one to ease the reviews.
Checklists
All Submissions:
cargo fmt
andcargo clippy
before committingNew Features:
CHANGELOG.md