0

I am trying to learn and understand more about mining software, and so I am trying to build a simple 1 to try it out.

I have been reading resources from SlushPool and a bit from the google link they shared, and came up with a sample of the below code.

# The below code is in Python 3
import socket

host = 'rvn.suprnova.cc'
port = 6667

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
    s.connect((host, port))
    s.sendall(b'{"id": 1, "method": "mining.subscribe", "params": []}')
    data = s.recv(1024)

print(repr(data))

However, the response that I receive from the pool is:

b'{"id":null,"method":"mining.notify","params":["8cbb","e5d5d839ee8654e963c2f685297cce8b34f8397ff7bb0ca900004c2100000000","01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff2003c3c70a04240dda5c08","0d2f6e6f64655374726174756d2f00000000020000000000000000266a24aa21a9ede2f61c3f71d1defd3fa999dfa36953755c690689799962b48bebd836974e8cf90088526a740000001976a91481985dc4238eb976bffa1476119a71d511b88ae488ac00000000",[],"30000000","1a5efd7e","5cda0d24",false]}\n'

However, I noticed that this response is different from the response that i'm supposed to be receiving. I say this is because the response i should be receiving (according to SlushPool) should be:

{"id": 1, "result": [ [ ["mining.set_difficulty", "b4b6693b72a50c7116db18d6497cac52"], ["mining.notify", "ae6812eb4cd7735a302a8a9dd95cf71f"]], "08000002", 4], "error": null}\n

I understand that the id will be different in the result.. But i'm not sure why is it that my response is not the mining.subscribe that I should be getting.

Any ideas? Thanks!

  • just a guess, but it might be waiting for you to submit some shares (to gauge your hashrate) before it sends you a difficulty. – JBaczuk May 14 at 3:48
  • @JBaczuk hmm. I don't think so? And the reason for that is because, I need to connect to the server first, which will provide me with some required details such as Extranonce1 - Hex-encoded, per-connection unique string which will be used for coinbase serialization later. Then I can authorize workers with mining.authorize which will then return me a job. Am I mistaken? – jake wong May 14 at 4:07
  • well, you aren't connecting to slush pool, you're connecting to a ravencoin pool, so you can't be sure the docs are accurate. – JBaczuk May 14 at 4:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.