smartcontractkit / full-blockchain-solidity-course-py

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

Alchemy Node Trouble #721

Open igor-udovenko opened 2 years ago

igor-udovenko commented 2 years ago

I've been trying to use mainnet fork with Alchemy where it is applied in the tutorial, but when I attempt to run this in the terminal:

brownie run scripts/aave_borrow.py --network mainnet-fork

I get:

Launching 'ganache-cli.cmd --accounts 10 --fork https://eth-mainnet.alchemyapi.io/v2/Vf3jtBGTRay20BfzYZe9EXiQ7WfKZ7FA --mnemonic brownie --port 8545 --hardfork istanbul'...

But nothing happens afterwards. I've waited for up to 10 minutes and nothing has occurred.

I've also attempted to just launch a ganache instance with the fork like this:

ganache-cli.cmd --accounts 10 --fork https://eth-mainnet.alchemyapi.io/v2/a4AdesDvixgTJ2qUkNZckUFxfrOzwMhr

But then I get an error which I'm having trouble interpreting:

Error: The fork provider errored when checking the nonce for account 0xc770d7239938db54183c08d61d5c7aac2c021f2c: Invalid JSON RPC response: "" at C:\Users\User\AppData\Local\Yarn\Data\global\node_modules\ganache-cli\build\ganache-core.node.cli.js:55:2094303 at Object._fireError (C:\Users\User\AppData\Local\Yarn\Data\global\node_modules\ganache-cli\build\ganache-core.node.cli.js:4:67075) at s (C:\Users\User\AppData\Local\Yarn\Data\global\node_modules\ganache-cli\build\ganache-core.node.cli.js:4:114003) at a (C:\Users\User\AppData\Local\Yarn\Data\global\node_modules\ganache-cli\build\ganache-core.node.cli.js:55:2108912) at C:\Users\User\AppData\Local\Yarn\Data\global\node_modules\ganache-cli\build\ganache-core.node.cli.js:55:2093154 at processTicksAndRejections (node:internal/process/task_queues:96:5)

Has anyone run into similar problems when attempting to use Alchemy?

br0wnD3v commented 2 years ago

I think its because you missed the host brownie networks add development mainnet-fork cmd=ganache-cli host=http://127.0.0.1 fork={WEB3_ALCHEMY_PROJECT_ADDRESS} accounts=10 mnemonic=brownie port=8545 Try typing the above.

igor-udovenko commented 2 years ago

I did add the network with my own alchemy http. I tried deleting it and then adding again to be sure, but not luck. The dashboard on the alchemy site even shows some activity in the form of "eth_getTransactionCount" lines when I run the script, but the transaction I'm trying to do doesn't happen (trying to run get_weth script in the Aave part of the tutorial)