Skip to content

Commit 8dd2a91

Browse files
committed
remove OS configs
1 parent 260fe7d commit 8dd2a91

File tree

3 files changed

+14
-32
lines changed

3 files changed

+14
-32
lines changed

deployment-generator/src/config_gen.js

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ const config = {
2020
relayer_mode: process.env.RELAYER_MODE || "full",
2121
docker_image_name:
2222
process.env.IMAGE_NAME || "xinfinorg/subnet-generator:latest",
23-
operating_system: process.env.OS || "linux",
2423
version: {
2524
subnet: process.env.VERSION_SUBNET || "v0.3.1",
2625
bootnode: process.env.VERSION_BOOTNODE || "v0.3.1",
@@ -197,14 +196,6 @@ function configSanityCheck(config) {
197196
config.keys.subnets_addr = output_wallet;
198197
}
199198

200-
if (config.operating_system === "mac") {
201-
if (config.num_machines !== 1) {
202-
console.log(
203-
"OS=mac requires NUM_MACHINE=1. Due to Docker network limitation, Subnets on MacOS can only communicate within its own machine. This option is intended for single machine testing environment only"
204-
);
205-
process.exit();
206-
}
207-
}
208199

209200
if (config.zero.zero_mode == "one-directional"){
210201
try {

deployment-generator/src/gen.js

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,13 @@ Object.entries(subnet_services).forEach((entry) => {
5959
// checkpoint smartcontract deployment config
6060
let deployment_json = gen_other.genDeploymentJson(keys);
6161

62-
if (config.operating_system === "mac" || config.operating_system === "linux") {
63-
doc, ip_record = gen_compose.injectNetworkConfig(doc);
64-
commonconf = gen_env.genServicesConfig(ip_record);
65-
subnetconf = [];
66-
for (let i = 1; i <= config.num_subnet; i++) {
67-
subnetconf.push(gen_env.genSubnetConfig(i, keys, ip_record));
68-
}
69-
deployconf = gen_env.genContractDeployEnv();
70-
} else {
71-
console.log(`ERROR: unknown OS ${config.operating_system} not supported`);
72-
process.exit(1);
62+
doc, ip_record = gen_compose.injectNetworkConfig(doc);
63+
commonconf = gen_env.genServicesConfig(ip_record);
64+
subnetconf = [];
65+
for (let i = 1; i <= config.num_subnet; i++) {
66+
subnetconf.push(gen_env.genSubnetConfig(i, keys, ip_record));
7367
}
68+
deployconf = gen_env.genContractDeployEnv();
7469

7570
const compose_content = yaml.dump(doc, {});
7671
const compose_conf = gen_compose.genComposeEnv();

deployment-generator/src/gen_other.js

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,6 @@ function genCommands() {
7676
if (config.relayer_mode == "lite") {
7777
csc_mode = "lite";
7878
}
79-
let os_extra = "";
80-
if (config.operating_system == "mac"){
81-
os_extra = " --network generated_docker_net "
82-
}
8379
let commands = "";
8480
commands += "Start under generated/ directory\n";
8581
commands += "\n1. Deploy Subnet nodes\n";
@@ -100,7 +96,7 @@ function genCommands() {
10096
commands += " ./scripts/check-mining.sh\n";
10197
commands += "\n3. Deploy Checkpoint Smart Contract (CSC)\n";
10298
commands += ` docker pull xinfinorg/csc:${config.version.csc}\n`;
103-
commands += ` docker run --env-file contract_deploy.env ${os_extra} xinfinorg/csc:${config.version.csc} ${csc_mode}\n`;
99+
commands += ` docker run --env-file contract_deploy.env --network generated_docker_net xinfinorg/csc:${config.version.csc} ${csc_mode}\n`;
104100
commands += "\n4. Add CSC configuration to common.env\n";
105101
commands += " - copy step 3. output CHECKPOINT_CONTRACT to common.env\n";
106102
commands += "\n5. Start services (relayer, backend, frontend)\n";
@@ -120,17 +116,17 @@ function genCommands() {
120116
" - copy CHECKPOINT_CONTRACT from common.env to and rename it to REVERSE_CSC in contract_deploy.env\n";
121117
commands += "\n2. Deploy XDC-Zero\n";
122118
commands += ` docker pull xinfinorg/xdc-zero:${config.version.zero}\n`;
123-
commands += ` docker run --env-file contract_deploy.env ${os_extra} xinfinorg/xdc-zero:${config.version.zero} endpointandregisterchain\n`;
119+
commands += ` docker run --env-file contract_deploy.env --network generated_docker_net xinfinorg/xdc-zero:${config.version.zero} endpointandregisterchain\n`;
124120
if (config.zero.subswap == "true") {
125121
commands += " \n Deploy Subswap and Register Application to XDC-Zero\n";
126122
commands +=
127123
" - copy SUBNET_ZERO_CONTRACT and PARENTNET_ZERO_CONTRACT to contract_deploy.env\n";
128124
commands +=
129-
` docker run --env-file contract_deploy.env ${os_extra} xinfinorg/xdc-zero:v0.1.0 subswap\n`;
125+
` docker run --env-file contract_deploy.env --network generated_docker_net xinfinorg/xdc-zero:v0.1.0 subswap\n`;
130126
commands +=
131127
" - copy SUBNET_APP and PARENTNET_APP to contract_deploy.env\n";
132128
commands +=
133-
` docker run --env-file contract_deploy.env ${os_extra} xinfinorg/xdc-zero:v0.1.0 applicationregister\n`;
129+
` docker run --env-file contract_deploy.env --network generated_docker_net xinfinorg/xdc-zero:v0.1.0 applicationregister\n`;
134130
}
135131
commands += "\n3. Add XDC-Zero Configuration to common.env\n";
136132
commands +=
@@ -148,7 +144,7 @@ function genCommands() {
148144
commands += "\n\nDeploy XDC-Zero crosschain framework (bi-directional)\n";
149145
commands += "\n1. Deploy Reverse Checkpoint Smart Contract (Reverse CSC)\n";
150146
commands += ` docker pull xinfinorg/csc:${config.version.csc}\n`;
151-
commands += ` docker run --env-file contract_deploy.env ${os_extra} xinfinorg/csc:${config.version.csc} reversefull\n`;
147+
commands += ` docker run --env-file contract_deploy.env --network generated_docker_net xinfinorg/csc:${config.version.csc} reversefull\n`;
152148
commands += "\n2. Add CSC and Reverse CSC configuration\n";
153149
commands +=
154150
" - copy previous step output REVERSE_CHECKPOINT_CONTRACT to common.env\n";
@@ -158,18 +154,18 @@ function genCommands() {
158154
" - copy CHECKPOINT_CONTRACT from common.env and rename it to CSC in contract_deploy.env\n";
159155
commands += "\n3. Deploy XDC-Zero\n";
160156
commands += ` docker pull xinfinorg/xdc-zero:${config.version.zero}\n`;
161-
commands += ` docker run --env-file contract_deploy.env ${os_extra} xinfinorg/xdc-zero:${config.version.zero} endpointandregisterchain\n`;
157+
commands += ` docker run --env-file contract_deploy.env --network generated_docker_net xinfinorg/xdc-zero:${config.version.zero} endpointandregisterchain\n`;
162158
if (config.zero.subswap) {
163159
commands +=
164160
" \n Deploy Subswap and Register Application to XDC-Zero\n";
165161
commands +=
166162
" - copy SUBNET_ZERO_CONTRACT and PARENTNET_ZERO_CONTRACT to contract_deploy.env\n";
167163
commands +=
168-
` docker run --env-file contract_deploy.env ${os_extra} xinfinorg/xdc-zero:v0.1.0 subswap\n`;
164+
` docker run --env-file contract_deploy.env --network generated_docker_net xinfinorg/xdc-zero:v0.1.0 subswap\n`;
169165
commands +=
170166
" - copy SUBNET_APP and PARENTNET_APP to contract_deploy.env\n";
171167
commands +=
172-
` docker run --env-file contract_deploy.env ${os_extra} xinfinorg/xdc-zero:v0.1.0 applicationregister\n`;
168+
` docker run --env-file contract_deploy.env --network generated_docker_net xinfinorg/xdc-zero:v0.1.0 applicationregister\n`;
173169
}
174170
commands += "\n4. Add XDC-Zero Configuration to common.env\n";
175171
commands +=

0 commit comments

Comments
 (0)