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

Blockchain rpcs #323

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Davidson-Souza
Copy link
Collaborator

Depends on #322

This is the first step towards a core-compatible(ish) json rpc. This should help other applications to integrate with florestad without requiring any additional work.

List of things achieved here:

  • Refactor node to have RPCs grouped per file (done for blockchain)
  • Rename RPCs to allign with core (done for blockchain)
  • Implement all RPCs that are trivial to (if it needs more work, they'll have their own PR)
  • Make sure all RPCs return the same thing as core v28

Things that we'll need to build next (not done here):

  • Non-trivial RPCs
  • A cross-test between floresta and core. Ideally, we would have a test that sends the same RPCs to core and florestad, checks if they return the same. We should have one that does that against different versions of core, and one that runs every week or something like this, testing our master and theirs.

Since we already use axum for the metrics crate, and the currently used
crate is unmaintained. This commit re-implements the json-rpc using axum.

Once nice side-effect is that if we ever want to use another encode
or websockets, axum already supports that.
If we do all rpcs inside `server.rs` it'll grow and become a huge file,
this commit creates a blockchain module where we define all
blockchain-related rpcs as defined by core[1] docs.

[1]: https://bitcoincore.org/en/doc/28.0.0/rpc
This commit implements some very basic rpcs from bitcoin core that can
be implmented without much changes inside floresta itself. Only blockchain
rpcs were implemented here.
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.

1 participant