diff --git a/.env.default b/.env.default index 2ca8ab4..deb6737 100644 --- a/.env.default +++ b/.env.default @@ -8,6 +8,7 @@ VERBOSE=3 # LOG_ROTATION=DAILY # beacon chain endpoint url +# easily apply for a Beacon Chain endpoint on the quicknode.com platform. BEACON_ENDPOINT=http://localhost:3500 # beacon client request timeout @@ -17,6 +18,7 @@ BEACON_ENDPOINT=http://localhost:3500 #POLL_INTERVAL=6 # blob archiver api server listening address +# blob sidecars data is obtained from this endpoint. LISTEN_ADDR=0.0.0.0:8000 # blob archiver origin block number @@ -34,14 +36,17 @@ AWS_SECRET_ACCESS_KEY=password # s3 storage region just use default value: us-east-1 AWS_REGION=us-east-1 +#S3_CLIENT +S3_CLIENT=minio + # s3 storage endpoint -S3_ENDPOINT=http://localhost:9000 +S3_ENDPOINT=http://${S3_CLIENT}:9000 # s3 storage bucket -S3_BUCKET= +S3_BUCKET=blobs # s3 storage path -S3_PATH= +S3_PATH=/ # s3 storage compress S3_COMPRESS=true diff --git a/README.md b/README.md index a3f8874..f86cd2d 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,27 @@ to your beacon client and storage backend of choice. Then you can run the projec docker compose up ``` +#### Get blobs +After successfully starting the service, you can use the following command to obtain the blob: + +- get blob by block id from api service: +```shell +# also there is support other type of block id, like: finalized,justified. +curl -X 'GET' 'http://localhost:8000/eth/v1/beacon/blob_sidecars/head' -H 'accept: application/json' +``` + +- get blob by slot number from api service: +```shell +curl -X 'GET' 'http://localhost:8000/eth/v1/beacon/blob_sidecars/7111008' -H 'accept: application/json' +``` + +#### Storage Dashboard +MinIO has started the dashboard, allowing you to view the status of blob storage. +By default, you can access it directly at: +```http +http://localhost:9999 +``` + ## Options ### `verbose` diff --git a/docker-compose.yaml b/docker-compose.yaml index acac179..591d975 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -12,15 +12,27 @@ services: depends_on: - minio - create-buckets + entrypoint: > + /bin/sh -c " + sleep 2; + api; + " archiver: build: context: . dockerfile: archiver.Dockerfile env_file: - .env + ports: + - "8001:8000" depends_on: - minio - create-buckets + entrypoint: > + /bin/sh -c " + sleep 2; + archiver; + " minio: restart: unless-stopped image: minio/minio:latest @@ -37,6 +49,7 @@ services: - minio entrypoint: > /bin/sh -c " + sleep 1; /usr/bin/mc alias set minio http://minio:9000 admin password; /usr/bin/mc mb minio/blobs; /usr/bin/mc anonymous set public minio/blobs;