Add subscribe stub (with hardcoded url)

This commit is contained in:
nolash 2021-02-08 11:25:54 +01:00
parent d85d96b325
commit 5fa3b91c05
Signed by: lash
GPG Key ID: 21D2E7BB88C2A746
2 changed files with 22 additions and 0 deletions

View File

@ -0,0 +1,21 @@
import json
import websocket
ws = websocket.create_connection('ws://localhost:8545')
o = {
"jsonrpc": "2.0",
"method": "eth_subscribe",
"params": [
"newHeads",
],
"id": 0,
}
ws.send(json.dumps(o).encode('utf-8'))
while True:
print(ws.recv())
ws.close()

View File

@ -12,3 +12,4 @@ pysha3==1.0.2
hexathon==0.0.1a2
eth-abi==2.1.1
eth-keys==0.3.3
websocket-client==0.57.0