Skip to content

Instantly share code, notes, and snippets.

@danimbrogno
Last active May 28, 2024 15:02
Show Gist options
  • Save danimbrogno/4a8170238a4b7da57dd73e9d7f963e1e to your computer and use it in GitHub Desktop.
Save danimbrogno/4a8170238a4b7da57dd73e9d7f963e1e to your computer and use it in GitHub Desktop.
Demonstration of running two instances of quilibrium in docker, with update.sh script

Example of running two instances of Quilibrium side by side inside docker containers with an update script.

File Structure:

quilibrium/
- .config1/ # Folder mount for persisting config of first instance
- .config2/ # Folder mount for persisting config of second instance
- src/ # Your local clone of the Quilibrium Repository (http://github.com/QuilibriumNetwork/ceremonyclient)
- update.sh # Shell script for updating to latest version and restarting docker instances (must by chmod u+x)
- docker-compose.yaml # Docker compose file for starting services
name: quilibrium
services:
node1:
image: ${QUILIBRIUM_IMAGE_NAME:-quilibrium}
restart: unless-stopped
deploy:
resources:
limits:
memory: 32G
reservations:
cpus: 12
memory: 16G
environment:
- DEFAULT_LISTEN_GRPC_MULTIADDR=/ip4/0.0.0.0/tcp/8337
- DEFAULT_LISTEN_REST_MULTIADDR=/ip4/0.0.0.0/tcp/8338
- DEFAULT_STATS_MULTIADDR=/dns/stats.quilibrium.com/tcp/443
ports:
- '${QUILIBRIUM_P2P_PORT:-8336}:8336/udp' # p2p
- '127.0.0.1:${QUILIBRIUM_GRPC_PORT:-8337}:8337/tcp' # gRPC
- '127.0.0.1:${QUILIBRIUM_REST_PORT:-8338}:8338/tcp' # REST
command: ["--signature-check=false"]
healthcheck:
test: ["CMD", "node", "--peer-id"]
interval: 30s
timeout: 5s
retries: 3
start_period: 1m
volumes:
- ./.config1:/root/.config
logging:
driver: "json-file"
options:
max-file: "5"
max-size: 2048m
node2:
image: ${QUILIBRIUM_IMAGE_NAME:-quilibrium}
restart: unless-stopped
deploy:
resources:
limits:
memory: 32G
reservations:
cpus: 12
memory: 16G
environment:
- DEFAULT_LISTEN_GRPC_MULTIADDR=/ip4/0.0.0.0/tcp/9337
- DEFAULT_LISTEN_REST_MULTIADDR=/ip4/0.0.0.0/tcp/9338
- DEFAULT_STATS_MULTIADDR=/dns/stats.quilibrium.com/tcp/443
ports:
- '${QUILIBRIUM_P2P_PORT:-9336}:9336/udp' # p2p
- '127.0.0.1:${QUILIBRIUM_GRPC_PORT:-9337}:9337/tcp' # gRPC
- '127.0.0.1:${QUILIBRIUM_REST_PORT:-9338}:9338/tcp' # REST
command: ["--signature-check=false"]
healthcheck:
test: ["CMD", "node", "--peer-id"]
interval: 30s
timeout: 5s
retries: 3
start_period: 1m
volumes:
- ./.config2:/root/.config
logging:
driver: "json-file"
options:
max-file: "5"
max-size: 2048m
#!/bin/bash
cd ./src
git pull
sudo task build
cd ../
docker compose up -d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment