Skip to content

Commit

Permalink
docs: update README.md and book ethers versions (#2403)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes committed May 6, 2023
1 parent 84dda78 commit 0d113bc
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 32 deletions.
31 changes: 15 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Add this to your Cargo.toml:

```toml
[dependencies]
ethers = "1.0.2"
ethers = "2.0"
```

And this to your code:
Expand Down Expand Up @@ -45,7 +45,7 @@ address that, you must use the `legacy` feature flag:

```toml
[dependencies]
ethers = { version = "1.0.2", features = ["legacy"] }
ethers = { version = "2.0", features = ["legacy"] }
```

### Polygon support
Expand All @@ -64,7 +64,7 @@ You can get one [here](https://snowtrace.io/apis).

```toml
[dependencies]
ethers = { version = "1.0.2", features = ["celo"] }
ethers = { version = "2.0", features = ["celo"] }
```

Celo's transactions differ from Ethereum transactions by including 3 new fields:
Expand Down Expand Up @@ -101,7 +101,7 @@ Websockets support is turned on via the feature-flag `ws`:

```toml
[dependencies]
ethers = { version = "1.0.2", features = ["ws"] }
ethers = { version = "2.0", features = ["ws"] }
```

### Interprocess Communication (IPC)
Expand All @@ -110,7 +110,7 @@ IPC support is turned on via the feature-flag `ipc`:

```toml
[dependencies]
ethers = { version = "1.0.2", features = ["ipc"] }
ethers = { version = "2.0", features = ["ipc"] }
```

### HTTP Secure (HTTPS)
Expand All @@ -122,30 +122,29 @@ To enable `rustls`:

```toml
[dependencies]
ethers = { version = "1.0.2", features = ["rustls"] }
ethers = { version = "2.0", features = ["rustls"] }
```

To enable `openssl`:

```toml
[dependencies]
ethers = { version = "1.0.2", features = ["openssl"] }
ethers = { version = "2.0", 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/wasm) for reference). If ethers fails to
compile in WASM, please
[open an issue](https://github.com/gakonst/ethers-rs/issues/new/choose).
You should be able to build a wasm app that uses ethers-rs (see the [example](./examples/wasm) for reference).
If ethers fails to compile in WASM, please [open an issue][issue].
There is currently no plan to provide an official JS/TS-accessible library
interface. We believe [viem](https://viem.sh) or [ethers.js](https://docs.ethers.io/v6/) serves that need
very well.
interface, as we believe [viem](https://viem.sh) or [ethers.js](https://docs.ethers.io/v6/)
serve that need very well.

Similarly, you should be able to build FFI bindings to ethers-rs. If ethers
fails to compile in c lib formats, please
[open an issue](https://github.com/gakonst/ethers-rs/issues/new/choose).
There is currently no plan to provide official FFI bindings, and as ethers-rs is
not yet stable 1.0.0, its interface may change significantly between versions.
fails to compile in C library formats, please [open an issue][issue].
There is currently no plan to provide official FFI bindings.

[issue]: https://github.com/gakonst/ethers-rs/issues/new/choose

## Getting Help

Expand Down
26 changes: 12 additions & 14 deletions book/getting-started/start_a_new_project.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,11 @@ To set up a new project with ethers-rs, you will need to install the Rust progra

```toml
[dependencies]
ethers = "1.0.0"

# Most of ethers-rs features rely upon an async Rust runtime.
# Since Rust doesn't provide an async runtime itself, you can
# include the excellent tokio library
tokio = { version = "1.23.0", features = ["macros"] }
ethers = "2.0"
# Ethers' async features rely upon the Tokio async runtime.
tokio = { version = "1", features = ["macros"] }
# Flexible concrete Error Reporting type built on std::error::Error with customizable Reports
eyre = "0.6.8"
eyre = "0.6"
```

If you want to make experiments and/or play around with early ethers-rs features link our GitHub repo in the `Cargo.toml`.
Expand All @@ -37,7 +34,7 @@ To set up a new project with ethers-rs, you will need to install the Rust progra

# You can specify a tag or commit hash with the "rev" attribute
[dependencies]
ethers = { git = "https://github.com/gakonst/ethers-rs", rev = "1.0.2" }
ethers = { git = "https://github.com/gakonst/ethers-rs", rev = "84dda78" }
```

> **Note:** using a Git repository as a dependency is generally not recommended
Expand All @@ -51,22 +48,23 @@ To set up a new project with ethers-rs, you will need to install the Rust progra
Ethers-rs enables interactions with Ethereum nodes through different "transport" types, or communication protocols.
The following transport types are currently supported by ethers.rs:

- **HTTP(S):** The HTTP(S) transport is used to communicate with Ethereum nodes over the HTTP or HTTPS protocols. This is the most common way to interact with Ethereum nodes. If you are looking to connect to a HTTPS endpoint, then you need to enable the `rustls` or `openssl` features:
- **HTTP(S):** The HTTP(S) transport is used to communicate with Ethereum nodes over the HTTP or HTTPS protocols. This is the most common way to interact with Ethereum nodes. If you are looking to connect to a HTTPS endpoint, then you need to enable the `rustls` or `openssl` features:

```toml
[dependencies]
ethers = { version = "1.0.0", features = ["rustls"] }
ethers = { version = "2.0", features = ["rustls"] }
```

- **WebSocket:** The WebSocket transport is used to communicate with Ethereum nodes over the WebSocket protocol, which is a widely-supported standard for establishing a bi-directional communication channel between a client and a server. This can be used for a variety of purposes, including receiving real-time updates from an Ethereum node, or submitting transactions to the Ethereum network. Websockets support is turned on via the feature-flag ws:
- **WebSocket:** The WebSocket transport is used to communicate with Ethereum nodes over the WebSocket protocol, which is a widely-supported standard for establishing a bi-directional communication channel between a client and a server. This can be used for a variety of purposes, including receiving real-time updates from an Ethereum node, or submitting transactions to the Ethereum network. Websockets support is turned on via the feature-flag ws:

```toml
[dependencies]
ethers = { version = "1.0.0", features = ["ws"] }
ethers = { version = "2.0", features = ["ws"] }
```

- **IPC (Interprocess Communication):** The IPC transport is used to communicate with a local Ethereum node using the IPC protocol, which is a way for processes to communicate with each other on a single computer. This is commonly used in Ethereum development to allow applications to communicate with a local Ethereum node, such as geth or parity. IPC support is turned on via the feature-flag `ipc`:
- **IPC (Interprocess Communication):** The IPC transport is used to communicate with a local Ethereum node using the IPC protocol, which is a way for processes to communicate with each other on a single computer. This is commonly used in Ethereum development to allow applications to communicate with a local Ethereum node, such as geth or parity. IPC support is turned on via the feature-flag `ipc`:

```toml
[dependencies]
ethers = { version = "1.0.0", features = ["ipc"] }
ethers = { version = "2.0", features = ["ipc"] }
```
4 changes: 2 additions & 2 deletions ethers-providers/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Please ensure that you have the `ws` feature enabled if you wish to use WebSocke

```toml
[dependencies]
ethers-providers = { version = "1.0.2", features = ["ws"] }
ethers-providers = { version = "2.0", features = ["ws"] }
```

## Interprocess Communication (IPC)
Expand All @@ -25,7 +25,7 @@ Please ensure that you have the `ipc` feature enabled if you wish to use IPC:

```toml
[dependencies]
ethers-providers = { version = "1.0.2", features = ["ipc"] }
ethers-providers = { version = "2.0", features = ["ipc"] }
```

## Ethereum Name Service
Expand Down

0 comments on commit 0d113bc

Please sign in to comment.