Lesson 5: Timestamp: 7:07:35 | Error: could not detect network (event="noNetwork", code=NETWORK_ERROR, version=providers/5.6.2) #4875
Answered
by
alymurtazamemon
aditya-bijapurkar
asked this question in
Q&A
-
Downgrading to ethers version 5.6.2 solved the cannot read problem, but network is not getting detected. code: const ethers = require("ethers");
const fs=require("fs");
async function main(){
const provider = new ethers.providers.JsonRpcProvider("http://127.0.0.1:7545");
const wallet=new ethers.Wallet("6f6dcdb37686a5e5a9f4ec960262c4f55b7e04a30eff11c34b3c50f19ecfeae1",provider);
const abi=fs.readFileSync("./SimpleStorage_sol_SimpleStorage.abi", "utf8");
const binary=fs.readFileSync("./SimpleStorage_sol_SimpleStorage.bin", "utf8");
const contractFactory=new ethers.ContractFactory(abi,binary,wallet);
console.log("Deploying... please wait")
const contract=await contractFactory.deploy();
console.log(contract);
}
main()
.then(()=>process.exit(0))
.catch((error)=>{
console.error(error);
process.exit(1);
}) |
Beta Was this translation helpful? Give feedback.
Answered by
alymurtazamemon
Feb 20, 2023
Replies: 1 comment 1 reply
-
@aditya-bijapurkar Check out this discussion #286 |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
aditya-bijapurkar
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@aditya-bijapurkar Check out this discussion #286