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

api server and docker compose #3

Merged
merged 4 commits into from
Sep 2, 2024
Merged
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
50 changes: 50 additions & 0 deletions .env.default
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# LOG_LEVEL
VERBOSE=3

# log output path
# LOG_DIR=./logs

# log rotation values: DAILY, HOURLY, MINUTELY, NEVER
# LOG_ROTATION=DAILY

# beacon chain endpoint url
BEACON_ENDPOINT=http://localhost:3500

# beacon client request timeout
#BEACON_CLIENT_TIMEOUT=10

# beacon client poll interval
#POLL_INTERVAL=6

# blob archiver api server listening address
LISTEN_ADDR=0.0.0.0:8000

# blob archiver origin block number
ORIGIN_BLOCK=0x1

# blob data storage strategy type: s3, fs
STORAGE_TYPE=s3

# s3 storage credentials access key id
AWS_ACCESS_KEY_ID=admin

# s3 storage credentials secret access key
AWS_SECRET_ACCESS_KEY=password

# s3 storage region just use default value: us-east-1
AWS_REGION=us-east-1

# s3 storage endpoint
S3_ENDPOINT=http://localhost:9000

# s3 storage bucket
S3_BUCKET=

# s3 storage path
S3_PATH=

# s3 storage compress
S3_COMPRESS=true

# local file storage directory
FS_DIR=./fs
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,9 @@ Cargo.lock

# MSVC Windows builds of rustc generate these, which store debugging information
*.pdb

.idea
.vscode
fs-logs
fs

2 changes: 2 additions & 0 deletions Cargo.lock

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

25 changes: 25 additions & 0 deletions api.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Use the official Rust image as the base
FROM rust:latest as builder

RUN apt-get update && apt-get install -y cmake

# Set the working directory
WORKDIR /usr/src/blob-archiver-rs

# Copy the entire project
COPY . .

# Build the project
RUN cargo build --release -p api

# Create a new stage with a minimal image
FROM ubuntu:latest

# Install OpenSSL
RUN apt-get update && apt-get install -y openssl ca-certificates && rm -rf /var/lib/apt/lists/*

# Copy the built binary from the builder stage
COPY --from=builder /usr/src/blob-archiver-rs/target/release/api /usr/local/bin/api

# Set the entrypoint
ENTRYPOINT ["api"]
6 changes: 4 additions & 2 deletions archiver.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# Use the official Rust image as the base
FROM rust:latest as builder

RUN apt-get update && apt-get install -y cmake

# Set the working directory
WORKDIR /usr/src/blob-archiver-rs

# Copy the entire project
COPY . .

# Build the project
RUN cargo build --release
RUN cargo build --release -p archiver

# Create a new stage with a minimal image
FROM debian:buster-slim
FROM ubuntu:latest

# Install OpenSSL
RUN apt-get update && apt-get install -y openssl ca-certificates && rm -rf /var/lib/apt/lists/*
Expand Down
2 changes: 2 additions & 0 deletions bin/api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ exclude.workspace = true
eth2.workspace = true

clap.workspace = true
ctrlc.workspace = true
futures-util.workspace = true
reqwest.workspace = true
serde_json.workspace = true
Expand All @@ -21,6 +22,7 @@ tokio.workspace = true
eyre.workspace = true
again.workspace = true
hex.workspace = true
tracing-appender.workspace = true
tracing-subscriber.workspace = true
uuid.workspace = true
warp.workspace = true
Expand Down
Loading