Cannot Read script on ganache development network

Aperta
#20 6 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
python, solidity
Ambito
blockchain

Direzione di ricerca

Start with scripts/price_feed_scripts/01_deploy_price_consumer_v3.py and scripts/price_feed_scripts/02_read_price_feed.py, then compare the ganache and development network commands in the report. Reproduce the ContractNotFound and IndexError failures against ganache-cli; done means both scripts run successfully on the ganache network.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement good first issue Hacktoberfest

I am seeing that my local testing with ganche-cli is causing some issues connecting to the same network.

Repro steps:

  1. Set the default network in the yanl file to ganache.
  2. Install ganache-cli via npm. Start ganache-cli in one terminal tab.
  3. Open a new terminal tab and add a ganache network. brownie networks add Ethereum ganache host=http://localhost:8545 chainid=1337.
  4. Run the deploy script locally with brownie run scripts/price_feed_scripts/01_deploy_price_consumer_v3.py. Here I was having an issue

$ brownie run scripts/price_feed_scripts/01_deploy_price_consumer_v3.py

Brownie v1.15.1 - Python development framework for Ethereum

ChainlinkMixProject is the active project.
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 55, in connect
p._load_deployments()
File "brownie/project/main.py", line 357, in _load_deployments
contract = ProjectContract(self, build, build_json.stem)
File "brownie/network/contract.py", line 1291, in init
_DeployedContractBase.init(self, address, owner, tx)
File "brownie/network/contract.py", line 757, in init
raise ContractNotFound(f"No contract deployed at {address}")
ContractNotFound: No contract deployed at 0xB47a7bDF2C0B546AE73C4352c70BC68B0d479048

  1. I was able to get this to work by running brownie run scripts/price_feed_scripts/01_deploy_price_consumer_v3.py --network development.
  2. I then tried to run the read script and I was not able to brownie run scripts/price_feed_scripts/02_read_price_feed.py

$ brownie run scripts/price_feed_scripts/02_read_price_feed.py

Brownie v1.15.1 - Python development framework for Ethereum

ChainlinkMixProject is the active project.
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 55, in connect
p._load_deployments()
File "brownie/project/main.py", line 357, in _load_deployments
contract = ProjectContract(self, build, build_json.stem)
File "brownie/network/contract.py", line 1291, in init
_DeployedContractBase.init(self, address, owner, tx)
File "brownie/network/contract.py", line 757, in init
raise ContractNotFound(f"No contract deployed at {address}")
ContractNotFound: No contract deployed at 0xB47a7bDF2C0B546AE73C4352c70BC68B0d479048

  1. I retried with the network setting and it did not work due to list index out of range in Python and a BrownieEnvironmentWarning of block height.

$ brownie run scripts/price_feed_scripts/02_read_price_feed.py --network development

Brownie v1.15.1 - Python development framework for Ethereum

ChainlinkMixProject is the active project.
/Users/nicklasb/.local/pipx/venvs/eth-brownie/lib/python3.9/site-packages/brownie/network/main.py:44: BrownieEnvironmentWarning: Development network has a block height of 30
warnings.warn(
Attached to local RPC client listening at '127.0.0.1:8545'...

Running 'scripts/price_feed_scripts/02_read_price_feed.py::main'...
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/price_feed_scripts/02_read_price_feed.py", line 6, in main
price_feed_contract = PriceFeedConsumer[-1]
File "brownie/network/contract.py", line 160, in getitem
return self._contracts[i]
IndexError: list index out of range

Lingua principale
Solidity
Stelle
515
Fork
189
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di smartcontractkit/chainlink-mix

Tutte le issue di smartcontractkit/chainlink-mix

Issue simili

Altre issue su Blockchain

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.