|
| 1 | +# Client Build Scripts |
| 2 | + |
| 3 | +This directory contains scripts to build client binaries for blockchain nodes. |
| 4 | + |
| 5 | +## Available Scripts |
| 6 | + |
| 7 | +### build-reth.sh |
| 8 | +Builds the reth binary from the Paradigm reth repository using Cargo. |
| 9 | + |
| 10 | +**Default Configuration:** |
| 11 | +- Repository: `https://github.com/paradigmxyz/reth/` |
| 12 | +- Version: `main` |
| 13 | +- Build tool: `cargo` |
| 14 | + |
| 15 | +### build-geth.sh |
| 16 | +Builds the op-geth binary from the Ethereum Optimism op-geth repository using just. |
| 17 | + |
| 18 | +**Default Configuration:** |
| 19 | +- Repository: `https://github.com/ethereum-optimism/op-geth/` |
| 20 | +- Version: `optimism` |
| 21 | +- Build tool: `go run build/ci.go install` |
| 22 | + |
| 23 | +### build-rbuilder.sh |
| 24 | +Builds the op-rbuilder binary from the op-rbuilder repository using Cargo. |
| 25 | + |
| 26 | +**Default Configuration:** |
| 27 | +- Repository: `https://github.com/haardikk21/op-rbuilder` |
| 28 | +- Version: `a8bb38693ece585e7fa98d52f51290e7dcececff` |
| 29 | +- Build tool: `cargo` |
| 30 | + |
| 31 | +## Usage |
| 32 | + |
| 33 | +### Using Makefile (Recommended) |
| 34 | + |
| 35 | +```bash |
| 36 | +# Build all binaries |
| 37 | +make build-binaries |
| 38 | + |
| 39 | +# Build only reth |
| 40 | +make build-reth |
| 41 | + |
| 42 | +# Build only geth |
| 43 | +make build-geth |
| 44 | + |
| 45 | +# Build only op-rbuilder |
| 46 | +make build-rbuilder |
| 47 | +``` |
| 48 | + |
| 49 | +### Direct Script Execution |
| 50 | + |
| 51 | +```bash |
| 52 | +# Build reth with defaults |
| 53 | +cd clients |
| 54 | +./build-reth.sh |
| 55 | + |
| 56 | +# Build geth with defaults |
| 57 | +./build-geth.sh |
| 58 | + |
| 59 | +# Build op-rbuilder with defaults |
| 60 | +./build-rbuilder.sh |
| 61 | +``` |
| 62 | + |
| 63 | +## Version Management |
| 64 | + |
| 65 | +All client versions are managed in the `versions.env` file. This file contains the default repository URLs and versions for all supported clients. The build scripts automatically source this file if it exists. |
| 66 | + |
| 67 | +### Customizing Repository and Version |
| 68 | + |
| 69 | +You can override the default repository and version in several ways: |
| 70 | + |
| 71 | +#### 1. Edit versions.env (Recommended) |
| 72 | +Modify the `versions.env` file to change defaults for all builds: |
| 73 | + |
| 74 | +```bash |
| 75 | +# Edit versions.env to update default versions |
| 76 | +RETH_VERSION="v0.2.0-beta.5" |
| 77 | +GETH_VERSION="v1.13.0" |
| 78 | +RBUILDER_VERSION="your-commit-hash" |
| 79 | +``` |
| 80 | + |
| 81 | +#### 2. Environment Variables |
| 82 | +Override specific builds with environment variables: |
| 83 | + |
| 84 | +```bash |
| 85 | +# Build reth from a specific commit |
| 86 | +RETH_REPO="https://github.com/paradigmxyz/reth/" RETH_VERSION="v0.1.0" ./build-reth.sh |
| 87 | + |
| 88 | +# Build geth from a fork |
| 89 | +GETH_REPO="https://github.com/your-fork/op-geth/" GETH_VERSION="your-branch" ./build-geth.sh |
| 90 | + |
| 91 | +# Build op-rbuilder from a different commit |
| 92 | +RBUILDER_VERSION="main" ./build-rbuilder.sh |
| 93 | +``` |
| 94 | + |
| 95 | +### Available Environment Variables |
| 96 | + |
| 97 | +#### For reth (build-reth.sh): |
| 98 | +- `RETH_REPO`: Git repository URL (default: https://github.com/paradigmxyz/reth/) |
| 99 | +- `RETH_VERSION`: Git branch, tag, or commit hash (default: main) |
| 100 | +- `BUILD_DIR`: Directory for source code (default: ./build) |
| 101 | +- `OUTPUT_DIR`: Directory for built binaries (default: ../bin) |
| 102 | + |
| 103 | +#### For geth (build-geth.sh): |
| 104 | +- `GETH_REPO`: Git repository URL (default: https://github.com/ethereum-optimism/op-geth/) |
| 105 | +- `GETH_VERSION`: Git branch, tag, or commit hash (default: optimism) |
| 106 | +- `BUILD_DIR`: Directory for source code (default: ./build) |
| 107 | +- `OUTPUT_DIR`: Directory for built binaries (default: ../bin) |
| 108 | + |
| 109 | +#### For op-rbuilder (build-rbuilder.sh): |
| 110 | +- `RBUILDER_REPO`: Git repository URL (default: https://github.com/haardikk21/op-rbuilder) |
| 111 | +- `RBUILDER_VERSION`: Git branch, tag, or commit hash (default: a8bb38693ece585e7fa98d52f51290e7dcececff) |
| 112 | +- `BUILD_DIR`: Directory for source code (default: ./build) |
| 113 | +- `OUTPUT_DIR`: Directory for built binaries (default: ../bin) |
| 114 | + |
| 115 | +## Prerequisites |
| 116 | + |
| 117 | +### For reth: |
| 118 | +- Rust and Cargo installed |
| 119 | +- Git |
| 120 | + |
| 121 | +### For geth: |
| 122 | +- Go toolchain |
| 123 | +- Git |
| 124 | + |
| 125 | +### For op-rbuilder: |
| 126 | +- Rust and Cargo installed |
| 127 | +- Git |
| 128 | + |
| 129 | +## Output |
| 130 | + |
| 131 | +Built binaries will be placed in the `bin/` directory at the project root: |
| 132 | +- `bin/reth` - The reth binary |
| 133 | +- `bin/geth` - The op-geth binary |
| 134 | +- `bin/op-rbuilder` - The op-rbuilder binary |
0 commit comments