-
Notifications
You must be signed in to change notification settings - Fork 258
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
Add standalone support for RPC Spec V2 chainHead
#762
Closed
Closed
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
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
Signed-off-by: Alexandru Vasile <alexandru.vasile@parity.io>
This looks great, and gives us a lot to think about! Some slightly out of order thoughts I have offhand:
So, I guess I'd propose the following:
And later, we can either:
What do you think? |
Given the above I'll close this, but I'm sure that this work will be very useful to refer to as we do get to building this API out :) |
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.
This PR adds standalone support for the RPC V2
chainHead
family of functions into subxt.The API is extending the
chainHead_follow
subscription via a custom high level wrapper for better ergonomics.All the
chainHead
subscriptions and methods are parsed internally to return concrete object types.The new API constructed on top of the block's API is exercised in the
chainhead_subscription
example.To keep future compatibility with #760, the subscription events are moved into the new file
rpc/types.rs
.The work of this PR was started on the https://github.com/paritytech/subxt/tree/lexnv/rpc_spec_v2_poc branch.
API Example
Integration Notes
Metadata and the runtime version of the node can be obtained using the
chainHead
API, although it is not user friendly, nor ergonomic:Considering that metadata and runtime version must be available when creating the subxt client, the complete integration with
chainHead
makes an extensive overhead in terms of complexity and code to maintain.This could in part be mitigated by the
archive
family of functions, which would achieve the same result without needing to create a subscription.The current API allows users to query at arbitrary blocks (body / header / storage), this will make difficult the integration with the
chainHead
API without modifying subxt. Although, subxt as it is could rely on thearchive
methods instead to not alter the current API.Part of #732.