Update README to document common feature flags for providers (websock… (#1493)

* 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 <matthias.seitz@outlook.de>

* Separate openssl and rustls toml examples as per review comment

Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
This commit is contained in:
Dave Belvedere 2022-07-24 11:20:06 +10:00 committed by GitHub
parent 12292dd920
commit cf2aa07eb5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 39 additions and 0 deletions

View File

@ -100,6 +100,45 @@ in the transactions which are fetched over JSON-RPC.
- [ ] FFI Bindings (see note) - [ ] FFI Bindings (see note)
- [ ] CLI for common operations - [ ] 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 ## 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 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