Skip to content
Draft
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
13 changes: 13 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,15 @@
LOG_LEVEL=debug
CONFIG_DIR=./config
CONFIG_FILE_NAME=config.json

# AWS dev credentials. There are 2 users each with their own
# kms key access:
# relayer-kms-signer with AWS_ACCESS_KEY_ID=AKIAWA....
# relayer-kms-signer-dev with AWS_ACCESS_KEY_ID=AKIAWA....

AWS_ACCESS_KEY_ID=[AKIAWA....]
AWS_SECRET_ACCESS_KEY=<AWS_SECRET_ACCESS_KEY>

WEBHOOK_SIGNING_KEY=<webhook_signing_key>
API_KEY=<api_key>
RATE_LIMIT_REQUESTS_PER_SECOND=100
Expand All @@ -13,6 +22,10 @@ REDIS_URL=redis://localhost:6379
# REDIS_READER_URL=redis://localhost:6380
REDIS_CONNECTION_TIMEOUT_MS=10000
REDIS_KEY_PREFIX=oz-relayer
# Required when REPOSITORY_STORAGE_TYPE=redis (application fails to start if missing)
# Generate with: openssl rand -base64 32
# Alternative: cargo run --example generate_encryption_key
STORAGE_ENCRYPTION_KEY=<base64-encoded-32-byte-key>

# Queue backend selection
# Supported: redis, sqs
Expand Down
25 changes: 25 additions & 0 deletions .env.railway.production.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Railway production environment template
# Configure these in your Railway relayer service variables.

# Load production config file (no file copy needed)
CONFIG_DIR=./config
CONFIG_FILE_NAME=config.production.json

# Redis storage (redis-prod is the recommended Railway Redis service name)
REPOSITORY_STORAGE_TYPE=redis
REDIS_URL=${{redis-prod.REDIS_URL}}
REDIS_KEY_PREFIX=oz-relayer-prod
REDIS_CONNECTION_TIMEOUT_MS=10000

# Enable if running multiple relayer instances
DISTRIBUTED_MODE=true

# Required application secrets
API_KEY=<min-32-char-secret>
WEBHOOK_SIGNING_KEY=<secret>
AWS_ACCESS_KEY_ID=<aws-access-key-id>
AWS_SECRET_ACCESS_KEY=<aws-secret-access-key>
# Required for Redis repository storage:
# Generate with: openssl rand -base64 32
# Alternative: cargo run --example generate_encryption_key
STORAGE_ENCRYPTION_KEY=<base64-encoded-32-byte-key>
6 changes: 2 additions & 4 deletions Dockerfile.development
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@ ARG CARGO_FEATURES=""
# Copy
COPY . .

RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/usr/app/target \
if [ -n "$CARGO_FEATURES" ]; then \
RUN if [ -n "$CARGO_FEATURES" ]; then \
cargo install --root /usr/app --path . --debug --locked --features "$CARGO_FEATURES"; \
else \
cargo install --root /usr/app --path . --debug --locked; \
Expand All @@ -34,6 +31,7 @@ FROM cgr.dev/chainguard/wolfi-base
WORKDIR /app

COPY --from=base --chown=nonroot:nonroot /usr/app/bin/openzeppelin-relayer /app/openzeppelin-relayer
COPY --from=base --chown=nonroot:nonroot /usr/app/config /app/config
COPY --from=base /usr/lib/libssl.so.3 /usr/lib/libssl.so.3
COPY --from=base /usr/lib/libcrypto.so.3 /usr/lib/libcrypto.so.3

Expand Down
6 changes: 2 additions & 4 deletions Dockerfile.production
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@ WORKDIR /usr/app
ARG CARGO_FEATURES=""

COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/usr/app/target \
if [ -n "$CARGO_FEATURES" ]; then \
RUN if [ -n "$CARGO_FEATURES" ]; then \
cargo install --root /usr/app --path . --locked --features "$CARGO_FEATURES"; \
else \
cargo install --root /usr/app --path . --locked; \
Expand All @@ -29,6 +26,7 @@ FROM cgr.dev/chainguard/wolfi-base

WORKDIR /app
COPY --from=base --chown=nonroot:nonroot /usr/app/bin/openzeppelin-relayer /app/openzeppelin-relayer
COPY --from=base --chown=nonroot:nonroot /usr/app/config /app/config
COPY --from=base /usr/lib/libssl.so.3 /usr/lib/libssl.so.3
COPY --from=base /usr/lib/libcrypto.so.3 /usr/lib/libcrypto.so.3

Expand Down
Loading