Skip to content

Commit

Permalink
Use 'PORTBASE' from parameters file in topology-generator and run-Npo…
Browse files Browse the repository at this point in the history
…ols scripts
  • Loading branch information
oneEdoubleD authored and CodiePP committed Jul 3, 2020
1 parent 2a27595 commit 993c83c
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
11 changes: 7 additions & 4 deletions benchmarks/shelley3pools/configuration/parameters
Expand Up @@ -13,10 +13,10 @@ GEN_DECENTRALISATIONPARAM="0.5"
MAGIC=42

# total supply of Lovelaces in genesis (divisible by $NNODES)
SUPPLY=100000000002
SUPPLY=1000000000000

# how many nodes to start
NNODES=3
NNODES=4

# nodes that act as stakepools
STAKEPOOLS="1 2"
Expand All @@ -28,7 +28,7 @@ numtx=1000
init_cooldown=5

# the transactions are sent to these nodes
targetnodes="0 1 2"
targetnodes="0 1 2 3"

# add bytes of data to every transaction
addsizetx=0
Expand All @@ -43,7 +43,8 @@ outputstx=1
tps=10

# cli benchmarking commands
utxo_keys=3
genesis_keys=4
utxo_keys=4

# txvalue for cli benchmarking
txvalue=1000000
Expand All @@ -53,3 +54,5 @@ txfee=1000000

# number of transactions for cli benchmarking
NUM_OF_ADDRESSES=1000

PORTBASE=3000
2 changes: 1 addition & 1 deletion benchmarks/shelley3pools/run-Npools.sh
Expand Up @@ -7,7 +7,7 @@ NODECMD="../../bin/cardano-node"
HOSTADDR=127.0.0.1

# the nodes will listen on ports starting with:
PORTBASE=3000
PORTBASE=${PORTBASE:-3000}

GENESISDIR=configuration/genesis

Expand Down
8 changes: 5 additions & 3 deletions benchmarks/shelley3pools/topology-generator.sh
Expand Up @@ -27,17 +27,19 @@ END_COMMENT
. ./configuration/parameters

NNODES=${NNODES:-3}
PORTBASE=${PORTBASE:-3}

for current_port in $(seq 3000 $(( 3000 + NNODES - 1 )))
for node in $(seq 0 $(( NNODES - 1 )))
do
current_port=$(( node + PORTBASE ))
echo $(echo '
{
"Producers": ['
i="0"
while [ $i -le $(( NNODES - 1 )) ]
do
port=$(( 3000 + $i ))
port=$(( PORTBASE + $i ))
if [ $port -ne $current_port ]; then
Expand All @@ -55,5 +57,5 @@ do
echo '
]
}
') | sed -zr 's/,([^,]*$)/\1/' > ./configuration/topology-node-$((current_port-3000+1)).json
') | sed -zr 's/,([^,]*$)/\1/' > ./configuration/topology-node-$(( node + 1 )).json
done

0 comments on commit 993c83c

Please sign in to comment.