You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to fix this problem as described in #39#34 and #75 but for some reason it is stuck at pending for an eternity. (picture attached in comments). I work on Windows with Ubuntu. It simply doesn't connect to Ganache...
Here is my code for reference:
//synchronous (Solidity) -- asynchronous (Javascript)//async function setupMovieNight() {//await cookPopcorn();//await pourDrinks();//startMovie();//}//function cookPopcorn() {//return Promise();//}constethers=require("ethers");constfs=require("fs-extra");asyncfunctionmain(){//compile in code or seperately//http://127.0.0.1:7545constprovider=newethers.providers.JsonRpcProvider("http://172.31.128.1:7545");constwallet=newethers.Wallet("0eaae46dcb2aadfd07649447316fa54ac0871b05bbee76723c4178d49c4a42c4",provider);//abi+binaryconstabi=fs.readFileSync("./SimpleStorage_sol_SimpleStorage.abi","utf8");constbinary=fs.readFileSync("./SimpleStorage_sol_SimpleStorage.bin","utf8");constcontractFactory=newethers.ContractFactory(abi,binary,wallet);console.log("Deploying, please wait...");constcontract=awaitcontractFactory.deploy();//stop! wait contract to deploy bro!console.log(contract);//const deploymentReceipt = await contract.deployTransaction.wait(1);//console.log(deploymentReceipt);}main().then(()=>process.exit(0)).catch((error)=>{console.error(error);process.exit(1);});
Hi @consolexyz@LordReya Could you help? I ran hardhat but it is somehow not allowing me to select "Create an empty hardhat.config.js", among the three option only one option which is to "create a JavaScript project" is clickable.
Please create a separate discussion + mark me and I'll be glad to help you my friend :)
Hi @LordReya it worked, I did not add "require("dotenv").config();". However, when I tried to run deply.js it threw an error saying MODULE_NOT_FOUND and Cannot find module 'dotenv' My deploy.js code looks something like this:
You need to add it as a dependency if this error shows up. Please, once again, create a separate discussion, so everyone with the same problem can solve this problem too!
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I tried to fix this problem as described in #39 #34 and #75 but for some reason it is stuck at pending for an eternity. (picture attached in comments). I work on Windows with Ubuntu. It simply doesn't connect to Ganache...
Here is my code for reference:
Beta Was this translation helpful? Give feedback.
All reactions