read.cash Log in
@mtrycz edited more from that month

How my RPi4 handles mining 256MB blocks

中文 https://read.cash/@mtrycz/256mb-16ce8565 tl;dr Pretty good, to be honest. Introduction A while ago, I tested if a Raspberry Pi can keep up validating big blocks. Last week I tried to *mine* big blocks on the RPi directly, and sadly found that I couldn't, mainly because of the inefficiencies of the mining software. I only managed to do 128MB blocks. https://read.cash/@mtrycz/how-my-rpi4-handles-scalenets-256mb-blocks-e356213b https://read.cash/@mtrycz/can-i-mine-256mb-blocks-on-my-rpi4-2297df25 It was itching me the whole week, so I hacked the mining software to use the (exponentially) more efficient "light" block template implemented in BCHN (spec). My C is rusty, so I only modified it until it kinda worked. You can find the code here, but please don't use if for production (at least not until it's merged upstream). https://docs.bitcoincashnode.org/doc/getblocktemplatelight/ https://github.com/mtrycz/cpuminer/tree/gbtl Check out the other articles in this series: 1, 2, 3. https://read.cash/@mtrycz/how-my-rpi4-handles-scalenets-256mb-blocks-e356213b https://read.cash/@mtrycz/how-my-rpi4-handles-1m-tx-blocks-ad8c4c94 https://read.cash/@mtrycz/can-i-mine-256mb-blocks-on-my-rpi4-2297df25 Methodology As usual I used my beloved RPi4 BCH's Scalenet RaspberryPi4 (8GB version, with a 64bit OS), with a nice passive cooling case (keeps temeprature below 60C and helps with throttling) an 8GB Sd card I had lying around A spare 256GB NVMe SSD attached through an USB3 adapter (I upgraded my laptop to 1TB, so I found a use for this one). BCHN node software (release version 23.0.0 with no particular patches) Total cost: ~21 tx fees on the BTC network. (as of time of writing - subject to change) I have generated transactions on my laptop with txunami and BU, and waited for them to propagate to the RPi. Tried to run my modified version of cpuminer on the RPi locally. https://github.com/mtrycz/cpuminer/tree/gbtl Results I proudly present you the first ~256MB block (with 1.3M transactions) mined on a Raspberry Pi. https://sbch.loping.net/block-height/32897 Out of my 8GBs of RAM, usage was at some 2.5GB while mining. Mining started right after receiving the template. Upon submitting a solution, BCHN took some 72 seconds to validate it before propagating. Conclusion With the right software available, you can very well mine big blocks on a Raspberry Pi, if you really want to. The "light" block template is just 2kb in size, is transferred very fast and doesn't occupy RAM. Compared to the old template, mining on the "light" template is incredibly more efficient; it might not be a big deal on smallblock chains, but it's an important optimization when the blocks get big. I didn't expect to be able to mine a 256MB block when I started this series. I really like where we're going.

No comments yet

Log in to join in Reading is open to everyone. Replying needs an account.