MultiversX Tracker is Live!

RPC readtime out problem

Etherum Reddit

More / Etherum Reddit 113 Views

  • What I want to do: look through all pairs in pancake V2(currently 1261k pairs), and get token0 and token1 address, thus read their source code through bscscan api, to identify whether its source code has certain specific function.
  • How Im doing: Im using web3.py, for the setup:

web3_utity = Web3(Web3.HTTPProvider("https://bsc-dataseed.binance.org/", request_kwargs={'timeout': 50}))

​ for the token0 and token1 address, and Im using 5 threads, each thread has a scan(selfm index) function

``` def scan(self, index): pair_addr = self.factory_contract.functions.allPairs(index).call()

pair_contract = self.web3_utity.eth.contract(address=self.web3_utity.toChecksumAddress(pair_addr), abi=self.abi_pair) token0_addr = pair_contract.functions.token0().call() token1_addr = pair_contract.functions.token1().call() sleep(0.3 * random.randint(1, 3)) 

```

  • Problem: after a while(usually about 40-50min), errer: requests.exceptions.ReadTimeout: HTTPSConnectionPool(host='bsc-dataseed.binance.org', port=443): Read timed out. (read timeout=10). Re-run the code doesn't solve the connection err.
  • Question: Im assuming this is caused by the server rpc node: 'bsc-dataseed.binance.org', anti-scrap. Note that 'bsc-dataseed.binance.org' is binance's public rpc note, if I buy some other rpc node service, connect to those rpcs, will it solve the connection error? If not, what can I do? Im hoping to find a solution which allows me to scan all pairs smoothly and efficiently in pancake V2. Thanks alot
submitted by /u/Mozater
[link] [comments]
Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments