-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve testnet script and use old way for backward compatible (#90)
* improve testnet * update start script * give message to upgrade script * update script to remove conflict
- Loading branch information
Showing
12 changed files
with
84 additions
and
27 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
Empty file.
Empty file.
Empty file.
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
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,11 +1,4 @@ | ||
NODE_NAME=XF_MasterNode | ||
CONTACT_DETAILS=YOUR_EMAIL_ADDRESS | ||
NODE_TYPE=full | ||
|
||
PORT=30304 | ||
RPC_PORT=8545 | ||
WS_PORT=8555 | ||
|
||
PRIVATE_KEYS= | ||
NETWORK=testnet | ||
LOG_LEVEL=3 |
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,3 +1,3 @@ | ||
#!/bin/bash | ||
|
||
rm -rf ./xdcchain/XDC | ||
rm -rf ./xdcchain-testnet/XDC |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
sudo docker-compose -f docker-compose.yml up -d | ||
docker-compose -f docker-compose.yml up -d --build --force-recreate |
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,46 @@ | ||
#!/bin/bash | ||
|
||
if [ ! -d /work/xdcchain/XDC/chaindata ] | ||
then | ||
wallet=$(XDC account new --password /work/.pwd --datadir /work/xdcchain | awk -F '[{}]' '{print $2}') | ||
echo "Initializing Testnet Genesis Block" | ||
echo "wallet: $wallet" | ||
coinbaseaddr="$wallet" | ||
coinbasefile=/work/xdcchain/coinbase.txt | ||
touch $coinbasefile | ||
if [ -f "$coinbasefile" ] | ||
then | ||
echo "$coinbaseaddr" > "$coinbasefile" | ||
cat xdcchain/keystore/* >> "$coinbasefile" | ||
fi | ||
XDC --datadir /work/xdcchain init /work/genesis.json | ||
else | ||
wallet=$(XDC account list --datadir /work/xdcchain| head -n 1 | awk -F '[{}]' '{print $2}') | ||
echo "wallet: $wallet" | ||
fi | ||
|
||
input="/work/bootnodes.list" | ||
bootnodes="" | ||
while IFS= read -r line | ||
do | ||
if [ -z "${bootnodes}" ] | ||
then | ||
bootnodes=$line | ||
else | ||
bootnodes="${bootnodes},$line" | ||
fi | ||
done < "$input" | ||
INSTANCE_IP=$(curl https://checkip.amazonaws.com) | ||
netstats="${INSTANCE_NAME}:xdc_xinfin_apothem_network_stats@stats.apothem.network:2000" | ||
|
||
echo "Starting nodes with $bootnodes ..." | ||
XDC --ethstats ${netstats} --gcmode=archive \ | ||
--bootnodes ${bootnodes} --syncmode ${NODE_TYPE} \ | ||
--datadir /work/xdcchain \ | ||
--networkid 51 -port 30304 \ | ||
--rpc --rpccorsdomain "*" --rpcaddr 0.0.0.0 \ | ||
--rpcport 8555 --rpcapi admin,db,eth,debug,net,shh,txpool,personal,web3,XDPoS \ | ||
--rpcvhosts "*" --unlock "${wallet}" --password /work/.pwd \ | ||
--mine --gasprice "1" --targetgaslimit "420000000" \ | ||
--verbosity 2 --ws --wsaddr=0.0.0.0 --wsport 8556 \ | ||
--wsorigins "*" 2>&1 >>/work/xdcchain/xdc.log | tee -a /work/xdcchain/xdc.log |
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,17 @@ | ||
#!/bin/sh | ||
echo "Upgrading XDC Network Configuration Scripts" | ||
cd testnet | ||
mv .env .env_tmp | ||
|
||
git stash | ||
git pull | ||
|
||
source .env_tmp | ||
sed -i "s/NODE_NAME=XF_MasterNode/NODE_NAME=$NODE_NAME/" .env | ||
sed -i "s/CONTACT_DETAILS=YOUR_EMAIL_ADDRESS/CONTACT_DETAILS=$CONTACT_DETAILS/" .env | ||
sed -i "s/NODE_TYPE=full/NODE_TYPE=$NODE_TYPE/" .env | ||
|
||
bash docker-down.sh | ||
mv xdcchain xdcchain-testnet || true | ||
mv start.sh start-apothem.sh || true | ||
bash docker-up.sh |