Skip to content

Commit

Permalink
automate common.env
Browse files Browse the repository at this point in the history
  • Loading branch information
wanwiset25 committed Sep 2, 2024
1 parent d954e73 commit 2a1fe09
Showing 1 changed file with 34 additions and 11 deletions.
45 changes: 34 additions & 11 deletions subnet/deployment-generator/src/gen_env.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ LOG_LEVEL=2

function genServicesConfig() {
const url = config.parentnet.url;
const config_env = `
let config_env = `
# Bootnode
EXTIP=${config.ip_1}
BOOTNODE_PORT=20301
Expand All @@ -90,17 +90,29 @@ STATS_SECRET=${config.secret_string}
CHECKPOINT_CONTRACT=0x0000000000000000000000000000000000000000
PARENTNET_WALLET_PK=${config.parentnet.privatekey}
`;

if (config.zero.zero_mode == 'one-directional'){
config_env += `
# # XDC-ZERO. It's optional. Don't uncomment it if not planning to enable it
# SUBNET_ZERO_CONTRACT=0x0000000000000000000000000000000000000000
# PARENTNET_ZERO_CONTRACT=0x0000000000000000000000000000000000000000
# PARENTNET_ZERO_WALLET_PK=0x0000000000000000000000000000000000000000000000000000000000000000
# PARENTNET_ZERO_WALLET_PK=${config.zero.parentnet_zero_wallet_pk}
`

} else if (config.zero.zero_mode == 'bi-directional'){
config_env += `
# # XDC-ZERO. It's optional. Don't uncomment it if not planning to enable it
# SUBNET_ZERO_CONTRACT=0x0000000000000000000000000000000000000000
# PARENTNET_ZERO_CONTRACT=0x0000000000000000000000000000000000000000
# PARENTNET_ZERO_WALLET_PK=${config.zero.parentnet_zero_wallet_pk}
# # Reverse-XDC-ZERO. optional.
# REVERSE_CHECKPOINT_CONTRACT=0x0000000000000000000000000000000000000000
# SUBNET_WALLET_PK=0x0000000000000000000000000000000000000000000000000000000000000000
# SUBNET_ZERO_WALLET_PK=0x0000000000000000000000000000000000000000000000000000000000000000
`;
# SUBNET_WALLET_PK=${config.zero.subnet_wallet_pk}
# SUBNET_ZERO_WALLET_PK=${config.zero.subnet_zero_wallet_pk}
`
}
// # Parent Chain Observe Node
// PARENTNET_NODE_NAME=mainnet_observer
// PRIVATE_KEYS=11111111111111111111111111111111111111111111111111111111111111
Expand Down Expand Up @@ -133,17 +145,28 @@ STATS_SECRET=${config.secret_string}
CHECKPOINT_CONTRACT=0x0000000000000000000000000000000000000000
PARENTNET_WALLET_PK=${config.parentnet.privatekey}
`;
if (config.zero.zero_mode == 'one-directional'){
config_env += `
# # XDC-ZERO. It's optional. Don't uncomment it if not planning to enable it
# SUBNET_ZERO_CONTRACT=0x0000000000000000000000000000000000000000
# PARENTNET_ZERO_CONTRACT=0x0000000000000000000000000000000000000000
# PARENTNET_ZERO_WALLET_PK=0x0000000000000000000000000000000000000000000000000000000000000000
# PARENTNET_ZERO_WALLET_PK=${config.zero.parentnet_zero_wallet_pk}
`

} else if (config.zero.zero_mode == 'bi-directional'){
config_env += `
# # XDC-ZERO. It's optional. Don't uncomment it if not planning to enable it
# SUBNET_ZERO_CONTRACT=0x0000000000000000000000000000000000000000
# PARENTNET_ZERO_CONTRACT=0x0000000000000000000000000000000000000000
# PARENTNET_ZERO_WALLET_PK=${config.zero.parentnet_zero_wallet_pk}
# # Reverse-XDC-ZERO. optional.
# REVERSE_CHECKPOINT_CONTRACT=0x0000000000000000000000000000000000000000
# SUBNET_WALLET_PK=0x0000000000000000000000000000000000000000000000000000000000000000
# SUBNET_ZERO_WALLET_PK=0x0000000000000000000000000000000000000000000000000000000000000000
`;
# SUBNET_WALLET_PK=${config.zero.subnet_wallet_pk}
# SUBNET_ZERO_WALLET_PK=${config.zero.subnet_zero_wallet_pk}
`
}
return config_env;
}

Expand Down

0 comments on commit 2a1fe09

Please sign in to comment.