Closed
Description
Ethers Version
6.13.2
Search Terms
No response
Describe the Problem
JsonRpcProvider failed to detect the network and cannot start up; retry in 1s (perhaps the URL is wrong or the node is not started)
getting this error on the server on my local machine it is working fine
network:- polygon-amoy
infuraUrl:- https://polygon-amoy.infura.io/v3/${myPrivateKey}
Code Snippet
const contractInstance = async (privateKey, address, abi) => {
try {
const wallet = new ethers.Wallet(privateKey);
const provider = new ethers.JsonRpcProvider(
process.env.INFURA_PROVIDER_URL
);
const connectedWallet = wallet.connect(provider);
const contract = new ethers.Contract(address, abi, connectedWallet);
return contract;
} catch (error) {
console.log(error);
}
};
Contract ABI
No response
Errors
No response
Environment
Ethereum (mainnet/ropsten/rinkeby/goerli)
Environment (Other)
No response
Activity