1

Am using wsl(ubuntu) on windows 10. Problem is, am trying to deploy.js file with node, here's the error result --> (" reason: 'could not detect network', code: 'NETWORK_ERROR', event: 'noNetwork' using ganache network)

2 Answers 2

0

Activate your Ganache, and navigate to "contract"...scroll-down and click-on "link truffle projects , accept the allow your system to have access to Ganache on the pop-up and afterward follow the same procedure and continue by clicking on link-truffle projects then go to server and finally change server host-name to "vEHTHERNET(WSL)".

0

✅ANSWERED

to use Ganache on both Windows and WSL from ganache GUI of Windows.

1: goto your ganache setting > Server > HOSTNAME.

2: Set Value to 0.0.0.0 - All Interfaces enter image description here

now in WSL web3 app, you need to provide specific Ip Address instead of 127.0.0.1 so to find that address use this command (bash command in ubuntu)

grep -m 1 nameserver /etc/resolv.conf | awk '{print $2}'

and use that IP to write your RPC URL for WSL based connection like this

let provider = new ethers.providers.JsonRpcProvider(http://172.19.192.1:7545);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.