-
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.
Merge commit 'dfeb315b74ddb00055019feefc8b91546b9679dd'
- Loading branch information
1 parent
6ce78d4
commit d671d10
Showing
18 changed files
with
181 additions
and
151 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,42 +1,12 @@ | ||
|
||
FROM golang:1.14 as builder | ||
|
||
ARG SUBNET_BRANCH=master | ||
|
||
RUN git clone https://github.com/XinFinOrg/XDC-Subnet | ||
|
||
#it is called 'BRANCH' but commits also work | ||
RUN cd XDC-Subnet && git checkout ${SUBNET_BRANCH} && make puppeth | ||
|
||
|
||
|
||
|
||
|
||
FROM node:18.15 | ||
|
||
ARG SUBNET_BRANCH=master | ||
ARG IMAGE_NAME=latest | ||
#inject build arg as ENV | ||
ENV SUBNET_BRANCH=${SUBNET_BRANCH} | ||
ENV IMAGE_NAME=${IMAGE_NAME} | ||
RUN echo SUBNET_BRANCH=${SUBNET_BRANCH} | ||
RUN echo IMAGE_NAME=${IMAGE_NAME} | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=builder /go/XDC-Subnet/build/bin/puppeth /bin/puppeth | ||
# COPY --from=builder /go/XDC-Subnet/mainnet_contract /app/contract | ||
|
||
#this step here for caching | ||
# RUN cd contract && yarn | ||
|
||
COPY ./script /app/script | ||
COPY ./src /app/src | ||
COPY ./docker/start.sh /app/start.sh | ||
COPY ./docker/deploy_csc.sh /app/deploy_csc.sh | ||
|
||
RUN chmod +x /app/start.sh | ||
RUN chmod +x /app/deploy_csc.sh | ||
|
||
RUN cd script && npm install | ||
RUN cd src && npm install | ||
|
||
ENTRYPOINT ["bash","/app/start.sh"] |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,10 +1,2 @@ | ||
#!/bin/bash | ||
node /app/script/gen.js && puppeth --file /app/generated/genesis_input.yml --out /app/generated/ | ||
|
||
|
||
if [[ -n "${SLEEP}" ]]; then | ||
echo "sleep ${SLEEP}" | ||
sleep ${SLEEP} | ||
else | ||
echo "docker run finished" | ||
fi | ||
node /app/src/gen.js |
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 @@ | ||
#todo |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
VERSION_GENERATOR="generator-csc" | ||
VERSION_CSC="generator-update" | ||
VERSION_SUBNET="feature-puppeth-docker-2" | ||
|
||
current_dir="$(cd "$(dirname "$0")" && pwd)" | ||
echo 'checking for docker.env' | ||
if [ ! -f "docker.env" ]; then | ||
echo 'docker.env not found' | ||
exit 1 | ||
fi | ||
|
||
if ! grep -q "CONFIG_PATH" "docker.env"; then | ||
line="#current directory"$'\n'"CONFIG_PATH=$(pwd)" | ||
echo "$line" | cat - "docker.env" > temp && mv temp "docker.env" | ||
echo 'added CONFIG_PATH to docker.env' | ||
fi | ||
|
||
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' | ||
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 | ||
|
||
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 | ||
|
||
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 @@ | ||
#todo |
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 @@ | ||
#todo |
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 |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#your current directory | ||
CONFIG_PATH=/Users/wp/Git/XinFin-Node/subnet/deployment-generator/ | ||
|
||
#genesis config | ||
NETWORK_NAME=testsubnet | ||
NETWORK_ID=47016 | ||
NUM_MACHINE=1 | ||
NUM_SUBNET=5 | ||
MAIN_IP=192.168.1.1 | ||
|
||
#parentchain config | ||
# PARENTCHAIN=testnet | ||
# PARENTCHAIN_WALLET_PK=0xa7f3b3dd62552eba8d22d1b8a81f14952065a6b275e12ecc4d8851b9b751d95f | ||
PARENTNET=testnet | ||
PARENTNET_WALLET_PK=0xb2c9249d28dc78f2f4be8567f7573854a2bc3ce2ace8ad886f5dd40fdb36ae1b | ||
|
||
|
||
GRANDMASTER_PK=dfc35b23e7afb972c7f9b8600e3fd58d15b4f7e2c50d4bffa60b955a9f03350b | ||
SUBNETS_PK=31b9bfa25c6e217f409cc64fc97b8dcaf90fc0cb9a824b9c61105aba8fcaebf5,fa5b81709455b59195b25cc20694485feecf32d35b9f33315ea8b07817f1d7b7,b78db5d52d9261041e42becb58ebbef47ca1e78e4e5fca7de6e234eab16a0417,a5b6ae3cfc91ec2475908983ea9d42777465d155d8c69dfba1adc04449b7ecc3,24d6ba18767e14e0b1bcac8eb5ec4095759311940e7e60750cfbd4ef2e5512ac | ||
|
||
#docker image versions, default to stable | ||
# VERSION_SUBNET | ||
# VERSION_BOOTNODE | ||
# VERSION_OBSERVER | ||
# VERSION_RELAYER | ||
# VERSION_STATS | ||
# VERSION_FRONTEND | ||
|
||
OS=mac | ||
|
||
|
||
CONFIG_PATH=/root/work/testgen2 | ||
#your current directory | ||
|
||
|
||
#genesis config | ||
NETWORK_NAME=localsubnet | ||
NETWORK_ID=953 | ||
NUM_MACHINE=1 | ||
NUM_SUBNET=3 | ||
MAIN_IP=192.168.1.1 | ||
|
||
#parentchain config | ||
PARENTCHAIN=devnet | ||
PARENTCHAIN_WALLET_PK=0xb2c9249d28dc78f2f4be8567f7573854a2bc3ce2ace8ad886f5dd40fdb36ae1b | ||
|
||
#custom keys | ||
# GRANDMASTER_PK=dfc35b23e7afb972c7f9b8600e3fd58d15b4f7e2c50d4bffa60b955a9f03350b | ||
# SUBNETS_PK=31b9bfa25c6e217f409cc64fc97b8dcaf90fc0cb9a824b9c61105aba8fcaebf5,fa5b81709455b59195b25cc20694485feecf32d35b9f33315ea8b07817f1d7b7,b78db5d52d9261041e42becb58ebbef47ca1e78e4e5fca7de6e234eab16a0417 | ||
|
||
|
||
|
||
|
||
|
||
|
Oops, something went wrong.