Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow bridge test #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions nuts-network/gossip-slow-bridge/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
version: "3.7"
services:
nodeA:
image: &image nutsfoundation/nuts-node:master
environment:
NUTS_CONFIGFILE: /opt/nuts/nuts.yaml
ports:
- "11323:1323"
volumes:
- "./node-A/nuts.yaml:/opt/nuts/nuts.yaml:ro"
healthcheck:
interval: 1s # Make test run quicker by checking health status more often
nodeB:
image: *image
environment:
NUTS_CONFIGFILE: /opt/nuts/nuts.yaml
ports:
- "21323:1323"
volumes:
- "./node-B/nuts.yaml:/opt/nuts/nuts.yaml:ro"
healthcheck:
interval: 1s # Make test run quicker by checking health status more often
nodeC:
image: *image
environment:
NUTS_CONFIGFILE: /opt/nuts/nuts.yaml
ports:
- "31323:1323"
volumes:
- "./node-C/nuts.yaml:/opt/nuts/nuts.yaml:ro"
healthcheck:
interval: 1s # Make test run quicker by checking health status more often
nodeD:
image: *image
environment:
NUTS_CONFIGFILE: /opt/nuts/nuts.yaml
ports:
- "41323:1323"
volumes:
- "./node-d/nuts.yaml:/opt/nuts/nuts.yaml:ro"
healthcheck:
interval: 1s # Make test run quicker by checking health status more often
nodeE:
image: *image
environment:
NUTS_CONFIGFILE: /opt/nuts/nuts.yaml
ports:
- "51323:1323"
volumes:
- "./node-e/nuts.yaml:/opt/nuts/nuts.yaml:ro"
healthcheck:
interval: 1s # Make test run quicker by checking health status more often
21 changes: 21 additions & 0 deletions nuts-network/gossip-slow-bridge/node-A/nuts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
verbosity: debug
http:
default:
address: :1323
auth:
publicurl: http://node-A
contractvalidators:
- dummy
irma:
autoupdateschemas: false
network:
bootstrapnodes:
- nodeB:5555
- nodeC:5555
publicaddr: nodeA:5555
grpcaddr: :5555
enabletls: false
v1:
adverthashesinterval: 3600000
v2:
gossipinterval: 500
21 changes: 21 additions & 0 deletions nuts-network/gossip-slow-bridge/node-B/nuts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
verbosity: debug
http:
default:
address: :1323
auth:
publicurl: http://node-B
contractvalidators:
- dummy
irma:
autoupdateschemas: false
network:
bootstrapnodes:
- nodeA:5555
- nodeC:5555
publicaddr: nodeB:5555
grpcaddr: :5555
enabletls: false
v1:
adverthashesinterval: 3600000
v2:
gossipinterval: 500
18 changes: 18 additions & 0 deletions nuts-network/gossip-slow-bridge/node-C/nuts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
verbosity: debug
http:
default:
address: :1323
auth:
publicurl: http://node-C
contractvalidators:
- dummy
irma:
autoupdateschemas: false
network:
publicaddr: nodeC:5555
grpcaddr: :5555
enabletls: false
v1:
adverthashesinterval: 3600000
v2:
gossipinterval: 20000
21 changes: 21 additions & 0 deletions nuts-network/gossip-slow-bridge/node-D/nuts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
verbosity: debug
http:
default:
address: :1323
auth:
publicurl: http://node-D
contractvalidators:
- dummy
irma:
autoupdateschemas: false
network:
bootstrapnodes:
- nodeE:5555
- nodeC:5555
publicaddr: nodeD:5555
grpcaddr: :5555
enabletls: false
v1:
adverthashesinterval: 3600000
v2:
gossipinterval: 500
21 changes: 21 additions & 0 deletions nuts-network/gossip-slow-bridge/node-E/nuts.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
verbosity: debug
http:
default:
address: :1323
auth:
publicurl: http://node-E
contractvalidators:
- dummy
irma:
autoupdateschemas: false
network:
bootstrapnodes:
- nodeD:5555
- nodeC:5555
publicaddr: nodeE:5555
grpcaddr: :5555
enabletls: false
v1:
adverthashesinterval: 3600000
v2:
gossipinterval: 500
63 changes: 63 additions & 0 deletions nuts-network/gossip-slow-bridge/run-test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
#!/usr/bin/env bash

source ../../util.sh

echo "------------------------------------"
echo "Cleaning up running Docker containers and volumes, and key material..."
echo "------------------------------------"
docker-compose down
docker-compose rm -f -v

echo "------------------------------------"
echo "Starting Docker containers..."
echo "------------------------------------"
docker-compose up -d
waitForDCService nodeA
waitForDCService nodeB
waitForDCService nodeC
waitForDCService nodeD
waitForDCService nodeE

# Wait for Nuts Network nodes to build connections
sleep 1

echo "------------------------------------"
echo "Creating root"
echo "------------------------------------"

# node-C gossips at a long interval and is the bridge between nodes A & B vs D & E
curl -s -X POST http://localhost:31323/internal/vdr/v1/did >/dev/null

sleep 60

# create 1000 new DID documents on each node
echo "------------------------------------"
echo "Creating transactions"
echo "------------------------------------"

START0=$(date +%s)
for i in {1..1000}
do
curl -s -X POST http://localhost:11323/internal/vdr/v1/did >/dev/null
curl -s -X POST http://localhost:21323/internal/vdr/v1/did >/dev/null
curl -s -X POST http://localhost:41323/internal/vdr/v1/did >/dev/null
curl -s -X POST http://localhost:51323/internal/vdr/v1/did >/dev/null
done

echo "------------------------------------"
echo "Performing assertions..."
echo "------------------------------------"

START1=$(date +%s)

waitForTXCount "NodeC" "http://localhost:31323/status/diagnostics" 4001 120
waitForTXCount "NodeA" "http://localhost:11323/status/diagnostics" 4001 120
waitForTXCount "NodeE" "http://localhost:51323/status/diagnostics" 4001 120

END=$(date +%s)
echo "Runtime with adding transactions: $((END - START0)) seconds"
echo "Runtime after adding transactions: $((END - $START1)) seconds"
echo "------------------------------------"
echo "Stopping Docker containers..."
echo "------------------------------------"
docker-compose stop