Skip to content

Instantly share code, notes, and snippets.

@MajdT51
Last active December 8, 2019 13:05
Show Gist options
  • Save MajdT51/5a031f8db40c22e25e35e0e3735296f8 to your computer and use it in GitHub Desktop.
Save MajdT51/5a031f8db40c22e25e35e0e3735296f8 to your computer and use it in GitHub Desktop.
The quorum-def configuration
x-quorum-def:
&quorum-def
restart: "on-failure"
image: "${QUORUM_DOCKER_IMAGE:-quorumengineering/quorum:2.3.0}"
expose:
- "21000"
- "50400"
healthcheck:
test: ["CMD", "wget", "--spider", "--proxy", "off", "http://localhost:8545"]
interval: 4s
timeout: 4s
retries: 10
start_period: 5s
labels:
com.quorum.consensus: raft
entrypoint:
- /bin/sh
- -c
- |
DDIR=/qdata/dd
rm -rf $${DDIR}
mkdir -p $${DDIR}/keystore
mkdir -p $${DDIR}/geth
cp /3nodes/raft/nodekey$${NODE_ID} $${DDIR}/geth/nodekey
cp /3nodes/keys/key$${NODE_ID} $${DDIR}/keystore/
cat /3nodes/permissioned-nodes.json | sed 's/^\(.*\)@.*\?\(.*\)raftport=5040\([0-9]\)\(.*\)$$/\1@172.16.239.1\3:21000?discport=0\&raftport=50400\4/g' > $${DDIR}/static-nodes.json
cp $${DDIR}/static-nodes.json $${DDIR}/permissioned-nodes.json
cat $${DDIR}/static-nodes.json
GENESIS_FILE="/3nodes/genesis.json"
NETWORK_ID=$$(cat $${GENESIS_FILE} | grep chainId | awk -F " " '{print $$2}' | awk -F "," '{print $$1}')
GETH_ARGS_raft="--raft --raftport 50400"
geth --datadir $${DDIR} init $${GENESIS_FILE}
geth \
--identity node$${NODE_ID}-raft \
--datadir $${DDIR} \
--permissioned \
--nodiscover \
--verbosity 5 \
--networkid $${NETWORK_ID} \
--rpc \
--rpccorsdomain "*" \
--rpcvhosts "*" \
--rpcaddr 0.0.0.0 \
--rpcport 8545 \
--rpcapi admin,db,eth,debug,miner,net,shh,txpool,personal,web3,quorum,raft \
--port 21000 \
--unlock 0 \
--password /3nodes/passwords.txt \
${QUORUM_GETH_ARGS:-} $${GETH_ARGS_raft}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment