Skip to content

Commit

Permalink
update new way generation
Browse files Browse the repository at this point in the history
  • Loading branch information
wanwiset25 committed Dec 19, 2023
1 parent 34f152b commit f3330bf
Show file tree
Hide file tree
Showing 10 changed files with 78 additions and 6 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ subnet/bootnodes/*
subnet/logs
subnet/relayer
subnet/stats-service
subnet/deployment-generator/script/gen.env*
XDC-Subnet
keys.json
node_modules
subnet/deployment-generator/generated
subnet/deployment-generator/script/gen.env*
subnet/scripts/faucet/*.env
package-lock.json
package-lock.json
generated
*.env
2 changes: 1 addition & 1 deletion subnet/deployment-generator/docker/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
node /app/script/gen.js && puppeth --file /app/generated/genesis_input.yml --out /app/generated/
node /app/src/gen.js


if [[ -n "${SLEEP}" ]]; then
Expand Down
17 changes: 17 additions & 0 deletions subnet/deployment-generator/script/generate.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/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
mkdir -p generated

docker run --env-file docker.env -v $(pwd)/generated:/app/generated xinfinorg/subnet-generator:$VERSION_GENERATOR && cd generated

# 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
55 changes: 55 additions & 0 deletions subnet/deployment-generator/src/gen.env.2
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






Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ function writeGenerated(output_dir){
}
});

let deployment_json = JSON.stringify(deployment_json, null, 2);
deployment_json = JSON.stringify(deployment_json, null, 2);
fs.writeFile(`${output_dir}/deployment.config.json`, deployment_json, (err) => {
if (err) {
console.error('Error writing file:', err);
Expand Down
File renamed without changes.

0 comments on commit f3330bf

Please sign in to comment.