Skip to content

Commit

Permalink
Docker improvements (#835)
Browse files Browse the repository at this point in the history
* add dockerreshare script
  • Loading branch information
emmanuelm41 committed Oct 19, 2021
1 parent 794b3c7 commit 591ac2b
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ drand-client
drand-relay-gossip
drand-relay-http
drand-relay-s3
docker/data*
docker/data*
**/nohup.out
16 changes: 16 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,19 @@ services:
DRAND_PUBLIC_ADDRESS: "drand_3:8380"
DRAND_SHARE_SECRET: "thisisthesecretweshouldsettorundkgprocessonthenodes"

drand_4:
container_name: drand_4
image: docker.io/drandorg/go-drand:latest
user: drand
volumes:
- ./data_4:/data/drand
ports:
- "0.0.0.0:5430:8480"
- "0.0.0.0:5431:8481"
- "0.0.0.0:5432:8888"
entrypoint: /sbin/tini -- /usr/local/bin/entrypoint.sh
command: start --verbose --control 8888 --private-listen 0.0.0.0:8480 --public-listen 0.0.0.0:8481 --tls-disable true
environment:
DRAND_PUBLIC_ADDRESS: "drand_4:8480"
DRAND_SHARE_SECRET: "thisisthesecretweshouldsettorundkgprocessonthenodes"

17 changes: 17 additions & 0 deletions docker/utils/reshareBeacon.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#bin/sh

# README - Previous tasks
# 1) Run dkg first with startBeacon.sh script
# 2) Copy group file .drand/groups/drand_group.toml from node 0 to node 4 volume
# 3) You are ready to run this script

# Start leader
nohup docker exec -u drand drand_0 /bin/sh -c 'drand share --transition --leader --nodes 5 --threshold 4 --period "5"' &

sleep 3s

# Start the rest of the nodes
nohup docker exec -u drand drand_2 /bin/sh -c 'drand share --transition --connect drand_0:8080 --tls-disable' &
nohup docker exec -u drand drand_1 /bin/sh -c 'drand share --transition --connect drand_0:8080 --tls-disable' &
nohup docker exec -u drand drand_3 /bin/sh -c 'drand share --transition --connect drand_0:8080 --tls-disable' &
nohup docker exec -u drand drand_4 /bin/sh -c 'drand share --connect drand_0:8080 --from ./data/drand/.drand/groups/drand_group.toml --tls-disable' &
6 changes: 3 additions & 3 deletions docker/utils/startBeacon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ nohup docker exec -u drand drand_3 /bin/sh -c 'drand share --leader --nodes 4 --
sleep 3s

# Start the rest of the nodes
nohup docker exec -u drand drand_2 /bin/sh -c 'drand share --connect drand_3:8380 --tls-disable true' &
nohup docker exec -u drand drand_1 /bin/sh -c 'drand share --connect drand_3:8380 --tls-disable true' &
nohup docker exec -u drand drand_0 /bin/sh -c 'drand share --connect drand_3:8380 --tls-disable true' &
nohup docker exec -u drand drand_2 /bin/sh -c 'drand share --connect drand_3:8380 --tls-disable' &
nohup docker exec -u drand drand_1 /bin/sh -c 'drand share --connect drand_3:8380 --tls-disable' &
nohup docker exec -u drand drand_0 /bin/sh -c 'drand share --connect drand_3:8380 --tls-disable' &

0 comments on commit 591ac2b

Please sign in to comment.