smartcontractkit / full-blockchain-solidity-course-py

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

Lesson 13 Full Stack Defi #572

Open WilliamMcRoberts opened 2 years ago

WilliamMcRoberts commented 2 years ago

Hello, after creating a react app for the front_end and reinstalling nodejs and yarn I went back to try to deploy to Kovan but ganance-cli is not working anymore. I can deploy it to the Ganache GUI but not CLI or Kovan or Rinkeby. I've tried uninstalling it reinstalling it...."brownie networks list" lists all the correct networks here's the error i get when just typing "ganache-cli" ...Error: error:0308010C:digital envelope routines::unsupported at new Hash (node:internal/crypto/hash:67:19) at Object.createHash (node:crypto:130:10) at p (/usr/local/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:527949) at b.set (/usr/local/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:528548) at Function.b.fromMasterSeed (/usr/local/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:530917) at Function.i.fromMasterSeed (/usr/local/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:526525) at new S (/usr/local/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:206543) at new p (/usr/local/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:195647) at new l (/usr/local/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:42:13485) at Object.create (/usr/local/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:94:92509) at Object.server (/usr/local/lib/node_modules/ganache-cli/build/ganache-core.node.cli.js:55:38637) at Object. (/usr/local/lib/node_modules/ganache-cli/cli.js:106:22) at Module._compile (node:internal/modules/cjs/loader:1097:14) at Object.Module._extensions..js (node:internal/modules/cjs/loader:1149:10) at Module.load (node:internal/modules/cjs/loader:975:32) at Function.Module._load (node:internal/modules/cjs/loader:822:12)

And here's the error i get when trying to deploy local... .DefiStakeYieldBrownieProject is the active project.

Launching 'ganache-cli --accounts 10 --hardfork istanbul --gasLimit 12000000 --mnemonic brownie --port 8545'... File "brownie/_cli/main.py", line 64, in main importlib.import_module(f"brownie._cli.{cmd}").main() File "brownie/_cli/run.py", line 43, in main network.connect(CONFIG.argv["network"]) File "brownie/network/main.py", line 50, in connect rpc.launch(active["cmd"], **active["cmd_settings"]) File "brownie/network/rpc/init.py", line 95, in launch raise RPCProcessError(cmd, uri) RPCProcessError: Unable to launch local RPC client. Command: ganache-cli URI: http://127.0.0.1:8545

And here's the error i get when trying to deploy to Kovan.... Brownie v1.14.6 - Python development framework for Ethereum

DefiStakeYieldBrownieProject is the active project.

Running 'scripts/deploy.py::main'... Transaction sent: 0xc8cad76d32f7d7e19049c734710b36f44cbb8d3502e168b30acfc945f6495e25 Gas price: 2.500000007 gwei Gas limit: 702941 Nonce: 38 DappToken.constructor confirmed - Block: 28775424 Gas used: 639038 (90.91%) DappToken deployed at: 0xBad547Dd890d936934509876457Bf11c93dA44AC

Transaction sent: 0x04332e3218a83dcb240af9d199edd0527501c622debbc1f1c9e0bd403d13fb97 Gas price: 2.500000007 gwei Gas limit: 1062706 Nonce: 39 TokenFarm.constructor confirmed - Block: 28775425 Gas used: 966097 (90.91%) TokenFarm deployed at: 0x91504c683A1ae0B7036f12f426Bdd1b598cca9CE

Waiting for https://api-kovan.etherscan.io/api to process contract... File "brownie/_cli/run.py", line 49, in main return_value, frame = run( File "brownie/project/scripts.py", line 103, in run return_value = f_locals[method_name](*args, **kwargs) File "./scripts/deploy.py", line 44, in main deploy_token_farm_and_dapp_token() File "./scripts/deploy.py", line 11, in deploy_token_farm_and_dapp_token token_farm = TokenFarm.deploy( File "brownie/network/contract.py", line 593, in call return tx["from"].deploy( File "brownie/network/account.py", line 512, in deploy contract.publish_source(deployed_contract, silent=silent) File "brownie/network/contract.py", line 461, in publish_source raise ValueError(f"API request failed with: {data['result']}") ValueError: API request failed with: []

This is after typing brownie networks list.... Brownie v1.14.6 - Python development framework for Ethereum

The following networks are declared:

Ethereum ├─Mainnet (Infura): mainnet ├─Ropsten (Infura): ropsten ├─Rinkeby (Infura): rinkeby ├─Goerli (Infura): goerli ├─Kovan (Infura): kovan └─ganache-local: ganache-local

Ethereum Classic ├─Mainnet: etc └─Kotti: kotti

Binance Smart Chain ├─Testnet: bsc-test └─Mainnet: bsc-main

Fantom Opera ├─Testnet: ftm-test └─Mainnet: ftm-main

Development ├─Ganache-CLI: development ├─Geth Dev: geth-dev ├─Ganache-CLI (BSC-Mainnet Fork): bsc-main-fork ├─Ganache-CLI (FTM-Mainnet Fork): ftm-main-fork ├─mainnet-fork-dev: mainnet-fork-dev └─mainnet-fork: mainnet-fork

I'm very new so I'm sorry if this is a newbie mistake but please help me I made it this far with few problems but now I'm stuck I'd hate to give up now....thank you.

cromewar commented 2 years ago

Hello @CincyGhost this is definitely a problem with your node modules, uninstall ganache-cli and make sure to completely delete this folder: /usr/local/lib/node_modules/ganache-cli/, also delelte the .brownie folder on your home path ( is a hidden folder). Then try installing ganache-cli again. If nothing works, you would like to re install npm from the ground.

Seferovic8 commented 1 year ago

I have the same issue and I do this yarn global add ganache after that npm install -g ganache-cli and npm install -g ganache