|
| 1 | +# Installing ethrex |
| 2 | + |
| 3 | +Before [running the ethrex client](./running.md), you need to install it. |
| 4 | +We have multiple ways to install, depending on your needs. |
| 5 | + |
| 6 | +Pre-built binaries for Linux and macOS are available for each release. |
| 7 | +See [Installing from pre-built binaries](#installing-from-pre-built-binaries) for installation instructions. |
| 8 | + |
| 9 | +You can also [install through cargo install](#installing-through-cargo-install), or [build the client from source](#building-from-source). |
| 10 | + |
| 11 | +## Installing from pre-built binaries |
| 12 | + |
| 13 | +To install ethrex from pre-built binaries, first download the binaries for your platform from the [release page](https://github.com/lambdaclass/ethrex/releases). |
| 14 | +You can also download it from the command line using `curl` or `wget`: |
| 15 | + |
| 16 | +```sh |
| 17 | +# For Linux x86_64 |
| 18 | +curl -L https://github.com/lambdaclass/ethrex/releases/latest/download/ethrex-linux_x86_64 -o ethrex |
| 19 | +wget https://github.com/lambdaclass/ethrex/releases/latest/download/ethrex-linux_x86_64 -O ethrex |
| 20 | + |
| 21 | +# For Linux ARM |
| 22 | +curl -L https://github.com/lambdaclass/ethrex/releases/latest/download/ethrex-linux_aarch64 -o ethrex |
| 23 | +wget https://github.com/lambdaclass/ethrex/releases/latest/download/ethrex-linux_aarch64 -O ethrex |
| 24 | + |
| 25 | +# For MacOS |
| 26 | +curl -L https://github.com/lambdaclass/ethrex/releases/latest/download/ethrex-macos_aarch64 -o ethrex |
| 27 | +wget https://github.com/lambdaclass/ethrex/releases/latest/download/ethrex-macos_aarch64 -O ethrex |
| 28 | +``` |
| 29 | + |
| 30 | +And set the execution bit: |
| 31 | + |
| 32 | +```sh |
| 33 | +chmod +x ethrex |
| 34 | +``` |
| 35 | + |
| 36 | +After that, you can verify the program is working by running: |
| 37 | + |
| 38 | +```sh |
| 39 | +./ethrex --version |
| 40 | +``` |
| 41 | + |
| 42 | +This should output something like: |
| 43 | + |
| 44 | +```text |
| 45 | +ethrex ethrex/v0.1.0-HEAD-23191af/aarch64-apple-darwin/rustc-v1.87.0 |
| 46 | +``` |
| 47 | + |
| 48 | +> [!TIP] |
| 49 | +> For convenience, you can move the `ethrex` binary to a directory in your `PATH`, so you can run it from anywhere. |
| 50 | +
|
| 51 | +After installing the client, see ["Running the client"](./running.md) for instructions on how to use it to run L1 and/or L2 networks. |
| 52 | + |
| 53 | +## Installing through `cargo install` |
| 54 | + |
| 55 | +To install the client, [first install Rust](https://www.rust-lang.org/tools/install) and then run: |
| 56 | + |
| 57 | +```sh |
| 58 | +cargo install --locked ethrex \ |
| 59 | + --git https://github.com/lambdaclass/ethrex.git \ |
| 60 | + --tag v0.0.2-rc.1 \ |
| 61 | + --features dev |
| 62 | +``` |
| 63 | + |
| 64 | +This installs the `ethrex` binary. |
| 65 | +For more information on how it is built and installed, see [the cargo-install documentation](https://doc.rust-lang.org/cargo/commands/cargo-install.html). |
| 66 | + |
| 67 | +After that, you can verify the program is working by running: |
| 68 | + |
| 69 | +```sh |
| 70 | +ethrex --version |
| 71 | +``` |
| 72 | + |
| 73 | +This should output something like: |
| 74 | + |
| 75 | +```text |
| 76 | +ethrex ethrex/v0.1.0-HEAD-23191af/aarch64-apple-darwin/rustc-v1.87.0 |
| 77 | +``` |
| 78 | + |
| 79 | +After installing the client, see ["Running the client"](./running.md) for instructions on how to use it to run L1 and/or L2 networks. |
| 80 | + |
| 81 | +## Building from source |
| 82 | + |
| 83 | +This section assumes you already have [Rust's `cargo`](https://www.rust-lang.org/tools/install) and [`git`](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) installed. |
| 84 | + |
| 85 | +You can download the source code of a release from the [GitHub releases page](https://github.com/lambdaclass/ethrex/releases), or by cloning the repository at that version: |
| 86 | + |
| 87 | +```sh |
| 88 | +git clone --branch <LATEST_VERSION_HERE> --depth 1 https://github.com/lambdaclass/ethrex.git |
| 89 | +``` |
| 90 | + |
| 91 | +After that, you can run the following command inside the cloned repo to build the client: |
| 92 | + |
| 93 | +```sh |
| 94 | +cargo build --bin ethrex --release --features dev |
| 95 | +``` |
| 96 | + |
| 97 | +You can find the built binary inside `target/release` directory: |
| 98 | + |
| 99 | +```sh |
| 100 | +./target/release/ethrex --version |
| 101 | +``` |
| 102 | + |
| 103 | +This should output something like: |
| 104 | + |
| 105 | +```text |
| 106 | +ethrex ethrex/v0.1.0-HEAD-23191af/aarch64-apple-darwin/rustc-v1.87.0 |
| 107 | +``` |
| 108 | + |
| 109 | +> [!TIP] |
| 110 | +> For convenience, you can move the `ethrex` binary to a directory in your `PATH`, so you can run it from anywhere. |
| 111 | +
|
| 112 | +After installing the client, see ["Running the client"](./running.md) for instructions on how to use it to run L1 and/or L2 networks. |
0 commit comments