From cf2aa07eb5ff6fd0f460476354578056e4b0c042 Mon Sep 17 00:00:00 2001 From: Dave Belvedere <90095005+dbelv@users.noreply.github.com> Date: Sun, 24 Jul 2022 11:20:06 +1000 Subject: [PATCH] =?UTF-8?q?Update=20README=20to=20document=20common=20feat?= =?UTF-8?q?ure=20flags=20for=20providers=20(websock=E2=80=A6=20(#1493)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update README to document common feature flags for providers (websockets, ipc and https) * Update README as per review comment suggestion Co-authored-by: Matthias Seitz * Separate openssl and rustls toml examples as per review comment Co-authored-by: Matthias Seitz --- README.md | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/README.md b/README.md index 5e76b95a..5a8232a5 100644 --- a/README.md +++ b/README.md @@ -100,6 +100,45 @@ in the transactions which are fetched over JSON-RPC. - [ ] FFI Bindings (see note) - [ ] CLI for common operations +### Websockets + +Websockets support is turned on via the feature-flag `ws`: + +```toml +[dependencies] + +ethers = { git = "https://github.com/gakonst/ethers-rs", features = ["ws"] } +``` + +### Interprocess Communication (IPC) + +IPC support is turned on via the feature-flag `ipc`: + +```toml +[dependencies] + +ethers = { git = "https://github.com/gakonst/ethers-rs", features = ["ipc"] } +``` + +### HTTP Secure (HTTPS) + +If you are looking to connect to a HTTPS endpoint, then you need to enable the `rustls` or `openssl` feature. +feature-flags. + +To enable `rustls`: +```toml +[dependencies] + +ethers = { git = "https://github.com/gakonst/ethers-rs", features = ["rustls"] } +``` + +To enable `openssl`: +```toml +[dependencies] + +ethers = { git = "https://github.com/gakonst/ethers-rs", features = ["openssl"] } +``` + ## Note on WASM and FFI bindings You should be able to build a wasm app that uses ethers-rs (see the [example](./examples/ethers-wasm) for reference). If ethers fails to