-
Hello
helpful_scripts.py from brownie import network, config, accounts, MockV3Aggregator
from web3 import Web3
LOCAL_BLOCKCHAIN_ENVIRONMENTS = ["development", "ganache-local"]
DECIMALS = 18
STARTING_PRICE = 2000
def get_account():
if network.show_active() in LOCAL_BLOCKCHAIN_ENVIRONMENTS:
return accounts[0]
else:
return accounts.add(config["wallets"]["from_key"])
def deploy_mocks():
print(f"The Active network is {network.show_active()}")
print("Deploying Mocks ...")
if len(MockV3Aggregator) <= 0:
MockV3Aggregator.deploy(
DECIMALS, Web3.toWei(STARTING_PRICE, "ether"), {"from": get_account()}
)
print("Mocks Deployed!") deploy.py from brownie import FundMe, MockV3Aggregator, network, config
from scripts.helpful_scripts import (
get_account,
deploy_mocks,
LOCAL_BLOCKCHAIN_ENVIRONMENTS,
)
def deploy_fund_me():
account = get_account()
if network.show_active() not in LOCAL_BLOCKCHAIN_ENVIRONMENTS:
price_feed_address = config["networks"][network.show_active()][
"eth_usd_price_feed"
]
else:
deploy_mocks()
price_feed_address = MockV3Aggregator[-1].address
fund_me = FundMe.deploy(
price_feed_address,
{"from": account},
publish_source=config["networks"][network.show_active()].get("verify"),
)
print(f"Contract deployed to {fund_me.address}")
mock_aggregator = MockV3Aggregator.deploy(
18, 2000000000000000000000, {"from": account}
)
price_feed_address = mock_aggregator.address
print("Mock deployed!")
def main():
deploy_fund_me() brownie-config.yaml dependencies:
# - <organisation/repo>@<version>
- smartcontractkit/[email protected]
compiler:
solc:
remappings:
- "@chainlink=smartcontractkit/[email protected]"
dotenv: .env
networks:
rinkeby:
eth_usd_price_feed: "0x8A753747A1Fa494EC906cE90E9f37563A8AF630e"
verify: True
development:
verify: False
ganache-local:
eth_usd_price_feed: "0x5f4eC3Df9cbd43714FE2740f5E3616155c5b8419"
verify: False
wallets:
from_key: ${PRIVATE_KEY} Does it have anything to do with when I added local ganache to the network list ? |
Beta Was this translation helpful? Give feedback.
Answered by
cromewar
Apr 1, 2022
Replies: 1 comment 1 reply
-
Yes the error is saying you have not added the host correctly, try removing and adding the network again with:
|
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
wilonweb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yes the error is saying you have not added the host correctly, try removing and adding the network again with: