From 0d113bc4077af5057aacb98616025ea7d1b92c98 Mon Sep 17 00:00:00 2001 From: DaniPopes <57450786+DaniPopes@users.noreply.github.com> Date: Sat, 6 May 2023 04:36:35 +0200 Subject: [PATCH] docs: update README.md and book ethers versions (#2403) --- README.md | 31 ++++++++++----------- book/getting-started/start_a_new_project.md | 26 ++++++++--------- ethers-providers/README.md | 4 +-- 3 files changed, 29 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index 90f60f123..a4e2270bd 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Add this to your Cargo.toml: ```toml [dependencies] -ethers = "1.0.2" +ethers = "2.0" ``` And this to your code: @@ -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 @@ -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: @@ -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) @@ -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) @@ -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 diff --git a/book/getting-started/start_a_new_project.md b/book/getting-started/start_a_new_project.md index 9cf171819..83b15b0d1 100644 --- a/book/getting-started/start_a_new_project.md +++ b/book/getting-started/start_a_new_project.md @@ -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`. @@ -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 @@ -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"] } ``` diff --git a/ethers-providers/README.md b/ethers-providers/README.md index 557fb9bfc..70e5697cc 100644 --- a/ethers-providers/README.md +++ b/ethers-providers/README.md @@ -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) @@ -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