Introduced fallback contract execution (#388)

This commit is contained in:
Chalith Desaman
2023-11-08 10:24:15 +05:30
committed by GitHub
parent bfc38a3c70
commit c3bacabff6
25 changed files with 377 additions and 126 deletions

View File

@@ -16,6 +16,7 @@ fi
ncount=$1
loglevel=$2
roundtime=$3
fallback_enabled=$4
hpcore=$(realpath ../..)
iprange="172.1.1"
@@ -51,7 +52,7 @@ elif [ "$CONTRACT" = "diag" ]; then # Diagnostic contract
else # nodejs echo contract (default)
echo "Using nodejs echo contract."
pushd $hpcore/examples/nodejs_contract/ > /dev/null 2>&1
npm install
npm install
npm run build-echo
popd > /dev/null 2>&1
copyfiles="$hpcore/examples/nodejs_contract/dist/echo-contract/index.js"
@@ -65,6 +66,9 @@ fi
if [ "$roundtime" = "" ]; then
roundtime=1000
fi
if [ "$fallback_enabled" != "true" ]; then
fallback_enabled=false
fi
# Delete and recreate 'hpcluster' directory.
sudo rm -rf hpcluster > /dev/null 2>&1
@@ -115,7 +119,10 @@ do
consensus: { \
...require('./tmp.json').contract.consensus, \
mode: 'public', \
roundtime: $roundtime \
roundtime: $roundtime,\
fallback: { \
execute: $fallback_enabled \
} \
}, \
npl: { \
mode: 'public' \

View File

@@ -14,7 +14,7 @@ fi
clusterloc=$(pwd)/hpcluster
n=$1
hpversion=0.6.4
hpversion=0.6.5
let pubport=8080+$n
let peerport=22860+$n

View File

@@ -5,7 +5,7 @@ WINDOWSIZE=60 # size of window in seconds to examine for successful consensus ro
PIPE=concon.pipe
clusterloc=$(pwd)/hpcluster
n=1
hpversion=0.6.4
hpversion=0.6.5
let pubport=8080+$n
while true; do

View File

@@ -3,7 +3,7 @@
clusterloc=$(pwd)/hpcluster
n=1
hpversion=0.6.4
hpversion=0.6.5
let pubport=8080+$n
while true; do
CONSENSUS="0"

View File

@@ -15,7 +15,7 @@ fi
dir=$(realpath $1)
dirname=$(basename $dir)
n=$1
hpversion=0.6.4
hpversion=0.6.5
let pubport=8080