-
Notifications
You must be signed in to change notification settings - Fork 108
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add scripts for docker-compose integration testing of multiple beacon…
… scenarios (#889)
- Loading branch information
1 parent
110d212
commit 9526cf6
Showing
3 changed files
with
91 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## Pre requisites | ||
1) Compile docker images with `make build_docker_all` | ||
2) Run docker compose | ||
|
||
## Instructions | ||
|
||
This scripts allow the user to run a huge amount of beacons process as well as run clients to fetch and test generated randomness. | ||
You should run `beacons.sh` script and wait until it finishes. After you will be able to run `clients.sh` script. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#bin/sh | ||
|
||
NODES=5 | ||
BEACONS=20 | ||
PERIOD_STEP=5 | ||
|
||
nohup docker exec -u drand drand_0 /bin/sh -c "drand share --leader --nodes 5 --threshold 4 --period 2s" & | ||
sleep 1 | ||
nohup docker exec -u drand drand_2 /bin/sh -c "drand share --connect drand_0:8080 --tls-disable" & | ||
sleep 1 | ||
nohup docker exec -u drand drand_1 /bin/sh -c "drand share --connect drand_0:8080 --tls-disable" & | ||
sleep 1 | ||
nohup docker exec -u drand drand_3 /bin/sh -c "drand share --connect drand_0:8080 --tls-disable" & | ||
sleep 1 | ||
nohup docker exec -u drand drand_4 /bin/sh -c "drand share --connect drand_0:8080 --tls-disable" & | ||
sleep 1 | ||
|
||
for (( beacon = 1; beacon <= BEACONS; beacon++ )); do | ||
|
||
PERIOD=$((${beacon}*PERIOD_STEP)) | ||
docker exec -u drand drand_0 /bin/sh -c "drand generate-keypair --tls-disable --id beacon_${PERIOD}s drand_0:8080" | ||
docker exec -u drand drand_1 /bin/sh -c "drand generate-keypair --tls-disable --id beacon_${PERIOD}s drand_1:8180" | ||
docker exec -u drand drand_2 /bin/sh -c "drand generate-keypair --tls-disable --id beacon_${PERIOD}s drand_2:8280" | ||
docker exec -u drand drand_3 /bin/sh -c "drand generate-keypair --tls-disable --id beacon_${PERIOD}s drand_3:8380" | ||
docker exec -u drand drand_4 /bin/sh -c "drand generate-keypair --tls-disable --id beacon_${PERIOD}s drand_4:8480" | ||
|
||
|
||
nohup docker exec -u drand drand_0 /bin/sh -c "drand share --leader --nodes 5 --threshold 4 --period ${PERIOD}s --id beacon_${PERIOD}s --scheme pedersen-bls-unchained" & | ||
sleep 1 | ||
nohup docker exec -u drand drand_2 /bin/sh -c "drand share --connect drand_0:8080 --tls-disable --id beacon_${PERIOD}s" & | ||
sleep 1 | ||
nohup docker exec -u drand drand_1 /bin/sh -c "drand share --connect drand_0:8080 --tls-disable --id beacon_${PERIOD}s" & | ||
sleep 1 | ||
nohup docker exec -u drand drand_3 /bin/sh -c "drand share --connect drand_0:8080 --tls-disable --id beacon_${PERIOD}s" & | ||
sleep 1 | ||
nohup docker exec -u drand drand_4 /bin/sh -c "drand share --connect drand_0:8080 --tls-disable --id beacon_${PERIOD}s" & | ||
sleep 1 | ||
|
||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
#bin/sh | ||
|
||
NODES=5 | ||
BEACONS=20 | ||
PERIOD_STEP=5 | ||
|
||
for (( node = 0; node < 5; node++ )); do | ||
|
||
echo "-------------- NODE ${node} --------------" | ||
echo "------------Randomness on default------------" | ||
RAND=`docker exec drand_client /bin/sh -c "drand-client --url http://drand_${node}:8${node}81 --insecure"` | ||
echo "Value: ${HASH}" | ||
echo "" | ||
|
||
echo "------------Hash on default------------" | ||
HASH=`docker exec drand_${node} /bin/sh -c "drand show chain-info --hash"` | ||
echo "Value: ${HASH}" | ||
echo "" | ||
|
||
echo "------------Randomness on default (chain ${HASH})------------" | ||
RAND=`docker exec drand_client /bin/sh -c "drand-client --url http://drand_${node}:8${node}81 --insecure --chain-hash ${HASH}"` | ||
echo "Value: ${RAND}" | ||
echo "" | ||
|
||
for (( beacon = 1; beacon <= BEACONS; beacon++ )); do | ||
PERIOD=$((${beacon}*PERIOD_STEP)) | ||
|
||
echo "------------Hash on beacon_${PERIOD}s------------" | ||
HASH=`docker exec drand_${node} /bin/sh -c "drand show chain-info --id beacon_${PERIOD}s --hash"` | ||
echo "Value: ${HASH}" | ||
echo "" | ||
|
||
echo "------------Randomness on beacon_${PERIOD}s (chain ${HASH})-----" | ||
RAND=`docker exec drand_client /bin/sh -c "drand-client --url http://drand_${node}:8${node}81 --insecure --chain-hash ${HASH}"` | ||
echo "Value: ${RAND}" | ||
echo "" | ||
|
||
|
||
done | ||
|
||
echo "" | ||
echo "" | ||
echo "" | ||
done |