Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add RPC support for secure connections and HTTP proxies (#820)
* Refactor to add HTTPS client Signed-off-by: Thane Thomson <connect@thanethomson.com> * Switch to Rustls Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add TLS support for WebSocket connections Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add support for secure WebSocket connections Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update docs and exports Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update docs to use new link format Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove unused file Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add required attributes to WebSocket client markers Signed-off-by: Thane Thomson <connect@thanethomson.com> * Refactor out constructor common bits Signed-off-by: Thane Thomson <connect@thanethomson.com> * 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 <connect@thanethomson.com> * Add support for subscription to RPC CLI Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add support for parsing floating point numbers in RPC queries Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add termination option for subscriptions in CLI app Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update docs to describe CLI tool Signed-off-by: Thane Thomson <connect@thanethomson.com> * 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 <connect@thanethomson.com> * Fix version requirement of tendermint-proto Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update client usage to show simplified parameters Signed-off-by: Thane Thomson <connect@thanethomson.com> * Use tracing instead of log to show comprehensive debug information during testing Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update docs Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add query parsing examples to crate docs Signed-off-by: Thane Thomson <connect@thanethomson.com> * Rename ambiguous module url to rpc_url and ensure it is only exported when a client is enabled Signed-off-by: Thane Thomson <connect@thanethomson.com> * Improve environment variable handling for proxies Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add examples for using proxy to CLI usage docs Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix some README typos Signed-off-by: Thane Thomson <connect@thanethomson.com> * Export HTTP and WebSocket URL types to surface documentation Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add CHANGELOG entries Signed-off-by: Thane Thomson <connect@thanethomson.com> * Clarify directory for tendermint-rpc CLI Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add HTTP/2 support for HTTP client Signed-off-by: Thane Thomson <connect@thanethomson.com>
- Loading branch information