This is a Rust implementation of the Beacon Chain blob archiver
The Blob Archiver is a service to archive and allow querying of all historical blobs from the beacon chain. It consists of two components:
- Archiver - Tracks the beacon chain and writes blobs to a storage backend
- API - Implements the blob sidecars API, which allows clients to retrieve blobs from the storage backend
There are currently two supported storage options:
- On-disk storage - Blobs are written to disk in a directory
- S3 storage - Blobs are written to an S3 bucket (or compatible service)
You can control which storage backend is used by setting the STORAGE_TYPE
to
either file
or s3
.
The s3
backend will also work with (for example) Google Cloud Storage buckets (instructions here).
# Run the tests
cargo test --workspace --all-features --all-targets --locked
# Lint the project
cargo clippy --workspace --all-targets --all-features -- -D warnings
# Build the project
cargo build --workspace --all-targets --all-features
To run the project locally, you should first copy .env.template
to .env
and then modify the environment variables
to your beacon client and storage backend of choice. Then you can run the project with:
docker compose up
```shell
--verbose=<VERBOSE>
```
```shell
--verbose=2
```
```shell
--log_dir=<LOG_DIR>
```
```shell
--log_dir=/var/log/blob-archiver
```
```shell
--log_rotation=<LOG_ROTATION>
```
```shell
--log_rotation=DAILY
```
```shell
--beacon_endpoint=<BEACON_ENDPOINT>
```
```shell
--beacon_endpoint=http://localhost:5052
```
```shell
--beacon_client_timeout=<BEACON_CLIENT_TIMEOUT>
```
```shell
--beacon_client_timeout=10
```
```shell
--poll_interval=<POLL_INTERVAL>
```
```shell
--poll_interval=6
```
```shell
--listen_addr=<LISTEN_ADDR>
```
```shell
--listen_addr=0.0.0.0:8000
```
```shell
--origin_block=<ORIGIN_BLOCK>
```
```shell
--origin_block="0x0"
```
```shell
--storage_type=<STORAGE_TYPE>
```
```shell
--storage_type="s3"
```
```shell
--s3_endpoint=<S3_ENDPOINT>
```
```shell
--s3_endpoint="http://localhost:9000"
```
```shell
--s3_bucket=<S3_BUCKET>
```
```shell
--s3_bucket="blobs"
```
```shell
--s3_path=<S3_PATH>
```
```shell
--s3_path=/blobs
```
```shell
--s3_compress=<S3_COMPRESS>
```
```shell
--s3_compress=false
```
```shell
--fs_dir=<FS_DIR>
```
```shell
--fs_dir=/blobs
```