This docker container:
- Sets up a running EOSIO process on the chain of your choosing.
- Install Python that takes hourly snapshots and pushes them Amazon S3 or Wasabi.
- Autorestarts on failures using the last snapshot taken.
- Prunes Snapshots on S3/Wasabi to only keep last 3 days.
💷 NOTE that Wasabi only costs £5 pcm for 1TB 💷
ENV Variables - These will make sense once you get into the Installation Part of the process.
ENV & ARG | Value | Description |
---|---|---|
CHAIN_NAME | wax |
Used in P2P download from eosnation |
SNAPSHOT_NAME | http://x/snapshot.tar.gz |
The initial snapshot to start with |
WAX_BINARY | wax-leap-501wax01 |
Which package to install from APT |
ENDPOINT_URL | https://s3.eu-central-1.wasabisys.com |
Wasabi/S3 endpoint URL for downloads |
AWS_ACCESS_KEY_ID | XXXXXXXXXXXXXXXX |
Wasabi/S3 access key |
AWS_SECRET_ACCESS_KEY | XXXXXXXXXXXXXXXX |
Wasabi/S3 secret key |
WASABI_BUCKET | waxtest2 |
Wasabi/S3 bucketname for snapshots |
RETENTION_DAYS | 2 |
Amount of days to keep snapshots |
- Docker
- Amazon S3 account or Wasabi
- Coffee
- Setup a Amnazon S3 or Wasabi account
- Create a bucket. (Remember the name)
- Create your API keys. Make sure they have permissions to read and write to the bucket.
The first step is to buld the docker container from github
- SNAPSHOT_NAME - The URL link of a snapshot to download that nodeos uses upon starting. This ensures your node syncs up to the network really fast. ❗ Only tar.gz is currently supported.
- WAX_BINARY - Specifies the Nodeos APT package you want to install (See here for more details - https://eosswedenorg.github.io/apt/wax/bionic) ❤️ to EOSsweden for the APT service.
To build it:
docker build https://github.com/ankh2054/snapshot-service.git \
-t snapshot.service \
--build-arg SNAPSHOT_NAME=https://snapshots-cdn.eossweden.org/wax/5.x/latest \
--build-arg WAX_BINARY=wax-leap-501wax01
The final step is to start the container.
- CHAIN_NAME - The name of the chain to take snapshots for. ❗ Please note that only WAX is currently supported.
- WAX_BINARY - Specifies the Nodeos APT package you want to install (See here for more details - https://eosswedenorg.github.io/apt/wax/bionic) ❤️ to EOSsweden for the APT service.
- ENDPOINT_URL - The Wasabi/S3 endpoint URL for your buckets These can be found within your S3/Wasabni control panels.
- AWS_ACCESS_KEY_ID - Your Wasabi/S3 API access key
- AWS_SECRET_ACCESS_KEY - Your Wasabi/S3 API secret key
- WASABI_BUCKET - The name of your bucket where to files will be uploaded to.
- RETENTION_DAYS - The amount of days to keep snapshots on S3/Wasabi
To run it:
docker run --name snapshot.service.wax -d --expose 8888 \
-e 'CHAIN_NAME=wax' \
-e 'WAX_BINARY=wax-leap-501wax01' \
-e 'ENDPOINT_URL=https://s3.eu-central-1.wasabisys.com' \
-e 'AWS_ACCESS_KEY_ID=xxxxxxxxxxx' \
-e 'AWS_SECRET_ACCESS_KEY=xxxxxxxxxxx' \
-e 'WASABI_BUCKET=waxtest2' \
-e 'RETENTION_DAYS=2' \
snapshot.service:latest
In the next coming weeks we will be creating a frontend for the service to display the available snapshots.
- You can check the container is running without any errors.
docker logs snapshot.service.wax
- Check nodeos is running on your container. Note that this takes 2-3 minutes to sync up once you start the container.
curl http://$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' snapshot.service.wax):8888/v1/chain/get_info
- Technically there is no need to expose port 8888, but it's there incase you want to monitor this node with your monitoring system. If you dont run intend on monitoring the service remove the
--expose
option during the container run.
- Allow for both a mainnet and testnet on single container.
- Automate APT sources to be installed.
- Change container to run as specific user called snapshot and not root.
- Allow to keep weekly snapshots ( add metadata to prevent deletion after 3 days)