eth-brownie / brownie

A Python-based development and testing framework for smart contracts targeting the Ethereum Virtual Machine.
https://eth-brownie.readthedocs.io
MIT License
2.64k stars 549 forks source link

All commands "stuck" on Binance Smart Chain #1016

Closed kevholder closed 3 years ago

kevholder commented 3 years ago

Environment information

What was wrong?

Please include information like:

brownie console --network bsc-main
>>> web3.eth.blockNumber
(never terminates)
$ brownie console --network bsc-main 
Brownie v1.14.2 - Python development framework for Ethereum

CurveContractProject is the active project.
Brownie environment is ready.
>>> web3.eth.blockNumber
^C  File "<console>", line 1, in <module>
  File "web3/eth.py", line 149, in blockNumber
    return self.web3.manager.request_blocking(RPC.eth_blockNumber, [])
  File "web3/manager.py", line 149, in request_blocking
    response = self._make_request(method, params)
  File "web3/manager.py", line 128, in _make_request
    return request_func(method, params)
  File "brownie/network/middlewares/caching.py", line 185, in process_request
    with self.lock:
KeyboardInterrupt:
>>>

I'm using the default ~/.brownie/network-config.yaml:

# ...
- name: Binance Smart Chain
  networks:
  - chainid: 97
    explorer: https://api-testnet.bscscan.com/api
    host: https://data-seed-prebsc-1-s1.binance.org:8545
    id: bsc-test
    name: Testnet
  - chainid: 56
    explorer: https://api.bscscan.com/api
    host: https://bsc-dataseed.binance.org
    id: bsc-main
    name: Mainnet

How can it be fixed?

No idea ... :(

I don't believe it's an issue with BSC's RPC server since using curl works fine:

 $ curl --location --request POST 'https://bsc-dataseed.binance.org/' \                                                                                                                                                                       <<<
--header 'Content-Type: application/json' \
--data-raw '{
        "jsonrpc":"2.0",
        "method":"eth_getTransactionReceipt",
        "params":[
                "0xb3e9274e02cb6a920c7809078785ce88242868ecdfff8daa79ca120113e53495"
        ],
        "id":100
}' | jq
kevholder commented 3 years ago

Temp workaround:

pip install eth-brownie==1.13.4  
iamdefinitelyahuman commented 3 years ago

This was fixed in #1009 but I haven't gotten a new release pushed yet, sorry!