-
-
Save shirriff/f9b3fe82b798ffbb261a to your computer and use it in GitHub Desktop.
Using the Stratum protocol to connect to a Bitcoin mining pool
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import socket | |
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) | |
sock.connect(("us1.ghash.io", 3333)) | |
sock.send("""{"id": 1, "method": "mining.subscribe", "params": []}\n""") | |
print sock.recv(4000) | |
sock.send("""{"params": ["kens_1", "password"], "id": 2, "method": "mining.authorize"}\n""") | |
print sock.recv(4000) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ghash closed down, but you can connect to https://alpereum.zendesk.com/hc/en-us/articles/208552585-Pool-Connection-Info.
Changing line 4 to:
worked for me. (But I wasn't able to authorize, obviously).