Skip to content

Commit

Permalink
change name to match new csc scheme
Browse files Browse the repository at this point in the history
  • Loading branch information
wanwiset25 committed Sep 5, 2023
1 parent 8674f17 commit e9684ba
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
- name: Load Subnet commit/branch config (used for genesis gen)
id: commit
run: |
cat docker/genesis_commit.env
cat docker/puppeth_csc_commit.env
echo commit=$(cat docker/genesis_commit.env) >> $GITHUB_OUTPUT
- name: Build and push image
Expand Down
6 changes: 3 additions & 3 deletions subnet/deployment-generator/docker/README
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#for local builds

run from upper directory (under deployment-generator):
docker build --target builder -f docker/Dockerfile --build-arg SUBNET_BRANCH=easy-genesis --no-cache .
docker build -t generator -f docker/Dockerfile --build-arg SUBNET_BRANCH=easy-genesis --no-cache .
docker build --target builder -f docker/Dockerfile --build-arg SUBNET_BRANCH=master --no-cache .
docker build -t generator -f docker/Dockerfile --build-arg SUBNET_BRANCH=master --no-cache .
#gen configs
docker run --env-file docker.env -v $(pwd)/generated:/app/generated generator
#deploy csc (after subnet launched)
docker run \
--env-file docker.env \
-v $(pwd)/generated/deployment.json:/app/generated/deployment.json \
-v $(pwd)/generated/deployment.config.json:/app/generated/deployment.config.json \
--entrypoint 'bash' generator ./deploy_csc.sh


15 changes: 13 additions & 2 deletions subnet/deployment-generator/docker/deploy_csc.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,16 @@
cd /app/contract
remove0x=${PARENTCHAIN_WALLET_PK:2}
echo "PRIVATE_KEY=${remove0x}" >> .env
cp /app/generated/deployment.json /app/contract/deployment.json
npx hardhat run /app/contract/scripts/fullCheckpointDeploy.js --network xdcparentnet
cp /app/generated/deployment.config.json /app/contract/deployment.config.json
echo "RELAYER_MODE=${RELAYER_MODE}"
if [[ $RELAYER_MODE == 'full' ]]
then
echo "Deploying full CSC"
npx hardhat run /app/contract/scripts/FullCheckpointDeploy.js --network xdcparentnet
elif [[ $RELAYER_MODE == 'lite' ]]
then
echo "Deploying lite CSC"
npx hardhat run /app/contract/scripts/LiteCheckpointDeploy.js --network xdcparentnet
else
echo "Unknown RELAYER_MODE"
fi
1 change: 0 additions & 1 deletion subnet/deployment-generator/docker/genesis_commit.env

This file was deleted.

1 change: 1 addition & 0 deletions subnet/deployment-generator/docker/puppeth_csc_commit.env
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
f7adb81
4 changes: 2 additions & 2 deletions subnet/deployment-generator/script/gen.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ fs.writeFile(`${output_path}/docker-compose.env`, compose_conf, err => {
});

deployment_json = JSON.stringify(deployment_json, null, 2);
fs.writeFile(`${output_path}/deployment.json`, deployment_json, (err) => {
fs.writeFile(`${output_path}/deployment.config.json`, deployment_json, (err) => {
if (err) {
console.error('Error writing file:', err);
exit()
Expand Down Expand Up @@ -411,7 +411,7 @@ function genCommands(num_machines, network_name, network_id, num_subnet, keys){
commands+=`\nmachine1: deploy checkpoint smart contract \n` // (please be mindful of docker image tag if you are not using 'latest')
commands+=` cd ..\n`
commands+=` docker run --env-file docker.env \\
-v $(pwd)/generated/deployment.json:/app/generated/deployment.json \\
-v $(pwd)/generated/deployment.config.json:/app/generated/deployment.config.json \\
--entrypoint 'bash' xinfinorg/subnet-generator:latest ./deploy_csc.sh \n` //how to inject version other than latest??
// commands+=` make an edit to ./config/common.env to include values for CHECKPOINT_CONTRACT \n`
commands+=` cd generated\n`
Expand Down

0 comments on commit e9684ba

Please sign in to comment.