@ethernity-cloud/sdk-js 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/init.js CHANGED
@@ -129,6 +129,9 @@ const main = async () => {
129
129
  "Bloxberg Testnet",
130
130
  "Polygon Mainnet",
131
131
  "Polygon Amoy Testnet",
132
+ "IoTeX Testnet",
133
+ "Ethereum Sepolia",
134
+ "LitVM LiteForge",
132
135
  ];
133
136
  const blockchainNetwork = await promptOptions(
134
137
  "On which Blockchain network do you want to have the app set up, as a starting point? (default is Bloxberg Testnet): ",
@@ -277,14 +280,24 @@ const main = async () => {
277
280
  }
278
281
  // write TRUSTED_ZONE_IMAGE {token}_{name}{networktype} with the following rules:
279
282
  // - token should be ecld if network is polygon, etny if network is bloxberg
280
- // - name should be serviceType.toLowerCase()
281
- // - networktype should be "" if network contains 'mainnet' else '_testnet'
282
- writeEnv(
283
- "TRUSTED_ZONE_IMAGE",
284
- `${blockchainNetwork.includes("Polygon") ? "ecld" : "etny"
285
- }-${serviceType.toLowerCase()}${blockchainNetwork.includes("Mainnet") ? "" : "-testnet"
286
- }`,
287
- );
283
+ // TRUSTED_ZONE_IMAGE = <prefix>-<service>-<suffix>, matching image_name in
284
+ // etny-{pynithy,nodenithy}/v3/networks.yaml. The old code derived this from
285
+ // "Polygon?ecld:etny" + "Mainnet?'':'-testnet'", which only worked for
286
+ // bloxberg/polygon and produced wrong names for iotex/sepolia/litvm (all use
287
+ // the ecld prefix and network-specific suffixes). Use an explicit per-network
288
+ // map instead.
289
+ const svc = serviceType.toLowerCase();
290
+ const imageByNetwork = {
291
+ "Bloxberg Mainnet": `etny-${svc}`,
292
+ "Bloxberg Testnet": `etny-${svc}-testnet`,
293
+ "Polygon Mainnet": `ecld-${svc}`,
294
+ "Polygon Amoy Testnet": `ecld-${svc}-amoy`,
295
+ "IoTeX Testnet": `ecld-${svc}-iotex-testnet`,
296
+ "Ethereum Sepolia": `ecld-${svc}-ethereum-sepolia`,
297
+ "LitVM LiteForge": `ecld-${svc}-litvm-testnet`,
298
+ };
299
+ const trustedZoneImage = imageByNetwork[blockchainNetwork] || `etny-${svc}-testnet`;
300
+ writeEnv("TRUSTED_ZONE_IMAGE", trustedZoneImage);
288
301
 
289
302
 
290
303
  writeEnv("BLOCKCHAIN_NETWORK", blockchainNetwork.replace(/ /g, "_"));
@@ -94,6 +94,12 @@ if (process.env.BLOCKCHAIN_NETWORK === 'Bloxberg_Testnet') {
94
94
  // image_name in etny-nodenithy v3/networks.yaml (amoy) is ecld-nodenithy-amoy,
95
95
  // NOT ecld-nodenithy-testnet -- must match or the registry pull 404s.
96
96
  templateName = 'ecld-nodenithy-amoy'; trustedZoneNet = 'amoy';
97
+ } else if (process.env.BLOCKCHAIN_NETWORK === 'IoTeX_Testnet') {
98
+ templateName = 'ecld-nodenithy-iotex-testnet'; trustedZoneNet = 'iotex_testnet';
99
+ } else if (process.env.BLOCKCHAIN_NETWORK === 'Ethereum_Sepolia') {
100
+ templateName = 'ecld-nodenithy-ethereum-sepolia'; trustedZoneNet = 'ethereum_sepolia';
101
+ } else if (process.env.BLOCKCHAIN_NETWORK === 'LitVM_LiteForge') {
102
+ templateName = 'ecld-nodenithy-litvm-testnet'; trustedZoneNet = 'litvm_liteforge';
97
103
  } else {
98
104
  templateName = 'etny-nodenithy-testnet'; trustedZoneNet = 'bloxberg_testnet';
99
105
  }
@@ -26,14 +26,30 @@ const writeEnv = (key, value) => {
26
26
  fs.writeFileSync(envFile, envContent, 'utf8');
27
27
  };
28
28
  // runner name: [smart contract address, image registry address, rpc url, chainid]
29
+ // [templateName]: [smart_contract_address, image_registry_address, rpc_url, chain_id]
30
+ // Kept in sync with etny-{pynithy,nodenithy}/v3/networks.yaml (the authoritative
31
+ // on-chain constants). Covers all supported networks for both dApp types.
29
32
  export const ECRunner = {
30
- 'etny-pynithy-testnet': ['0x02882F03097fE8cD31afbdFbB5D72a498B41112c', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://core.bloxberg.org', 8995],
31
- 'etny-nodenithy-testnet': ['0x02882F03097fE8cD31afbdFbB5D72a498B41112c', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://core.bloxberg.org', 8995],
32
- 'etny-pynithy': ['0x549A6E06BB2084100148D50F51CF77a3436C3Ae7', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://core.bloxberg.org', 8995],
33
- 'etny-nodenithy': ['0x549A6E06BB2084100148D50F51CF77a3436C3Ae7', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://core.bloxberg.org', 8995],
34
- 'ecld-nodenithy-testnet': ['0x4274b1188ABCfa0d864aFdeD86bF9545B020dCDf', '0xF7F4eEb3d9a64387F4AcEb6d521b948E6E2fB049', 'https://rpc-mumbai.matic.today', 80001],
35
- 'ecld-pynithy': ['0x439945BE73fD86fcC172179021991E96Beff3Cc4', '0x689f3806874d3c8A973f419a4eB24e6fBA7E830F', 'https://polygon-rpc.com', 137],
36
- 'ecld-nodenithy': ['0x439945BE73fD86fcC172179021991E96Beff3Cc4', '0x689f3806874d3c8A973f419a4eB24e6fBA7E830F', 'https://polygon-rpc.com', 137]
33
+ // --- bloxberg ---
34
+ 'etny-pynithy-testnet': ['0x02882F03097fE8cD31afbdFbB5D72a498B41112c', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://bloxberg.ethernity.cloud', 8995],
35
+ 'etny-nodenithy-testnet': ['0x02882F03097fE8cD31afbdFbB5D72a498B41112c', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://bloxberg.ethernity.cloud', 8995],
36
+ 'etny-pynithy': ['0x549A6E06BB2084100148D50F51CF77a3436C3Ae7', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://bloxberg.ethernity.cloud', 8995],
37
+ 'etny-nodenithy': ['0x549A6E06BB2084100148D50F51CF77a3436C3Ae7', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://bloxberg.ethernity.cloud', 8995],
38
+ // --- polygon mainnet ---
39
+ 'ecld-pynithy': ['0x439945BE73fD86fcC172179021991E96Beff3Cc4', '0x689f3806874d3c8A973f419a4eB24e6fBA7E830F', 'https://polygon-bor-rpc.publicnode.com', 137],
40
+ 'ecld-nodenithy': ['0x439945BE73fD86fcC172179021991E96Beff3Cc4', '0x689f3806874d3c8A973f419a4eB24e6fBA7E830F', 'https://polygon-bor-rpc.publicnode.com', 137],
41
+ // --- polygon amoy testnet (replaces deprecated mumbai) ---
42
+ 'ecld-pynithy-amoy': ['0x1579b37C5a69ae02dDd23263A2b1318DE66a27C3', '0xeFA33c3976f31961285Ae4f5D10188616C912728', 'https://rpc-amoy.polygon.technology', 80002],
43
+ 'ecld-nodenithy-amoy': ['0x1579b37C5a69ae02dDd23263A2b1318DE66a27C3', '0xeFA33c3976f31961285Ae4f5D10188616C912728', 'https://rpc-amoy.polygon.technology', 80002],
44
+ // --- iotex testnet ---
45
+ 'ecld-pynithy-iotex-testnet': ['0xD56385A97413Ed80E28B1b54A193b98F2C49c975', '0xa7467A6391816be9367a1cC52E0ef0c15FfE3cCC', 'https://babel-api.testnet.iotex.io', 4690],
46
+ 'ecld-nodenithy-iotex-testnet': ['0xD56385A97413Ed80E28B1b54A193b98F2C49c975', '0xa7467A6391816be9367a1cC52E0ef0c15FfE3cCC', 'https://babel-api.testnet.iotex.io', 4690],
47
+ // --- ethereum sepolia ---
48
+ 'ecld-pynithy-ethereum-sepolia': ['0x29D3eC870565B6A1510232bd950A8Bc8336f0EB2', '0x55e0ad455Be85162b71a790f00Fc305680E3CE53', 'https://ethereum-sepolia-rpc.publicnode.com', 11155111],
49
+ 'ecld-nodenithy-ethereum-sepolia': ['0x29D3eC870565B6A1510232bd950A8Bc8336f0EB2', '0x55e0ad455Be85162b71a790f00Fc305680E3CE53', 'https://ethereum-sepolia-rpc.publicnode.com', 11155111],
50
+ // --- litvm liteforge testnet (shares sepolia contracts; distinct chain/RPC) ---
51
+ 'ecld-pynithy-litvm-testnet': ['0x29D3eC870565B6A1510232bd950A8Bc8336f0EB2', '0x55e0ad455Be85162b71a790f00Fc305680E3CE53', 'https://liteforge.rpc.caldera.xyz/infra-partner-http', 4441],
52
+ 'ecld-nodenithy-litvm-testnet': ['0x29D3eC870565B6A1510232bd950A8Bc8336f0EB2', '0x55e0ad455Be85162b71a790f00Fc305680E3CE53', 'https://liteforge.rpc.caldera.xyz/infra-partner-http', 4441]
37
53
  };
38
54
 
39
55
  const runCommand = (command, canPass = false) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ethernity-cloud/sdk-js",
3
- "version": "1.1.0",
3
+ "version": "1.1.1",
4
4
  "description": "A package to run ethernity cloud build scripts",
5
5
  "scripts": {
6
6
  "ecld-build": "cross-env node ./node_modules/@ethernity-cloud/sdk-js/build.js",
package/pynithy/build.mjs CHANGED
@@ -26,14 +26,30 @@ const writeEnv = (key, value) => {
26
26
  fs.writeFileSync(envFile, envContent, 'utf8');
27
27
  };
28
28
  // runner name: [smart contract address, image registry address, rpc url, chainid]
29
+ // [templateName]: [smart_contract_address, image_registry_address, rpc_url, chain_id]
30
+ // Kept in sync with etny-{pynithy,nodenithy}/v3/networks.yaml (the authoritative
31
+ // on-chain constants). Covers all supported networks for both dApp types.
29
32
  export const ECRunner = {
30
- 'etny-pynithy-testnet': ['0x02882F03097fE8cD31afbdFbB5D72a498B41112c', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://core.bloxberg.org', 8995],
31
- 'etny-nodenithy-testnet': ['0x02882F03097fE8cD31afbdFbB5D72a498B41112c', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://core.bloxberg.org', 8995],
32
- 'etny-pynithy': ['0x549A6E06BB2084100148D50F51CF77a3436C3Ae7', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://core.bloxberg.org', 8995],
33
- 'etny-nodenithy': ['0x549A6E06BB2084100148D50F51CF77a3436C3Ae7', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://core.bloxberg.org', 8995],
34
- 'ecld-nodenithy-testnet': ['0x4274b1188ABCfa0d864aFdeD86bF9545B020dCDf', '0xF7F4eEb3d9a64387F4AcEb6d521b948E6E2fB049', 'https://rpc-mumbai.matic.today', 80001],
35
- 'ecld-pynithy': ['0x439945BE73fD86fcC172179021991E96Beff3Cc4', '0x689f3806874d3c8A973f419a4eB24e6fBA7E830F', 'https://polygon-rpc.com', 137],
36
- 'ecld-nodenithy': ['0x439945BE73fD86fcC172179021991E96Beff3Cc4', '0x689f3806874d3c8A973f419a4eB24e6fBA7E830F', 'https://polygon-rpc.com', 137]
33
+ // --- bloxberg ---
34
+ 'etny-pynithy-testnet': ['0x02882F03097fE8cD31afbdFbB5D72a498B41112c', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://bloxberg.ethernity.cloud', 8995],
35
+ 'etny-nodenithy-testnet': ['0x02882F03097fE8cD31afbdFbB5D72a498B41112c', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://bloxberg.ethernity.cloud', 8995],
36
+ 'etny-pynithy': ['0x549A6E06BB2084100148D50F51CF77a3436C3Ae7', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://bloxberg.ethernity.cloud', 8995],
37
+ 'etny-nodenithy': ['0x549A6E06BB2084100148D50F51CF77a3436C3Ae7', '0x15D73a742529C3fb11f3FA32EF7f0CC3870ACA31', 'https://bloxberg.ethernity.cloud', 8995],
38
+ // --- polygon mainnet ---
39
+ 'ecld-pynithy': ['0x439945BE73fD86fcC172179021991E96Beff3Cc4', '0x689f3806874d3c8A973f419a4eB24e6fBA7E830F', 'https://polygon-bor-rpc.publicnode.com', 137],
40
+ 'ecld-nodenithy': ['0x439945BE73fD86fcC172179021991E96Beff3Cc4', '0x689f3806874d3c8A973f419a4eB24e6fBA7E830F', 'https://polygon-bor-rpc.publicnode.com', 137],
41
+ // --- polygon amoy testnet (replaces deprecated mumbai) ---
42
+ 'ecld-pynithy-amoy': ['0x1579b37C5a69ae02dDd23263A2b1318DE66a27C3', '0xeFA33c3976f31961285Ae4f5D10188616C912728', 'https://rpc-amoy.polygon.technology', 80002],
43
+ 'ecld-nodenithy-amoy': ['0x1579b37C5a69ae02dDd23263A2b1318DE66a27C3', '0xeFA33c3976f31961285Ae4f5D10188616C912728', 'https://rpc-amoy.polygon.technology', 80002],
44
+ // --- iotex testnet ---
45
+ 'ecld-pynithy-iotex-testnet': ['0xD56385A97413Ed80E28B1b54A193b98F2C49c975', '0xa7467A6391816be9367a1cC52E0ef0c15FfE3cCC', 'https://babel-api.testnet.iotex.io', 4690],
46
+ 'ecld-nodenithy-iotex-testnet': ['0xD56385A97413Ed80E28B1b54A193b98F2C49c975', '0xa7467A6391816be9367a1cC52E0ef0c15FfE3cCC', 'https://babel-api.testnet.iotex.io', 4690],
47
+ // --- ethereum sepolia ---
48
+ 'ecld-pynithy-ethereum-sepolia': ['0x29D3eC870565B6A1510232bd950A8Bc8336f0EB2', '0x55e0ad455Be85162b71a790f00Fc305680E3CE53', 'https://ethereum-sepolia-rpc.publicnode.com', 11155111],
49
+ 'ecld-nodenithy-ethereum-sepolia': ['0x29D3eC870565B6A1510232bd950A8Bc8336f0EB2', '0x55e0ad455Be85162b71a790f00Fc305680E3CE53', 'https://ethereum-sepolia-rpc.publicnode.com', 11155111],
50
+ // --- litvm liteforge testnet (shares sepolia contracts; distinct chain/RPC) ---
51
+ 'ecld-pynithy-litvm-testnet': ['0x29D3eC870565B6A1510232bd950A8Bc8336f0EB2', '0x55e0ad455Be85162b71a790f00Fc305680E3CE53', 'https://liteforge.rpc.caldera.xyz/infra-partner-http', 4441],
52
+ 'ecld-nodenithy-litvm-testnet': ['0x29D3eC870565B6A1510232bd950A8Bc8336f0EB2', '0x55e0ad455Be85162b71a790f00Fc305680E3CE53', 'https://liteforge.rpc.caldera.xyz/infra-partner-http', 4441]
37
53
  };
38
54
 
39
55
  const runCommand = (command, canPass = false) => {