diff --git a/package-lock.json b/package-lock.json index f3787a8..1ba857b 100644 --- a/package-lock.json +++ b/package-lock.json @@ -347,6 +347,15 @@ "node": ">=14.0.0" } }, + "node_modules/@axelar-network/axelar-chains-config": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@axelar-network/axelar-chains-config/-/axelar-chains-config-1.3.0.tgz", + "integrity": "sha512-k633v2pJF8qPM3pDSawSqm7K4AgqmGicj2fUk0O0HwWB1jS2l/oFm+x5jB58HT64xhf8x7VB4BhdJQtMdKcOPA==", + "dependencies": { + "@ethersproject/keccak256": "^5.7.0", + "fs-extra": "^11.1.1" + } + }, "node_modules/@axelar-network/axelar-gmp-sdk-solidity": { "version": "5.7.0", "resolved": "https://registry.npmjs.org/@axelar-network/axelar-gmp-sdk-solidity/-/axelar-gmp-sdk-solidity-5.7.0.tgz", @@ -13919,7 +13928,6 @@ "version": "11.2.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", - "dev": true, "dependencies": { "graceful-fs": "^4.2.0", "jsonfile": "^6.0.1", @@ -33890,11 +33898,11 @@ }, "packages/axelar-local-dev": { "name": "@axelar-network/axelar-local-dev", - "version": "2.3.2", + "version": "2.3.3", "license": "ISC", "dependencies": { "@axelar-network/axelar-cgp-solidity": "^6.3.0", - "@axelar-network/axelar-chains-config": "^1.2.0", + "@axelar-network/axelar-chains-config": "^1.3.0", "@axelar-network/axelar-gmp-sdk-solidity": "^5.7.0", "@axelar-network/interchain-token-service": "^1.2.4", "ethers": "^5.6.5", @@ -34039,28 +34047,6 @@ "node": ">=18" } }, - "packages/axelar-local-dev/node_modules/@axelar-network/axelar-chains-config": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@axelar-network/axelar-chains-config/-/axelar-chains-config-1.2.0.tgz", - "integrity": "sha512-JGQ6Bo8J/iTq7s6iNLf3lhsZRmeVACvPAoEoGMiZA5WdNqku7x8nXGG4i36FaVOASt6UPYK10l/5D5d31fh4JQ==", - "dependencies": { - "@ethersproject/keccak256": "^5.7.0", - "fs-extra": "^11.1.1" - } - }, - "packages/axelar-local-dev/node_modules/@axelar-network/axelar-chains-config/node_modules/fs-extra": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", - "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, "packages/axelar-local-dev/node_modules/@types/node": { "version": "18.19.3", "dev": true, diff --git a/packages/axelar-local-dev/package.json b/packages/axelar-local-dev/package.json index 9c471c3..06f717b 100644 --- a/packages/axelar-local-dev/package.json +++ b/packages/axelar-local-dev/package.json @@ -1,6 +1,6 @@ { "name": "@axelar-network/axelar-local-dev", - "version": "2.3.2", + "version": "2.3.3", "description": "", "main": "dist/index.js", "files": [ @@ -34,7 +34,7 @@ "homepage": "https://github.com/axelarnetwork/axelar-local-dev#readme", "dependencies": { "@axelar-network/axelar-cgp-solidity": "^6.3.0", - "@axelar-network/axelar-chains-config": "^1.2.0", + "@axelar-network/axelar-chains-config": "^1.3.0", "@axelar-network/axelar-gmp-sdk-solidity": "^5.7.0", "@axelar-network/interchain-token-service": "^1.2.4", "ethers": "^5.6.5", diff --git a/packages/axelar-local-dev/src/exportUtils.ts b/packages/axelar-local-dev/src/exportUtils.ts index fbace39..3faccba 100644 --- a/packages/axelar-local-dev/src/exportUtils.ts +++ b/packages/axelar-local-dev/src/exportUtils.ts @@ -96,6 +96,14 @@ export async function setupAndExport(options: SetupLocalOptions) { throw Error('At least 2 chains are required to setup and export'); } + for (const chain of chains) { + // check if given rpc url is valid using ethers.js to get latest block + const provider = new ethers.providers.JsonRpcProvider(chain.rpcUrl); + await provider.getBlockNumber().catch((e) => { + throw Error(`Please check if the ${chain.name} chain is running on ${chain.rpcUrl}`) + }); + } + const _options = { chainOutputPath: chainOutputPath || './local.json', chains,