-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add deployment shell and modify ContractAddress BtcHost tokenAmount t…
…o string
- Loading branch information
Showing
15 changed files
with
271 additions
and
96 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,115 @@ | ||
#!/bin/bash | ||
#!/usr/bin/expect | ||
|
||
echo "deployment" | ||
#mkdir node1 | ||
#mkdir node2 | ||
#mkdir node3 | ||
echo "===============deployment================" | ||
|
||
#cp gptn node1/. | ||
#cp gptn node2/. | ||
#cp gptn node3/. | ||
function ExecInit() | ||
{ | ||
|
||
count=1 | ||
while [ $count -le $1 ] ; | ||
do | ||
#echo $count; | ||
#ExecDeploy $count | ||
if [ $count -eq 1 ] ;then | ||
cd node$count | ||
cp ../init.sh . | ||
gptninit=`./init.sh` | ||
`echo $gptninit` | ||
path=`pwd` | ||
fullpath=${path}"/palletone/gptn/leveldb" | ||
echo $fullpath | ||
if [ ! -d $fullpath ]; then | ||
echo "====================init err==================" | ||
return | ||
fi | ||
cd ../ | ||
else | ||
echo $count | ||
cd node$count | ||
cp ../node1/palletone/gptn/leveldb ./palletone/gptn/. -rf | ||
cd ../ | ||
fi | ||
let ++count; | ||
sleep 1; | ||
done | ||
echo "====================init ok=====================" | ||
return 0; | ||
|
||
} | ||
|
||
cd node1 | ||
#./gptn dumpjson | ||
#./gptn dumpconfig | ||
|
||
|
||
function replacejson() | ||
{ | ||
length=`cat $1 |jq '.initialMediatorCandidates| length'` | ||
|
||
MinMediatorCount="MinMediatorCount" | ||
line=`awk "/$MinMediatorCount/{print NR}" $1` | ||
newMinMediatorCount="\"MinMediatorCount\":$length," | ||
replace=`sed -e "${line}c $newMinMediatorCount" $1` | ||
rm $1 | ||
`echo $replace >>t.json` | ||
jq -r . t.json >> $1 | ||
rm t.json | ||
|
||
|
||
add=`cat $1 | | ||
jq "to_entries | | ||
map(if .key == \"initialActiveMediators\" | ||
then . + {\"value\":$length} | ||
else . | ||
end | ||
) | | ||
from_entries"` | ||
|
||
rm $1 | ||
echo $add >> temp.json | ||
jq -r . temp.json >> $1 | ||
rm temp.json | ||
echo "======modify genesis json ok=======" | ||
} | ||
|
||
function ExecDeploy() | ||
{ | ||
echo ===============$1=============== | ||
mkdir "node"$1 | ||
#if [ $1 -eq 4 ] ;then | ||
#echo "=="$1 | ||
cp gptn ./createaccount.sh modifyconfig.sh modifyjson.sh init.sh node$1 | ||
cd node$1 | ||
/bin/bash modifyconfig.sh | ||
#source ./modifyjson.sh | ||
source ./modifyconfig.sh | ||
ModifyConfig $1 | ||
rm *.sh | ||
cd ../ | ||
#else | ||
#echo $1 | ||
#fi | ||
} | ||
|
||
|
||
|
||
function LoopDeploy() | ||
{ | ||
count=1; | ||
while [ $count -le $1 ] ; | ||
do | ||
#echo $count; | ||
ExecDeploy $count | ||
let ++count; | ||
sleep 1; | ||
done | ||
return 0; | ||
} | ||
read -p "Please input the numbers of nodes you want: " n; | ||
|
||
LoopDeploy $n; | ||
|
||
json="node1/ptn-genesis.json" | ||
replacejson $json | ||
|
||
ExecInit $n | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/usr/bin/expect | ||
#!/bin/bash | ||
set timeout 30 | ||
spawn ./gptn init | ||
expect "Passphrase:" | ||
send "1\r" | ||
interact | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.