-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* use formatter * add helper scripts * add xdc-zero config generation * added configuration generator ui * add helpers with address generator and useful links * add faucet and faucet-server * minor fixes * bump version for v1 release
- Loading branch information
1 parent
524d0fd
commit d2b637a
Showing
37 changed files
with
1,917 additions
and
518 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,3 @@ | ||
#!/bin/bash | ||
node /app/src/gen.js | ||
node /app/src/ui.js | ||
# node /app/src/gen.js |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/bin/bash | ||
|
||
echo "getting latest block" | ||
resp=$(curl -s --location 'http://localhost:8545' \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{"jsonrpc":"2.0","method":"XDPoS_getV2BlockByNumber","params":["latest"],"id":1}') | ||
|
||
num=$(echo $resp | grep -o '"Number":[0-9]*' | cut -d':' -f2 | tr -d ' ') | ||
echo $num | ||
|
||
if [[ $num == "null" ]] || [[ $num == "" ]]; then | ||
echo "no block has been mined, please check if nodes are peering properly" | ||
exit | ||
else | ||
for i in 2 3 4 | ||
do | ||
sleep 3 | ||
echo "getting latest block $i" | ||
resp=$(curl -s --location 'http://localhost:8545' \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{"jsonrpc":"2.0","method":"XDPoS_getV2BlockByNumber","params":["latest"],"id":1}') | ||
nextnum=$(echo $resp | grep -o '"Number":[0-9]*' | cut -d':' -f2 | tr -d ' ') | ||
echo $nextnum | ||
done | ||
fi | ||
|
||
if [[ $nextnum > $num ]]; then | ||
echo "subnet successfully running and mining blocks" | ||
fi |
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,9 @@ | ||
#!/bin/bash | ||
|
||
resp=$(curl -s --location "http://localhost:8545" \ | ||
--header 'Content-Type: application/json' \ | ||
--data '{"jsonrpc":"2.0","method":"net_peerCount","params":[],"id":1}') | ||
echo $resp | ||
num_peers=$(echo $resp | grep -o '"result":"[^"]*"' | cut -d'"' -f4) | ||
num_peers_dec=$(printf "%d\n" $num_peers) | ||
echo "peers: $num_peers_dec" |
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,16 @@ | ||
#!/bin/bash | ||
|
||
cd "$(dirname "$0")" | ||
|
||
if [[ -z $1 ]] || [[ -z $2 ]]; then | ||
echo "Missing argument" | ||
echo "Usage: csc.sh VERSION MODE" | ||
echo "Version: latest or check documentation for available versions" | ||
echo "Mode: lite, full, or reverse" | ||
exit | ||
fi | ||
|
||
|
||
docker pull xinfinorg/csc:$1 | ||
docker run --env-file ../contract_deploy.env --network generated_docker_net xinfinorg/csc:$1 $2 | ||
|
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,16 @@ | ||
#!/bin/bash | ||
|
||
cd "$(dirname "$0")" | ||
|
||
|
||
if [[ -z $1 ]]; then | ||
echo "Missing argument" | ||
echo "Usage: docker-down.sh PROFILE" | ||
echo "Profile:" | ||
echo " machine1 - subnet nodes" | ||
echo " services - relayer, backend, frontend" | ||
exit | ||
fi | ||
|
||
docker compose --env-file ../docker-compose.env --profile $1 down | ||
|
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,16 @@ | ||
#!/bin/bash | ||
|
||
cd "$(dirname "$0")" | ||
|
||
if [[ -z $1 ]]; then | ||
echo "Missing argument" | ||
echo "Usage: docker-up.sh PROFILE" | ||
echo "Profile:" | ||
echo " machine1 - subnet nodes" | ||
echo " services - relayer, backend, frontend" | ||
exit | ||
fi | ||
|
||
docker compose --env-file ../docker-compose.env --profile $1 pull | ||
docker compose --env-file ../docker-compose.env --profile $1 up -d | ||
|
File renamed without changes.
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,15 @@ | ||
#!/bin/bash | ||
VERSION_GENERATOR="v1.0.0" | ||
|
||
cd "$(dirname "$0")" | ||
cd .. | ||
|
||
read -p "Input Grandmaster PK (or any source wallet with funds): " SOURCE_PK | ||
|
||
extra="" | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
extra="--network generated_docker_net" | ||
fi | ||
|
||
docker pull xinfinorg/subnet-generator:$VERSION_GENERATOR | ||
docker run --env-file common.env --entrypoint node -p 5211:5211 $extra xinfinorg/subnet-generator:$VERSION_GENERATOR /app/src/faucet.js server $SOURCE_PK |
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/bash | ||
VERSION_GENERATOR="v1.0.0" | ||
|
||
cd "$(dirname "$0")" | ||
cd .. | ||
|
||
read -p "Input Grandmaster PK (or any source wallet with funds): " SOURCE_PK | ||
read -p "Input destination wallet address: " DEST_ADDR | ||
read -p "Input transfer amount: " AMOUNT | ||
|
||
extra="" | ||
if [[ "$OSTYPE" == "darwin"* ]]; then | ||
extra="--network generated_docker_net" | ||
fi | ||
|
||
docker pull xinfinorg/subnet-generator:$VERSION_GENERATOR | ||
docker run --env-file common.env --entrypoint node $extra xinfinorg/subnet-generator:$VERSION_GENERATOR /app/src/faucet.js $SOURCE_PK $DEST_ADDR $AMOUNT |
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,27 @@ | ||
#!/bin/bash | ||
VERSION_GENERATOR="v1.0.0" | ||
VERSION_GENESIS="v0.3.1" | ||
|
||
current_dir="$(cd "$(dirname "$0")" && pwd)" | ||
|
||
echo 'pull docker images' | ||
docker pull xinfinorg/subnet-generator:$VERSION_GENERATOR | ||
docker pull xinfinorg/xdcsubnets:$VERSION_GENESIS | ||
|
||
|
||
echo '' | ||
echo 'go to http://localhost:5210 to access Subnet Configuration Generator UI' | ||
echo 'or use ssh tunnel if this is running on your server' | ||
echo 'ssh -N -L localhost:5210:localhost:5210 <username>@<ip_address> -i <private_key_file>' | ||
mkdir -p generated/scripts | ||
docker run -p 5210:5210 -v $current_dir/generated:/app/generated xinfinorg/subnet-generator:$VERSION_GENERATOR | ||
|
||
|
||
echo 'generating genesis.json' | ||
docker run -v $current_dir/generated/:/app/generated/ --entrypoint 'bash' xinfinorg/xdcsubnets:$VERSION_GENESIS /work/puppeth.sh || pup_success=false | ||
if [[ $pup_success == false ]]; then | ||
echo 'genesis.json generation failed' | ||
exit 1 | ||
fi | ||
|
||
echo 'subnet generation successful' |
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 @@ | ||
wip |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.