forked from ethereum/go-ethereum
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #781 from XinFinOrg/new-devnet
New devnet
- Loading branch information
Showing
16 changed files
with
593 additions
and
91 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
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,2 +1,4 @@ | ||
enode://00d49d72a48164681906ad61924568da0d3049937efdbaed0b7533e34a99f55814f1839d909cdc82f78e04a36ac04737d80b41b22905c7d6cac3c80bb5cdbbc4@66.94.98.186:30301 | ||
enode://d6793b02a478f13ed6d01c30778935f6f8f7461a75aebedcb310def4ed9b066f995a0dca046d0c7ea7f5ffdd8e3f1f53c6b6dce909d1693650504921aad62f1a@194.163.167.177:30301 | ||
enode://c7a38ecc7fd5849eaefb3e928f882ab2f1260d5591bd1fef1db39c8ae0d9fe21d86e2d4efee6def0f4f16d0b6103f86f92f7e910295b849266fef83f05768596@10.244.1.77:30301 | ||
enode://9160713d41656154ce3fdaa9d0f9799dd8546652b1784edecf82ce7a5b54a977f897ea617a9b3b4db513dc6b0dc98c1c3ad8a1914075ab87ded4e367c89dcd3b@10.244.2.53:30301 |
Large diffs are not rendered by default.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,13 @@ | ||
#!/bin/bash | ||
if test -z "$NETWORK" | ||
then | ||
echo "NETWORK env Must be set, mainnet/testnet/devnet" | ||
echo "NETWORK env Must be set, mainnet/testnet/devnet/local" | ||
exit 1 | ||
fi | ||
|
||
echo "Select to run $NETWORK..." | ||
ln -s /usr/bin/XDC-$NETWORK /usr/bin/XDC | ||
cp /work/$NETWORK/* /work | ||
cp -n /work/$NETWORK/* /work | ||
|
||
echo "Start Node..." | ||
/work/start.sh |
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,10 @@ | ||
To set up local xdpos you need pass env NETWORK=local and inject 2 files when starting the container | ||
1. genesis.json - deploy to path "/work/genesis.json" in the container. | ||
- Creating genesis.json using puppeth | ||
1. "make puppeth" from base repo directory | ||
2. run the binary (genesis wizard) "./build/bin/puppeth" | ||
3. the output genesis.json will be in your ~/.puppeth directory | ||
|
||
2. bootnodes.list - deploy to path "/work/bootnodes.list" in the container. | ||
- check example bootnode format in cicd/devnet or cicd/testnet | ||
- REQUIRES newline at the end of the file, or the last line won't read |
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,67 @@ | ||
#!/bin/bash | ||
set -eo pipefail | ||
|
||
if [ ! -d /work/xdcchain/XDC/chaindata ] | ||
then | ||
if test -z "$PRIVATE_KEY" | ||
then | ||
echo "PRIVATE_KEY environment variable has not been set." | ||
exit 1 | ||
fi | ||
echo $PRIVATE_KEY >> /tmp/key | ||
wallet=$(XDC account import --password .pwd --datadir /work/xdcchain /tmp/key | awk -F '[{}]' '{print $2}') | ||
XDC --datadir /work/xdcchain init /work/genesis.json | ||
else | ||
wallet=$(XDC account list --datadir /work/xdcchain | head -n 1 | awk -F '[{}]' '{print $2}') | ||
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" | ||
|
||
log_level="${LOG_LEVEL:-3}" | ||
|
||
port="${PORT:-30303}" | ||
|
||
rpc_port="${RPC_PORT:-8545}" | ||
|
||
ws_port="${WS_PORT:-8555}" | ||
|
||
netstats="${NODE_NAME}-${wallet}:xinfin_xdpos_hybrid_network_stats@devnetstats.apothem.network:2000" | ||
|
||
|
||
echo "Running a node with wallet: ${wallet}" | ||
echo "Starting nodes with $bootnodes ..." | ||
|
||
# Note: --gcmode=archive means node will store all historical data. This will lead to high memory usage. But sync mode require archive to sync | ||
# https://github.com/XinFinOrg/XDPoSChain/issues/268 | ||
|
||
XDC --ethstats ${netstats} \ | ||
--gcmode archive \ | ||
--bootnodes ${bootnodes} \ | ||
--syncmode full \ | ||
--datadir /work/xdcchain \ | ||
--networkid 551 \ | ||
-port $port \ | ||
--rpc --rpccorsdomain "*" \ | ||
--rpcaddr 0.0.0.0 \ | ||
--rpcport $rpc_port \ | ||
--rpcapi db,eth,debug,net,shh,txpool,personal,web3,XDPoS \ | ||
--rpcvhosts "*" \ | ||
--unlock "${wallet}" \ | ||
--password /work/.pwd --mine \ | ||
--gasprice "1" --targetgaslimit "420000000" \ | ||
--verbosity ${log_level} \ | ||
--debugdatadir /work/xdcchain \ | ||
--ws \ | ||
--wsaddr=0.0.0.0 \ | ||
--wsport $ws_port \ | ||
--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
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.