|
1 |
| -## Base Reth Node |
| 1 | + |
2 | 2 |
|
| 3 | +# Base Reth Node |
| 4 | + |
| 5 | +Base Reth Node is an implementation of a Reth Ethereum node, specifically tailored for the Base L2 network. It integrates Flashblocks capabilities and leverages Optimism components from Reth `v1.3.12`. This node is designed to provide a robust and efficient solution for interacting with the Base network. |
| 6 | + |
| 7 | +<!-- Badge row 1 - status --> |
| 8 | + |
| 9 | +[](https://github.com/base/node-reth/graphs/contributors) |
| 10 | +[](https://github.com/base/node-reth/graphs/contributors) |
| 11 | +[](https://github.com/base/node-reth/stargazers) |
| 12 | + |
| 13 | +[](https://github.com/base/node-reth/blob/master/LICENSE) |
| 14 | + |
| 15 | +<!-- Badge row 2 - links and profiles --> |
| 16 | + |
| 17 | +[](https://base.org) |
| 18 | +[](https://base.mirror.xyz/) |
| 19 | +[](https://docs.base.org/) |
| 20 | +[](https://base.org/discord) |
| 21 | +[](https://twitter.com/Base) |
| 22 | + |
| 23 | +<!-- Badge row 3 - detailed status --> |
| 24 | + |
| 25 | +[](https://github.com/base/node-reth/pulls) |
| 26 | +[](https://github.com/base/node-reth/issues) |
| 27 | + |
| 28 | +## Features |
| 29 | + |
| 30 | +- **Base L2 Support:** Optimized for the Base Layer 2 network. |
| 31 | +- **Flashblocks RPC:** Includes a `flashblocks-rpc` crate for Flashblocks. |
| 32 | +- **Reth Based:** Built upon Reth `v1.3.12`, incorporating its Optimism features. |
| 33 | +- **Dockerized:** Comes with a `Dockerfile` for easy containerization and deployment. |
| 34 | +- **Development Toolkit:** Includes a `justfile` for streamlined build, test, and linting workflows. |
| 35 | + |
| 36 | +## Repository Structure |
| 37 | + |
| 38 | +``` |
| 39 | +. |
| 40 | +├── Cargo.toml # Rust workspace and package definitions |
| 41 | +├── Cargo.lock # Dependency lockfile |
| 42 | +├── Dockerfile # For building the Docker image |
| 43 | +├── LICENSE # MIT License |
| 44 | +├── README.md # This file |
| 45 | +├── crates/ |
| 46 | +│ ├── node/ # Main node application logic |
| 47 | +│ └── flashblocks-rpc/ # RPC server for Flashblocks integration |
| 48 | +├── justfile # Command runner for development tasks |
| 49 | +└── .github/ |
| 50 | + └── workflows/ |
| 51 | + └── ci.yml # GitHub Actions CI configuration |
| 52 | +``` |
| 53 | + |
| 54 | +## Prerequisites |
| 55 | + |
| 56 | +- **Rust:** Version 1.85 or later (as specified in `Cargo.toml`). You can install Rust using [rustup](https://rustup.rs/). |
| 57 | +- **Just:** A command runner. Installation instructions can be found [here](https://github.com/casey/just#installation). |
| 58 | +- **Docker:** (Optional) For building and running the node in a container. See [Docker installation guide](https://docs.docker.com/get-docker/). |
| 59 | +- **Build Essentials:** `git`, `libclang-dev`, `pkg-config`, `curl`, `build-essential` (these are installed in the Docker build process and may be needed for local builds on some systems). |
| 60 | + |
| 61 | +## Getting Started |
| 62 | + |
| 63 | +### 1. Clone the Repository |
| 64 | + |
| 65 | +```bash |
| 66 | +git clone https://github.com/base/node-reth.git |
| 67 | +cd node-reth |
| 68 | +``` |
| 69 | + |
| 70 | +### 2. Build |
| 71 | + |
| 72 | +You can build the project using the `justfile` for a release build: |
| 73 | + |
| 74 | +```bash |
| 75 | +just build |
| 76 | +``` |
| 77 | + |
| 78 | +Alternatively, you can use Cargo directly: |
| 79 | + |
| 80 | +```bash |
| 81 | +cargo build --release --bin base-reth-node |
| 82 | +``` |
| 83 | + |
| 84 | +The main binary will be located at `target/release/base-reth-node`. |
| 85 | + |
| 86 | +### 3. Run Checks and Tests |
| 87 | + |
| 88 | +To ensure everything is set up correctly, run the checks and tests: |
| 89 | + |
| 90 | +```bash |
| 91 | +just check # Runs cargo fmt --check and cargo clippy |
| 92 | +just test # Runs cargo test |
| 93 | +``` |
| 94 | + |
| 95 | +To automatically fix formatting and clippy warnings: |
| 96 | + |
| 97 | +```bash |
| 98 | +just fix |
| 99 | +``` |
| 100 | + |
| 101 | +## Running the Node |
| 102 | + |
| 103 | +To run the compiled node: |
| 104 | + |
| 105 | +```bash |
| 106 | +./target/release/base-reth-node [OPTIONS] |
| 107 | +``` |
| 108 | + |
| 109 | +To see available command-line options and subcommands, run: |
| 110 | + |
| 111 | +```bash |
| 112 | +./target/release/base-reth-node --help |
| 113 | +``` |
| 114 | + |
| 115 | +_(Note: Replace `[OPTIONS]` with the necessary configuration flags for your setup. Refer to the `--help` output for details.)_ |
| 116 | + |
| 117 | +## Docker |
| 118 | + |
| 119 | +### 1. Build the Docker Image |
| 120 | + |
| 121 | +```bash |
| 122 | +docker build -t base-reth-node . |
| 123 | +``` |
| 124 | + |
| 125 | +### 2. Run the Docker Container |
| 126 | + |
| 127 | +```bash |
| 128 | +docker run -it --rm base-reth-node [OPTIONS] |
| 129 | +``` |
| 130 | + |
| 131 | +_(Note: You might need to map ports (`-p`), mount volumes (`-v`) for data persistence, or pass environment variables (`-e`) depending on your node's configuration needs.)_ |
| 132 | + |
| 133 | +## Configuration |
| 134 | + |
| 135 | +_(Details about specific configuration files, environment variables, or command-line arguments required for typical operation will be added here as the project evolves. For now, please refer to the `--help` output of the binary.)_ |
| 136 | + |
| 137 | +## License |
| 138 | + |
| 139 | +This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details. |
0 commit comments