Bitcoin Forum
June 22, 2024, 06:39:38 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Mining software (miners) / Stratum (or getblocktemplate) Mining Example on: February 05, 2022, 04:01:22 PM
I'm currently trying to write some mining software. Nothing special, just for the fun of it and by doing so getting a thoroughly understanding of the protocol(s).

I started with the get block template but, yeah, turns out to be too complicated (especially the construction of the coinbase was a dumper...) so I reverted to Stratum (v1). If anyone has a good example of constructing a block from a block template, please be my guest.

While decoding the messages and doing the hash calculations I had some issues with little vs big endian, but managed to get them right eventually using examples I found on the internet. However for the last step (submitting a share) I did not found any example at all. :-(

basically, what I am looking for is an example (can be just a log of an existing miner) that states:

Given this mining notification: (some json)
And receiving this set_difficulty: (some json)
And eventually trying those Nonce and Extranonce2
Your software should submit this: (some json)

I have no special mining equipment, so mining takes forever. I was able to submit one share after running the program for a couple of houres, it was rejected. Propably because I had the difficulty wrong, now it is running all night without a single hit. So debugging to a real system is not an option.
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!