Author

Topic: Stratum (or getblocktemplate) Mining Example (Read 150 times)

newbie
Activity: 4
Merit: 0
February 09, 2022, 04:54:04 AM
#3
I'm also learning these new techniques and getting results through trial and error.  I think the process is more important than the result. If you have other problems, could you discuss with me?  I hope you can give me a chance to study together.  You can join me through MDClub.
http://bbs.soontechmining.com/
legendary
Activity: 4466
Merit: 1798
Linux since 1997 RedHat 4
February 05, 2022, 08:12:20 PM
#2
Stratum is for pooled mining, so the whole documentation of it is in the pool thread:
https://bitcointalksearch.org/topic/stratum-protocol-documentation-557866
newbie
Activity: 1
Merit: 0
February 05, 2022, 12:01:22 PM
#1
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.
Jump to: