-
Notifications
You must be signed in to change notification settings - Fork 231
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 RPC support for secure connections and HTTP proxies #820
Merged
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: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
This is unfortunately a big commit. It primarily adds an optional binary application (behind the "cli" feature flag) that allows you to easily perform queries against a Tendermint endpoint via several protocols (http, https, ws, wss). It only contains support at present for Client queries, and SubscriptionClient queries (i.e. subscriptions) are planned for subsequent commits. Some of the bulk of this commit is due to the fact that we need to be able to parse queries (e.g. from tx_search), so I added a PEG-based parser for queries along with some tests. Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
This commit refactors the RPC interface, while trying to reduce the amount of downstream impact as far as possible, with the aim of allowing the user to specify a generic URL as input to the HTTP and WebSocket clients. This allows the client to infer whether or not to use a secure connection based on the supplied URL. Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
…ring testing Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
… when a client is enabled Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
Signed-off-by: Thane Thomson <[email protected]>
romac
reviewed
Mar 17, 2021
romac
approved these changes
Mar 24, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💯
Note: tested and working on our end for an HTTP CONNECT egress proxy. Thank you! 🎉 |
thanethomson
added a commit
that referenced
this pull request
Mar 30, 2021
* Refactor to add HTTPS client Signed-off-by: Thane Thomson <[email protected]> * Switch to Rustls Signed-off-by: Thane Thomson <[email protected]> * Add TLS support for WebSocket connections Signed-off-by: Thane Thomson <[email protected]> * Add support for secure WebSocket connections Signed-off-by: Thane Thomson <[email protected]> * Update docs and exports Signed-off-by: Thane Thomson <[email protected]> * Update docs to use new link format Signed-off-by: Thane Thomson <[email protected]> * Remove unused file Signed-off-by: Thane Thomson <[email protected]> * Add required attributes to WebSocket client markers Signed-off-by: Thane Thomson <[email protected]> * Refactor out constructor common bits Signed-off-by: Thane Thomson <[email protected]> * Add tendermint-rpc binary This is unfortunately a big commit. It primarily adds an optional binary application (behind the "cli" feature flag) that allows you to easily perform queries against a Tendermint endpoint via several protocols (http, https, ws, wss). It only contains support at present for Client queries, and SubscriptionClient queries (i.e. subscriptions) are planned for subsequent commits. Some of the bulk of this commit is due to the fact that we need to be able to parse queries (e.g. from tx_search), so I added a PEG-based parser for queries along with some tests. Signed-off-by: Thane Thomson <[email protected]> * Add support for subscription to RPC CLI Signed-off-by: Thane Thomson <[email protected]> * Add support for parsing floating point numbers in RPC queries Signed-off-by: Thane Thomson <[email protected]> * Add termination option for subscriptions in CLI app Signed-off-by: Thane Thomson <[email protected]> * Update docs to describe CLI tool Signed-off-by: Thane Thomson <[email protected]> * Refactor RPC to allow for generic URLs This commit refactors the RPC interface, while trying to reduce the amount of downstream impact as far as possible, with the aim of allowing the user to specify a generic URL as input to the HTTP and WebSocket clients. This allows the client to infer whether or not to use a secure connection based on the supplied URL. Signed-off-by: Thane Thomson <[email protected]> * Fix version requirement of tendermint-proto Signed-off-by: Thane Thomson <[email protected]> * Update client usage to show simplified parameters Signed-off-by: Thane Thomson <[email protected]> * Use tracing instead of log to show comprehensive debug information during testing Signed-off-by: Thane Thomson <[email protected]> * Update docs Signed-off-by: Thane Thomson <[email protected]> * Add query parsing examples to crate docs Signed-off-by: Thane Thomson <[email protected]> * Rename ambiguous module url to rpc_url and ensure it is only exported when a client is enabled Signed-off-by: Thane Thomson <[email protected]> * Improve environment variable handling for proxies Signed-off-by: Thane Thomson <[email protected]> * Add examples for using proxy to CLI usage docs Signed-off-by: Thane Thomson <[email protected]> * Fix some README typos Signed-off-by: Thane Thomson <[email protected]> * Export HTTP and WebSocket URL types to surface documentation Signed-off-by: Thane Thomson <[email protected]> * Add CHANGELOG entries Signed-off-by: Thane Thomson <[email protected]> * Clarify directory for tendermint-rpc CLI Signed-off-by: Thane Thomson <[email protected]> * Add HTTP/2 support for HTTP client Signed-off-by: Thane Thomson <[email protected]>
5 tasks
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.
Closes #819
This PR is quite a large one unfortunately, because there's no easy way to test proxied connections or secure connections (or proxied secure connections 😁). I therefore had to:
tendermint-rpc
, which provides a simple interface for interacting with RPC clients overhttp://
,https://
,ws://
andwss://
, as well as HTTP proxies, for testing purposes. This necessitated the development of a parser for subscription queries, because I wanted to test subscriptions from the command line too.The documentation for the CLI is available here:
📖 Rendered tendermint-rpc CLI README