PatrickAlphaC / brownie_fund_me

26 stars 64 forks source link

ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=7545) #30

Closed michaelclubman515 closed 2 years ago

michaelclubman515 commented 2 years ago

Hi,there: At youtube freedcodecamp 5:41:17 ,when tried to deploy to ganache-local,pop out these error information

ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=7545): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd62639d700>: Failed to establish a new connection: [Errno 61] Connection refused'))

full information as:

BronieFundMe2022Project is the active project.

Running 'scripts/deploy.py::main'...
The active network is ganache-local
Deploying Mocks....
  File "brownie/_cli/run.py", line 50, 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 27, in main
    deploy_fund_me()
  File "./scripts/deploy.py", line 16, in deploy_fund_me
    deploy_mocks()
  File "./scripts/helpful_scripts.py", line 20, in deploy_mocks
    MockV3Aggregator.deploy(DECIMALS,Web3.toWei(STARTING_PRICE,"ether"),{"from":get_account()})
  File "brownie/network/contract.py", line 528, in __call__
    return tx["from"].deploy(
  File "brownie/network/account.py", line 510, in deploy
    receipt, exc = self._make_transaction(
  File "brownie/network/account.py", line 720, in _make_transaction
    gas_price, gas_strategy, gas_iter = self._gas_price(gas_price)
  File "brownie/network/account.py", line 456, in _gas_price
    return web3.eth.generate_gas_price(), None, None
  File "web3/eth.py", line 877, in generate_gas_price
    return self._generate_gas_price(transaction_params)
  File "web3/eth.py", line 173, in _generate_gas_price
    return self.gasPriceStrategy(self.web3, transaction_params)
  File "web3/gas_strategies/rpc.py", line 20, in rpc_gas_price_strategy
    return web3.manager.request_blocking(RPC.eth_gasPrice, [])
  File "web3/manager.py", line 197, in request_blocking
    response = self._make_request(method, params)
  File "web3/manager.py", line 150, in _make_request
    return request_func(method, params)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "web3/middleware/formatting.py", line 76, in apply_formatters
    response = make_request(method, params)
  File "web3/middleware/gas_price_strategy.py", line 90, in middleware
    return make_request(method, params)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "web3/middleware/formatting.py", line 76, in apply_formatters
    response = make_request(method, params)
  File "web3/middleware/attrdict.py", line 33, in middleware
    response = make_request(method, params)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "web3/middleware/formatting.py", line 76, in apply_formatters
    response = make_request(method, params)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "web3/middleware/formatting.py", line 76, in apply_formatters
    response = make_request(method, params)
  File "cytoolz/functoolz.pyx", line 250, in cytoolz.functoolz.curry.__call__
  File "web3/middleware/formatting.py", line 76, in apply_formatters
    response = make_request(method, params)
  File "web3/middleware/buffered_gas_estimate.py", line 40, in middleware
    return make_request(method, params)
  File "web3/middleware/exception_retry_request.py", line 105, in middleware
    return make_request(method, params)
  File "web3/providers/rpc.py", line 88, in make_request
    raw_response = make_post_request(
  File "web3/_utils/request.py", line 48, in make_post_request
    response = session.post(endpoint_uri, data=data, *args, **kwargs)  # type: ignore
  File "requests/sessions.py", line 590, in post
    return self.request('POST', url, data=data, json=json, **kwargs)
  File "requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "requests/adapters.py", line 516, in send
    raise ConnectionError(e, request=request)
ConnectionError: HTTPConnectionPool(host='0.0.0.0', port=7545): Max retries exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7fd62639d700>: Failed to establish a new connection: [Errno 61] Connection refused'))
from brownie import FundMe,network,config,MockV3Aggregator
from scripts.helpful_scripts import (deploy_mocks, get_account,LOCAL_BLOCKCHAIN_ENVIRONMENT)

def deploy_fund_me():
    account = get_account()
    # pass the price feed address to our fundme contract

    # if we are on a persistent network like rinkeby, use the associated address
    # otherwise, deploy mocks
    if network.show_active() not in LOCAL_BLOCKCHAIN_ENVIRONMENT:
        price_feed_address = config["network"][network_showactive()]["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"The contract deploy to {fund_me.address}")

def main():
    deploy_fund_me()
PatrickAlphaC commented 2 years ago

Can you please ask this question on the full repo? Thanks!

https://github.com/smartcontractkit/full-blockchain-solidity-course-py

michaelclubman515 commented 2 years ago

Hi, Patrick ,thank you for making this course , realy the best solidity course ever seen !

Ok,I asked the question on the full repo. wish you a good day!