Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python3 stratum-work.py | jq -C #18

Open
SatoshiNakamotoBitcoin opened this issue Oct 1, 2024 · 2 comments
Open

python3 stratum-work.py | jq -C #18

SatoshiNakamotoBitcoin opened this issue Oct 1, 2024 · 2 comments

Comments

@SatoshiNakamotoBitcoin
Copy link

This tool for TUI can be amazing, we trying the wss but dont work, maybe hearbeat is needed via data to get the response?

`import websocket

def on_message(ws, message):
print(message)

ws = websocket.WebSocketApp("wss://stratum.work",
on_message=on_message)
ws.run_forever()`

@bboerst
Copy link
Owner

bboerst commented Oct 2, 2024

Hi @SatoshiNakamotoBitcoin.

I hadn't considered opening up the websocket for others to connect to directly. This could indeed be valuable for others wanting to consume this data and utilize it in other ways, so I'm open to allowing it.

Your issue might be CORS-related. I'm only allowing certain origins at this time:

socketio = SocketIO(app, cors_allowed_origins=["http://127.0.0.1:8000", "http://localhost:8000", "https://poolwork.live", "https://stratum.work"])

Let me brainstorm this a bit. I think if I were to allow this, I would want some sort of authorization token mechanism on the socket to prevent abusing the endpoint.

I think you bring up a good idea, so let me think about how to allow this functionality.

@SatoshiNakamotoBitcoin
Copy link
Author

We make this 2 similar purposes :

https://github.com/curly60e/pyblock/blob/master/pybitblock/WebSocket-BitNodes.py
Bitnodes

https://github.com/curly60e/pyblock/blob/master/pybitblock/WebSocket-LiveTxs.py
Live Txs

Thi idea is the same, python3 ..... | jq -C to view the data via TUI.

Take a look, is good to play like:
| jq -C .count
or other ways like Grep to get specific info based on the wss responses.

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants