-
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.
- Loading branch information
1 parent
8869924
commit 26d190b
Showing
2 changed files
with
51 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
CONFIG_PATH=~/subnet | ||
#your current directory | ||
|
||
|
||
#genesis config | ||
NETWORK_NAME=localsubnet | ||
NUM_MACHINE=1 | ||
NUM_SUBNET=3 | ||
MAIN_IP=192.168.1.1 | ||
|
||
#parentchain config | ||
PARENTCHAIN=devnet | ||
PARENTCHAIN_WALLET_PK=0x1111111111111111111111111111111111111111111111111111111111111111 | ||
|
||
# OS=mac | ||
|
||
#docker image versions, default to stable | ||
# VERSION_SUBNET | ||
# VERSION_BOOTNODE | ||
# VERSION_OBSERVER | ||
# VERSION_RELAYER | ||
# VERSION_STATS | ||
# VERSION_FRONTEND |
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,17 +1,33 @@ | ||
#!/bin/bash | ||
VERSION_GENERATOR="generator-csc" | ||
VERSION_CSC="latest" | ||
VERSION_SUBNET="featur-puppeth-generator" | ||
docker pull xinfinorg/subnet-generator:$VERSION_GENERATOR | ||
docker pull xinfinorg/csc:$VERSION_CSC | ||
docker pull xinfinorg/xdcsubnets:$VERSION_SUBNET | ||
VERSION_CSC="add-docker" | ||
VERSION_SUBNET="feature-puppeth-docker-2" | ||
echo 'checking docker images' | ||
if [[ -z "$(docker images -q xinfinorg/subnet-generator:$VERSION_GENERATOR)" ]]; then # || echo "doesn't exist" | ||
docker pull xinfinorg/subnet-generator:$VERSION_GENERATOR | ||
fi | ||
if [[ -z "$(docker images -q xinfinorg/csc:$VERSION_CSC)" ]]; then # || echo "doesn't exist" | ||
docker pull xinfinorg/csc:$VERSION_CSC | ||
fi | ||
if [[ -z "$(docker images -q xinfinorg/xdcsubnets:$VERSION_SUBNET)" ]]; then # || echo "doesn't exist" | ||
docker pull xinfinorg/xdcsubnets:$VERSION_SUBNET | ||
fi | ||
|
||
echo '' | ||
echo 'generating configs' | ||
current_dir="$(cd "$(dirname "$0")" && pwd)" | ||
mkdir -p generated | ||
docker run --env-file docker.env -v $current_dir/generated:/app/generated xinfinorg/subnet-generator:$VERSION_GENERATOR || gen_success=false | ||
if [[ $gen_success == false ]]; then | ||
echo 'configs generation failed' | ||
exit 1 | ||
fi | ||
|
||
docker run --env-file docker.env -v $(pwd)/generated:/app/generated xinfinorg/subnet-generator:$VERSION_GENERATOR && cd generated | ||
echo 'generating genesis.json' | ||
docker run -v $current_dir/generated/:/app/generated/ --entrypoint 'bash' xinfinorg/xdcsubnets:$VERSION_SUBNET /work/puppeth.sh || pup_success=false | ||
if [[ $pup_success == false ]]; then | ||
echo 'genesis.json generation failed' | ||
exit 1 | ||
fi | ||
|
||
# cd .. | ||
# docker run --env-file generated/common.env \ | ||
# -v $(pwd)/generated/:/app/generated/ \ | ||
# --network host \ | ||
# --entrypoint 'bash' xinfinorg/subnet-generator:v0.1.6 ./deploy_csc.sh | ||
# cd generated | ||
echo 'subnet generation successful' |