Run Agoric validator in Docker

Asif J.
2 min readMar 31, 2021

Thanks to the Agoric team for maintaining a clean version of the installation guide. This helped me a lot with setting up the container environment for myself and sharing it with others.

There are 2 parts

  • Docker image creation
  • Docker compose to start the container

Docker image

I have built a docker image and pushed it to the public docker registry for others to use it. Click here

note: Agoric version sdk@2.14.0

If you want to use a different Agoric SDK version or looking to build your own docker image, please reuse Dockerfile I have committed if you want to. Click here

Docker compose

This repo helps to run Agoric in the docker container. A pre-built(dependencies and Agoric sdk@2.14.0) ubuntu docker image is available in the hub.docker.com. A startup script is used to read the environment variables and determine to start from the beginning or resume from the existing setup.

Note: Network parameters are set to testnet.agoric.net

How do I use it?
Step 1: Install pre-requisites docker and docker-compose
Step 2: Copy docker-compose.yml to the host
git clone https://github.com/asifhj/agoric_docker_deployment.git

Step 3: Update the environment variables in docker-compose.yml
Note:

SETUP=0 means just start Agoric service
SETUP=1 means reset all and start the Agoric service

MONIKER — the name for your validator

Step 4: Set persistent storage for your container to prevent data loss in docker-compose.yml
Default — Volumes — current directory is mapped to /root/.ag-chain-cosmos

Step 5: Configure the port mapping in the ports section in docker-compose.yml

Step 5: Start the container
This will pull pre-built(dependencies and Agoric sdk@2.14.0) docker image from docker hub and mount volume.

The startup.sh script is used to read the environment variables and decides whether to setup new environment or resume from the last block.

Use -d to detach from the container and run in the background.

For more details

--

--