Error: could not detect network, when deploying contracts
Closed this issue · 1 comments
I am currently facing this issue while deploying ZkEVM contracts on an AWS EC2 instance. Below, I have outlined the details of the error and the steps I have taken to troubleshoot it.
Error Details:
During the deployment of the ZkEVM contracts, I encounter the following error:
npm run deploy:deployer:ZkEVM:goerli
> @0xpolygonhermez/zkevm-contracts@0.6.0.0 deploy:deployer:ZkEVM:goerli
> npx hardhat run deployment/2_deployPolygonZKEVMDeployer.js --network goerli
Hardcoded gas used: MaxPriority100 gwei, MaxFee50 gwei
Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.7.2)
at Logger.makeError (/home/ubuntu/zkevm-contracts/node_modules/@ethersproject/logger/src.ts/index.ts:269:28)
at Logger.throwError (/home/ubuntu/zkevm-contracts/node_modules/@ethersproject/logger/src.ts/index.ts:281:20)
at JsonRpcProvider.<anonymous> (/home/ubuntu/zkevm-contracts/node_modules/@ethersproject/providers/src.ts/json-rpc-provider.ts:483:23)
at step (/home/ubuntu/zkevm-contracts/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:48:23)
at Object.throw (/home/ubuntu/zkevm-contracts/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:29:53)
at rejected (/home/ubuntu/zkevm-contracts/node_modules/@ethersproject/providers/lib/json-rpc-provider.js:21:65)
at processTicksAndRejections (node:internal/process/task_queues:96:5) {
reason: 'could not detect network',
code: 'NETWORK_ERROR',
event: 'noNetwork'
}
Troubleshooting Steps Taken:
-
Checked the
2_deployPolygonZKEVMDeployer.js
file on GitHub (https://github.com/0xPolygonHermez/zkevm-contracts/blob/main/deployment/2_deployPolygonZKEVMDeployer.js) to analyze the potential cause of the error. -
Reviewed the
3_deployContracts.js
file to verify any issues with the expect commands.
Observations:
After a thorough investigation, I found that the error is arising after line 20 in the 2_deployPolygonZKEVMDeployer.js
file. However, I have not been able to pinpoint the exact reason for the "noNetwork" error yet.
Request for Assistance:
Any insights or suggestions you can provide for us to fix this would be greatly appreciated!
I understand the issue, you would need an INFURA_PROJECT_ID
i think, for they way the script works, tell me if this fix it, and also i will try to make it in another way to avoid this issue ^^
You probably are using GOERLI_PROVIDER
right?