PatrickAlphaC / web3_py_simple_storage

47 stars 78 forks source link

4:00:00 Transaction and Ganache #11

Closed Daisonoio closed 2 years ago

Daisonoio commented 2 years ago

I Have 2 Issues

First: when I import solcx with: "from solcx import compile_standard" visual studio return everytime the message: "INFO: Cannot find files corresponding to search criteria indicated." During deploy.

Second:

when I built transaction and run the deploy instead of data that is shown at 4:00:00 I receice a big ammount of errors

Traceback (most recent call last): File "C:\Users\lucam\Documents\Project_Solidity_Course_FreeCodeCamps\demos\web3_py_simple_storage\deploy.py", line 53, in transaction = SimpleStorage.constructor().buildTransaction( File "C:\Users\lucam\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\eth_utils\decorators.py", line 18, in _wrapper return self.method(obj, *args, *kwargs) File "C:\Users\lucam\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\web3\contract.py", line 684, in buildTransaction return fill_transaction_defaults(self.web3, built_transaction) File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.call return self.func(args, *kwargs) File "C:\Users\lucam\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\web3_utils\transactions.py", line 121, in fill_transaction_defaults default_val = default_getter(web3, transaction) File "C:\Users\lucam\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\web3_utils\transactions.py", line 71, in web3.eth.max_priority_fee + (2 web3.eth.get_block('latest')['baseFeePerGas']) File "C:\Users\lucam\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\web3\eth.py", line 549, in max_priority_fee return self._max_priority_fee() File "C:\Users\lucam\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\web3\module.py", line 57, in caller result = w3.manager.request_blocking(method_str, File "C:\Users\lucam\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\web3\manager.py", line 198, in request_blocking return self.formatted_response(response, File "C:\Users\lucam\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\web3\manager.py", line 171, in formatted_response raise ValueError(response["error"]) ValueError: {'message': 'Method eth_maxPriorityFeePerGas not supported.', 'code': -32000, 'data': {'stack': 'Error: Method eth_maxPriorityFeePerGas 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'}}

I think is a problem with ganache, but after a clean installation nothing is changed.

Thanks a lot

Daisonoio commented 2 years ago

Solution for the Second issue:

Insert into the builtTransaction the type of gasprice (wei):

transaction = SimpleStorage.constructor().buildTransaction( { "gasPrice": w3.eth.gas_price, "chainID": chaind_id, "from": my_address, "nonce": nonce, } )

But I have still the strange message with the import of solcx

thanks

ghost commented 2 years ago

open your ganache ->new workspace->server->change the network id to 1337 ->save now try it by the new address and the private key it will work i hope

PatrickAlphaC commented 2 years ago

Thank you all for the answers! Closing for now. Feel free to follow up.