Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update setup instructions in README.md for custom network and Docker fix #71

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@
audits/
images/
**/target/
logs/
3 changes: 3 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
RELAY_KEY=
METRICS_PORT=9500
OUT_DIR=<protobuf_output_dir>
7 changes: 7 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ thiserror = "1.0.49"
uuid = { version = "1.5", features = ["fast-rng", "v4"] }
prometheus = "0.13.4"
lazy_static = "1.5.0"
dotenvy = "0.15.7"

# Broadcasting
fiber = { git = "https://github.com/chainbound/fiber-rs.git", tag = "v0.5.1" }
5 changes: 3 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ RUN apt-get install -y ca-certificates

WORKDIR /app

COPY --from=helix /app/helix-cmd* ./
# the binary requires config.yml for startup
COPY --from=helix /app/helix-cmd* /app/config.yml ./

# set the startup command to run your binary
ENTRYPOINT ["/app/helix-cmd"]
ENTRYPOINT ["/app/helix-cmd"]
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ The relay can be run locally for development, or configured for staging and prod
$ docker build -t helix_mev_relayer -f local.Dockerfile .

# Run the container
$ docker run --name helix_mev_relayer helix_mev_relayer
$ docker run -e RELAY_KEY=<your_relay_key> \
-e METRICS_PORT=<your_prometheus_server_port> \
--name helix_mev_relayer helix_mev_relayer
```

#### Staging or Production-Ready setup
Expand All @@ -100,13 +102,26 @@ $ docker build \
--build-arg REPO_NAME=<your_repo_name> \
-t helix_mev_relayer .

$ docker run --name helix_mev_relayer helix_mev_relayer
$ docker run -e RELAY_KEY=<your_relay_key> \
-e METRICS_PORT=<your_prometheus_server_port> \
--name helix_mev_relayer helix_mev_relayer
```

### Configuration

[config.yml](./config.yml) contains options for the relay.

### Network configuration
The relay can be run using testnets (e.g `Sepolia`, `Holesky`). For custom network setups, simply update the `config.network_config` field.
A custom setup would look like this:

```yaml
network_config: !Custom
dir_path: custom_dir # path to the directory where chain data is stored
genesis_validator_root: '0x0000000000000000000000000000000000000000000000000000000000000000'
genesis_time: 1578009600 # the network's genesis time (Unix timestamp)
```

### Databases
The relay relies on postgres database for persistent storage. Ensure you point the `config.postgres` settings to a database with `timescaledb` extension installed and enabled.

Expand Down
1 change: 1 addition & 0 deletions crates/cmd/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,5 +21,6 @@ futures.workspace = true
tracing.workspace = true
tracing-subscriber.workspace = true
tracing-appender.workspace = true
dotenvy.workspace = true

num_cpus = "1.16.0"
1 change: 1 addition & 0 deletions crates/cmd/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ async fn run() {
}

fn main() {
let _ = dotenvy::dotenv();
let num_cpus = num_cpus::get();
let worker_threads = num_cpus;
let max_blocking_threads = num_cpus / 2;
Expand Down
3 changes: 2 additions & 1 deletion local.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ RUN apt-get install -y ca-certificates

WORKDIR /app

COPY --from=helix /app/helix-cmd* ./
# the binary requires config.yml for startup
COPY --from=helix /app/helix-cmd* /app/config.yml ./

# set the startup command to run your binary
ENTRYPOINT ["/app/helix-cmd"]
Loading