Skip to content
This repository has been archived by the owner on Jan 19, 2022. It is now read-only.

Commit

Permalink
Update 7nodes to support latest versions: 20.10.0 (#116)
Browse files Browse the repository at this point in the history
* Update / regenerate all 7nodes examples to support Quorum 20.10.0 and Tessera 20.10.0.
Fixes for 7nodes tests.
* Update 7nodes tests: 
   - check if constellation and only test private tx on node2 as
      constellation does no support sending private tx to self.
   - check if config dir exists when testing.
  • Loading branch information
libby authored Jan 4, 2021
1 parent e1b0241 commit 5aae435
Show file tree
Hide file tree
Showing 51 changed files with 882 additions and 1,400 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,30 @@ metadata:
data:
genesis-geth.json: |-
{
"alloc": {
"0xed9d02e382b34818e88B88a309c7fe71E65f419d": {
"balance": "1000000000000000000000000000"
"balance": "1000000000000000000000000000"
},
"0xcA843569e3427144cEad5e4d5999a3D0cCF92B8e": {
"balance": "1000000000000000000000000000"
"balance": "1000000000000000000000000000"
},
"0x0fBDc686b912d7722dc86510934589E0AAf3b55A": {
"balance": "1000000000000000000000000000"
"balance": "1000000000000000000000000000"
},
"0x9186eb3d20Cbd1F5f992a950d808C4495153ABd5": {
"balance": "1000000000000000000000000000"
"balance": "1000000000000000000000000000"
},
"0x0638E1574728b6D862dd5d3A3E0942c3be47D996": {
"balance": "1000000000000000000000000000"
"balance": "1000000000000000000000000000"
},
"0xAE9bc6cD5145e67FbD1887A5145271fd182F0eE7": {
"balance": "1000000000000000000000000000"
"balance": "1000000000000000000000000000"
},
"0xCC71C7546429a13796cf1BF9228bFf213e7Ae9cc": {
"balance": "1000000000000000000000000000"
"balance": "1000000000000000000000000000"
}
},
"coinbase": "0x0000000000000000000000000000000000000000",
"config": {
Expand All @@ -48,15 +46,18 @@ data:
"eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"eip155Block": 0,
"eip158Block": 0,
"maxCodeSizeConfig": [
{
"block": 0,
"size": 32
}
],
"chainId": 10,
"isQuorum": true,
"istanbul": {
"epoch": 30000,
"policy": 0
},
"maxCodeSize": 35,
"maxCodeSizeChangeBlock" : 0,
"chainId": 10,
"isQuorum": true
}
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ data:
"enode://3701f007bfa4cb26512d7df18e6bbd202e8484a6e11d387af6e482b525fa25542d46ff9c99db87bd419b980c24a086117a397f6d8f88e74351b41693880ea0cb@quorum-node5:30303?discport=0&raftport=50401",
"enode://eacaa74c4b0e7a9e12d2fe5fee6595eda841d6d992c35dbbcc50fcee4aa86dfbbdeff7dc7e72c2305d5a62257f82737a8cffc80474c15c611c037f52db1a3a7b@quorum-node6:30303?discport=0&raftport=50401",
"enode://239c1f044a2b03b6c4713109af036b775c5418fe4ca63b04b1ce00124af00ddab7cc088fc46020cdc783b6207efe624551be4c06a994993d8d70f684688fb7cf@quorum-node7:30303?discport=0&raftport=50401"
]
]
---
apiVersion: v1
Expand All @@ -45,7 +46,7 @@ data:
},
"server": {
"port": 9001,
"hostName": "http://quorum-node7",
"hostName": "http://%THIS_SERVICE_HOST%",
"bindingAddress": "http://0.0.0.0:9001",
"sslConfig": {
"tls": "OFF",
Expand Down Expand Up @@ -134,7 +135,7 @@ data:
"serverSocket":{
"type":"INET",
"port": 9080,
"hostName": "http://quorum-node7"
"hostName": "http://%THIS_SERVICE_HOST%"
},
"communicationType" : "REST"
},
Expand All @@ -153,7 +154,7 @@ data:
"serverSocket":{
"type":"INET",
"port": 9001,
"hostName": "http://quorum-node7",
"hostName": "http://%THIS_SERVICE_HOST%",
"bindingAddress": "http://0.0.0.0:9001"
},
"sslConfig": {
Expand Down Expand Up @@ -240,7 +241,7 @@ data:
{
"app":"ThirdParty",
"enabled": true,
"serverAddress": "http://quorum-node7:9080",
"serverAddress": "http://%THIS_SERVICE_HOST%:9080",
"cors": {
"allowedMethods": [
"GET",
Expand All @@ -261,7 +262,7 @@ data:
{
"app":"P2P",
"enabled": true,
"serverAddress":"http://quorum-node7:9001",
"serverAddress":"http://%THIS_SERVICE_HOST%:9001",
"sslConfig": {
"tls": "OFF",
"generateKeyStoreIfNotExisted": true,
Expand Down Expand Up @@ -328,7 +329,10 @@ data:
}
]
},
"alwaysSendTo": []
"alwaysSendTo": [],
"features": {
"enablePrivacyEnhancements": true
}
}
---
Expand All @@ -344,8 +348,8 @@ data:
runscript.sh: |-
#!/bin/ash
PRIVATE_CONFIG=$TM_HOME/tm.ipc geth --exec "loadScript(\"$1\")" attach --datadir $QUORUM_DATA_DIR ipc:$QUORUM_DATA_DIR/geth.ipc
# set the tm.pub for node2 in the privateFor field.
# assumes that at least 2 nodes are being deployed.
# set the tm.pub for node1 in the privateFor field.
# supports single node deployment.
private_contract.js: |-
a = eth.accounts[0]
Expand All @@ -358,7 +362,7 @@ data:
var bytecode = "0x6060604052341561000f57600080fd5b604051602080610149833981016040528080519060200190919050505b806000819055505b505b610104806100456000396000f30060606040526000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680632a1afcd914605157806360fe47b11460775780636d4ce63c146097575b600080fd5b3415605b57600080fd5b606160bd565b6040518082815260200191505060405180910390f35b3415608157600080fd5b6095600480803590602001909190505060c3565b005b341560a157600080fd5b60a760ce565b6040518082815260200191505060405180910390f35b60005481565b806000819055505b50565b6000805490505b905600a165627a7a72305820d5851baab720bba574474de3d09dbeaabc674a15f4dd93b974908476542c23f00029";
var simpleContract = web3.eth.contract(abi);
var simple = simpleContract.new(42, {from:web3.eth.accounts[0], data: bytecode, gas: 0x47b760, privateFor: ["QfeDAys9MPDs2XHExtc84jKGHxZg/aj52DTh0vtA3Xc="]}, function(e, contract) {
var simple = simpleContract.new(42, {from:web3.eth.accounts[0], data: bytecode, gas: 0x47b760, privateFor: ["BULeR8JyUWhiuuCMU/HLA0Q5pzkYT+cHII3ZKBey3Bo="]}, function(e, contract) {
if (e) {
console.log("err creating contract", e);
} else {
Expand Down Expand Up @@ -393,69 +397,12 @@ data:
}
}
});
## Raft management helpers: adding nodes
raft_add_node.sh: |-
#!/bin/sh
ENODE_URL=$1
PRIVATE_CONFIG=$TM_HOME/tm.ipc geth --exec "raft.addPeer(\"$ENODE_URL\")" attach ipc:$QUORUM_HOME/dd/geth.ipc;
raft_add_all_permissioned.sh: |-
#!/bin/sh
set -x
# Read the permissioned-nodes.json (this will be redeployed by k8s)
# and add any new entry into the permissioned set.
PERMISSION_FILE=$QHOME/dd/permissioned-nodes.json
ENODE_URLS=$(cat $PERMISSION_FILE | jq '.[]')
RAFT_ADD_FILE=$QHOME/contracts/raft_add_$(date +%m-%d-%Y)
RAFT_ADD_LOG=$RAFT_ADD_FILE.log
RAFT_ADD_ERR=$RAFT_ADD_FILE.err
RAFT_ADD_FILE=$QHOME/contracts/raft_added.csv
touch $RAFT_ADD_LOG
touch $RAFT_ADD_ERR
date +%m-%d-%Y-%T >> $RAFT_ADD_ERR
date +%m-%d-%Y-%T >> $RAFT_ADD_LOG
echo " Going through ENODE_URLS"
echo " $ENODE_URLS"
echo
for URL in $ENODE_URLS; do
# Check if the URL from the permissioned-nodes is this node, if so
# don't add because it will cause an error.
if echo $URL | grep -Eq $THIS_ENODE; then
echo "skip adding self enodeID [$THIS_ENODE]"
continue;
fi
RAFTID=$(PRIVATE_CONFIG=$TM_HOME/tm.ipc geth --exec "raft.addPeer($URL)" attach ipc:$QUORUM_HOME/dd/geth.ipc)
# if the addPerr command isn't successful log the returned error and go to next ENODE_URL
if echo $RAFTID | grep -Eiq ERR; then
echo "RaftID Err: [$RAFTID]" >> $RAFT_ADD_ERR
echo $RAFTID%%$URL >> $RAFT_ADD_ERR;
continue;
fi
if echo $RAFTID | grep -Eq '[0-9][0-9]*'; then
echo $RAFTID - $URL
echo --raftjoinexisting $RAFTID
echo "$RAFTID%%$URL" >> $RAFT_ADD_LOG;
# holds all raft nodes added so far on this node.
echo "$RAFTID,$URL" >> $RAFT_ADD_FILE;
fi
done
echo | tee -a $RAFT_ADD_ERR $RAFT_ADD_LOG
echo ========================================= | tee -a $RAFT_ADD_ERR $RAFT_ADD_LOG
echo | tee -a $RAFT_ADD_ERR $RAFT_ADD_LOG
## Addition config used to manage the nodes lifecycle, e.g. add /remove nodes.
## include ibft helpers as we don't know which nodes will be running which consensus.

---
apiVersion: v1
kind: ConfigMap
Expand Down Expand Up @@ -484,7 +431,7 @@ data:
echo $RES
ibft_propose_all.sh: |-
#!/bin/ash
set -xe
#set -xe
for Addr in $( awk '/validators/,0' $QHOME/istanbul-validator-config.toml/istanbul-validator-config.toml | grep "0x" | sed 's/,//g; s/"//g' ); do
echo $Addr
Expand All @@ -501,7 +448,7 @@ metadata:
name: istanbul-validator-config
data:
istanbul-validator-config.toml: |-
vanity = "0x00"
vanity = "0x00"
validators = [
"0xd8Dba507e85F116b1f7e231cA8525fC9008A6966",
"0x6571D97f340c8495B661a823F2C2145cA47D63c2",
Expand Down
Loading

0 comments on commit 5aae435

Please sign in to comment.