foundry-full-course-f23
foundry-full-course-f23 copied to clipboard
Lesson 6 : Ganache URL not connecting while deploying SimpleStorage contract
Discussed in https://github.com/Cyfrin/foundry-full-course-f23/discussions/1282
Originally posted by Meherabhossen January 4, 2024 im getting error on this
[⠊] Compiling...
No files changed, compilation skipped
Error:
error sending request for url (http://127.0.0.1:7545/): error trying to connect: tcp connect error: Connection refused (os error 111)
Context:
- Error #0: error trying to connect: tcp connect error: Connection refused (os error 111)
- Error #1: tcp connect error: Connection refused (os error 111)
- Error #2: Connection refused (os error 111)
this is my command
forge create SimpleStorage --rpc-url http://127.0.0.1:7545 --interactive
```</div>
try to change the port number in ganache . Sometime firewall blocking access to some port in PC .
Also check anvil is not running on same port
https://github.com/Cyfrin/foundry-full-course-f23/discussions/318
https://github.com/Cyfrin/foundry-full-course-f23/discussions/873
Take a look on above url , hope this help
I run this command forge create SimpleStorage --rpc-url http://127.0.0.1:7550 --interactive But this errors had appeared , solution please §§
[⠃] Compiling...No files changed, compilation skipped [⠊] Compiling... Error: error sending request for url (http://127.0.0.1:7550/): error trying to connect: tcp connect error: Connection refused (os error 111)
Context:
- Error #0: error trying to connect: tcp connect error: Connection refused (os error 111)
- Error #1: tcp connect error: Connection refused (os error 111)
- Error #2: Connection refused (os error 111)
* Error #0: error trying to connect: tcp connect error: Connection refused (os error 111)
Hi,
This error generally pops up when there is a TCP Connection problem meaning that your CLI cannot connect. What you should try to do is this :
- Close the actual Terminal you're using ( Bash, Zsh, WSL ) and make another one
- in the temrinal type :
foundryup
- Before trying on Gananche try to use the
--rpc-url
with anvil first by opening a second terminal and typinganvil
use the rpc url of it generally it's : http://127.0.0.1:8545 - Restart VsCode
- Be sure to verify you have a solid connection and that you're not far away from a wireless device for example
- Restart the Computer
Try this
To solve this issue u have to open a new terminal with same directory to initialize Anvil
so to show it is running already
And your code line is not complete due to using interactive is to the fact there should be a private key that you should either use .env or using the latest keystore method
Or if you don't want to do that u can just compile it by using forge create SimpleStorage
it will automatically create using anvil default way but when u need to specify with private key follow the steps I gave you
if u use the wsl in vs code, you have to make sure ganache also in wsl, so you need to create a new wroking space in ganache und change it to wsl
Thanks for the tip!
On Fri, Mar 15, 2024, 3:47 PM Chujimafa @.***> wrote:
if u use the wsl in vs code, you have to make sure ganache also in wsl, so you need to create a new wroking space in ganache und change it to wsl
— Reply to this email directly, view it on GitHub https://github.com/Cyfrin/foundry-full-course-f23/issues/1294#issuecomment-1999824493, or unsubscribe https://github.com/notifications/unsubscribe-auth/BEHRX5UPEQW4ZMNA3CWDO43YYMCWPAVCNFSM6AAAAABBQB6ZRKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSOJZHAZDINBZGM . You are receiving this because you commented.Message ID: @.***>
Going to close this for now, those who end up here, please see the discussion!