Skip to content

Commit 608cf2e

Browse files
committed
add bootnode
1 parent 1a24ad0 commit 608cf2e

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

Nnodes/setup.sh

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -31,24 +31,24 @@ COLOR_WHITE='\e[1;37m';
3131
# One Docker container will be configured for each IP address in $ips
3232

3333
# Port prefix
34-
rpc_start_port=22000
35-
node_start_port=25000
36-
raft_start_port=28000
34+
rpc_start_port=23000
35+
node_start_port=26000
36+
raft_start_port=29000
3737

3838
# VIP Subnet
39-
subnet="172.13.0.0/16"
39+
subnet="172.14.0.0/16"
4040

4141
# Total nodes to deploy
4242
total_nodes=5
4343

4444
# Signer nodes for Clique and IBFT
45-
signer_nodes=7
45+
signer_nodes=4
4646

4747
# Consensus engine ex. raft, clique, istanbul
48-
consensus=raft
48+
consensus=clique
4949

5050
# Block period for Clique and IBFT
51-
block_period=1
51+
block_period=0
5252

5353
# Docker image name
5454
image=quorum
@@ -144,6 +144,8 @@ nodekeys=""
144144

145145
echo -e "${COLOR_WHITE}[2] Creating Enodes and static-nodes.json.${COLOR_RESET}"
146146

147+
bootnode="\""
148+
147149
echo "[" > static-nodes.json
148150
n=1
149151
for ip in ${ips[*]}
@@ -163,11 +165,14 @@ do
163165

164166
# Add the enode to static-nodes.json
165167
echo ' "enode://'$enode'@'$ip':30303?raftport=50400"'$sep >> static-nodes.json
168+
bootnode="${bootnode}enode:\\/\\/${enode}@${ip}:30303$sep"
166169
echo -e " - ${COLOR_GREEN}Node #${n}${COLOR_RESET} with nodekey: ${COLOR_YELLOW}${enode:0:8}...${enode:120:8}${COLOR_RESET} configured. (IP: ${COLOR_BLUE}${ip}${COLOR_RESET})"
167170

168171
let n++
169172
done
170173

174+
bootnode="${bootnode}\""
175+
171176
echo "]" >> static-nodes.json
172177

173178
#### Create accounts, keys and genesis.json file #######################
@@ -344,7 +349,8 @@ do
344349
sed -i 's/full/full --mine --minerthreads 1 /g' $qd/start-node.sh
345350
fi
346351
fi
347-
352+
353+
sed -i "s/{bootnode}/--bootnodes ${bootnode}/g" $qd/start-node.sh
348354
let n++
349355
done
350356
rm -rf genesis.json static-nodes.json
@@ -372,7 +378,7 @@ do
372378
ipv4_address: '$ip'
373379
ports:
374380
- $((n+rpc_start_port)):8545
375-
- $((n+node_start_port)):9000
381+
- $((n+node_start_port)):30303
376382
- $((n+raft_start_port)):50400
377383
user: '$uid:$gid'
378384
EOF

Nnodes/templates/start-node.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ set -e
1010
### Configuration Options
1111
TMCONF=/qdata/tm.conf
1212

13-
GETH_ARGS="--datadir /qdata/dd --raft --rpc --rpcaddr 0.0.0.0 --rpcvhosts=* --rpcapi admin,db,eth,debug,miner,net,shh,txpool,personal,web3,quorum,clique,raft,istanbul --nodiscover --unlock 0 --password /qdata/passwords.txt --networkid 10"
13+
GETH_ARGS="--datadir /qdata/dd --raft --rpc --rpcaddr 0.0.0.0 --rpcvhosts=* --rpcapi admin,db,eth,debug,miner,net,shh,txpool,personal,web3,quorum,clique,raft,istanbul --unlock 0 --password /qdata/passwords.txt --networkid 10 {bootnode}"
1414

1515
if [ ! -d /qdata/dd/geth/chaindata ]; then
1616
echo "[*] Mining Genesis block"

0 commit comments

Comments
 (0)