smartcontractkit / full-blockchain-solidity-course-py

Ultimate Solidity, Blockchain, and Smart Contract - Beginner to Expert Full Course | Python Edition
MIT License
10.76k stars 2.9k forks source link

Lesson 4 deploying contract to Ganache Ui #1564

Open Vonnie187 opened 2 years ago

Vonnie187 commented 2 years ago

Hi everyone,

Having an issue with Ganache UI,

I can do everything like deploy contracts to Ganache-Cli and testnet Rinkeby but this is doing my head in and I would like to know why.

Ive read many things like closing vsCode after opening the Ganache UI etc etc I just feel like i can't continue if i dont know whythis doesn't work for me

Error Message;

ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='127.0.0.1', port=7545): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7f23506d7d00>: Failed to establish a new connection: [Errno 111] Connection refused')) vonniecode0369@LAPTOP-3P760U4R:~/code/demos/web3_py_simple_storage$

raigal-r commented 2 years ago

Hi,

I started having the same error.

First I had a problem with the Ganache chain, that I fixed changing it to "1337" and not the one I was seeing as Network Id, since are not the same. (https://stackoverflow.com/questions/70731492/the-transaction-declared-chain-id-5777-but-the-connected-node-is-on-1337)

I kept having an error, the one you are having, so I changed in Ganache the port to 127.0.0.1:8545. (and in the code) image

After that, a new error appeared, related with the gasPrice. Error:

ValueError: {'message': 'Method eth_feeHistory not supported.', 'code': -32000, 'data': {'stack': 'Error: Method eth_feeHistory not supported.\n at GethApiDouble.handleRequest (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x645dg5pnz03psnj\app\resources\static\node\node_modules\ganache-core\lib\subproviders\geth_api_double.js:70:16)\n at next (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x645dg5pnz03psnj\app\resources\static\node\node_modules\ganache-core\node_modules\web3-provider-engine\index.js:136:18)\n at GethDefaults.handleRequest (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x645dg5pnz03psnj\app\resources\static\node\node_modules\ganache-core\lib\subproviders\gethdefaults.js:15:12)\n at next (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x645dg5pnz03psnj\app\resources\static\node\node_modules\ganache-core\node_modules\web3-provider-engine\index.js:136:18)\n at SubscriptionSubprovider.FilterSubprovider.handleRequest (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x645dg5pnz03psnj\app\resources\static\node\node_modules\ganache-core\node_modules\web3-provider-engine\subproviders\filters.js:89:7)\n at SubscriptionSubprovider.handleRequest (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x645dg5pnz03psnj\app\resources\static\node\node_modules\ganache-core\node_modules\web3-provider-engine\subproviders\subscriptions.js:137:49)\n at next (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x645dg5pnz03psnj\app\resources\static\node\node_modules\ganache-core\node_modules\web3-provider-engine\index.js:136:18)\n at DelayedBlockFilter.handleRequest (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x645dg5pnz03psnj\app\resources\static\node\node_modules\ganache-core\lib\subproviders\delayedblockfilter.js:31:3)\n at next (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x645dg5pnz03psnj\app\resources\static\node\node_modules\ganache-core\node_modules\web3-provider-engine\index.js:136:18)\n at RequestFunnel.handleRequest (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x645dg5pnz03psnj\app\resources\static\node\node_modules\ganache-core\lib\subproviders\requestfunnel.js:32:12)\n at next (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x645dg5pnz03psnj\app\resources\static\node\node_modules\ganache-core\node_modules\web3-provider-engine\index.js:136:18)\n at Web3ProviderEngine._handleAsync (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x64__5dg5pnz03psnj\app\resources\static\node\node_modules\ganache-core\node_modules\web3-provider-engine\index.js:123:3)\n at Timeout._onTimeout (C:\Program Files\WindowsApps\GanacheUI_2.5.4.0_x645dg5pnz03psnj\app\resources\static\node\node_modules\ganache-core\node_modules\web3-provider-engine\index.js:107:12)\n at listOnTimeout (internal/timers.js:531:17)\n at processTimers (internal/timers.js:475:7)', 'name': 'Error'}} PS C:\Users\lechu\demos\web3_py_simple_storage>

What I found: https://stackoverflow.com/questions/72594258/userwarning-there-was-an-issue-with-the-method-eth-maxpriorityfeepergas-calcul

Just adding the "gasPrice" variable was fixed.

I hope it is helpful.

Vonnie187 commented 2 years ago

Thank you mate, I will try that and see what happens