Open fridary opened 4 months ago
I did this way and now it works:
ws = 'ws://127.0.0.1:8546/'
async def get_event():
async with websockets.connect(ws) as ws:
await ws.send('{"jsonrpc": "2.0", "id": 1, "method": "eth_subscribe", "params": ["newPendingTransactions"]}')
But what is the point of Web3.WebsocketProvider
, who knows?
I found an article https://cryptomarketpool.com/how-to-query-the-ethereum-mempool-txpool-with-python/ where python script loads like
wss = 'wss://EnterYourWSSInformationHere'
web3 = Web3(Web3.WebsocketProvider(wss))
So that means this way must work, but my script does not.
Erigon version: erigon version 2.59.3-088fd8ef OS & Version: Ubuntu 20.04.6 LTS Erigon Command (with flags/config): ExecStart=/home/root/erigon/build/bin/erigon --internalcl --datadir=/disk_sde/erigon --ws --http.api=eth,erigon,engine,web3,net,debug,trace,txpool --authrpc.jwtsecret=/home/root/erigon/jwtsecret --metrics --prune.h.before=13916166 --prune.r.before=13916166 --prune.t.before=13916166 --prune.c.before=13916166 --torrent.download.rate=128mb Chain/Network: mainnet
I can not connect to web socket host, although http works. I don't know if it matters, node was synced without
--ws
flag. Now I have added, rebooted server and anyway can not connect to ws. With journal I can see ws started on8546
port, but I can not connect still. What I do wrong?Actual behaviour
Script exits with error no connection.
Steps to reproduce the behaviour
Backtrace