Oddbean new post about | logout
 Downloaded the latest Debian installer on a different machine and put it on usb, and set the NUC to boot from USB to install
https://media.utxo.nl/wp-content/uploads/nostr/9/d/9d852b691d5cbba894c212247cfc3fa75043897247335ca7ee3f9a69fc10caae.webp
https://media.utxo.nl/wp-content/uploads/nostr/2/3/2347d510b14838598343d789188eed4f669b4e49548ab2dc0701f8a576377d9e.webp 
 The install wizard is just next next next and I set it to use the 500 GB disk for OS and the 1 TB disk for data, this way I can more easily swap out the 1 TB for a bigger one in the future without having to reinstall the OS
https://media.utxo.nl/wp-content/uploads/nostr/0/2/02e7845718a40280b91942f90c8661dc6ce5f46a2fabcd7d17af7f87a1a2a214.webp 
 Next is installing software. I used to compile from source but updating was always a hassle, and step 1 is always please install a gazillion unknown dependencies that conflict with other dependencies. I will now just download the binaries and verify the signatures, I want to try to just have a few binaries, some scripts, and data, nothing more, keep it lean and simple.
https://media.utxo.nl/wp-content/uploads/nostr/0/8/08d003cc7a15cb0de1afd58be18c95bc7661813df93d767862188912c05c2604.webp 
 It looks like I can’t avoid installing nodejs and all the mess that comes with it if I want to use mempool block explorer and public-pool mining server :/ can’t find alternatives
https://media.utxo.nl/wp-content/uploads/nostr/3/f/3fad210510740fd0cbce91e0dc3d49456255123a34a3391fc0b05063175795a3.webp 
 Setting up mempool block explorer, first the frontend following the steps in https://github.com/mempool/mempool/tree/master/frontend using nginx with nginx-mempool.conf and nginx.conf from the mempool repo as starting point

Works! But its not connecting yet because I need to set up the backend first, which requires electrs, which requires bitcoind, and I can't start bitcoind yet because I'm still copying the blocks from my old disk in the background
https://media.utxo.nl/wp-content/uploads/nostr/d/b/dba5290ba099aac3bdca521d0543acca236d0124fdbd94d6b4ccb4a2dc1ac23b.webp 
 well the blocks have finished copying but bitcoin core won’t start because half the blocks are missing, I had forgotten that I symlinked blocks to another directory some time ago, and I deleted that directory 😅

so I’ll be syncing from the genesis block now.. to be continued 
 sync is at 2018 now, I’ll just leave it running a few days
https://media.utxo.nl/wp-content/uploads/nostr/d/a/da18e1acda075903d30a6706f59e6ecd65a188b1ff681a1829ccb8e787cf1f32.webp 
 While bitcoind is still syncing I've started with the mempool backend and electrs following the steps from https://github.com/mempool/mempool/tree/master/backend

Unfortunately there is no simple mempoold to just download and run, I also need to install rust first (in addition to nodejs and npm) to run the backend installer, more bloat :( 
https://media.utxo.nl/wp-content/uploads/nostr/b/a/ba8e6b00c3a52f66123462b21b5763455f3fafa8fe36b2c071d0c9e6a60330b9.webp 
 electrs that I copied over from the old disk is v0.10 from 2023 and there have been many updates:
https://github.com/romanz/electrs/blob/master/RELEASE-NOTES.md

It looks like the old one will probably not work with bitcoin core v28 so I’ll need to compile the latest one
https://media.utxo.nl/wp-content/uploads/nostr/b/8/b8aa6136127151e8c36bc97897374357f7b94d4d85a43b42892d65f1392b1b4a.webp 
 Compiling electrs by following steps on: https://github.com/romanz/electrs/blob/v0.10.6/doc/install.md 

But instead of doing it on the NUC, I'm doing it on a virtual machine, installed with the same Debian .iso file that I used on the usb stick for the NUC. I'm doing this with UTM: https://mac.getutm.app

This way I can just copy over only electrs and don't need all the mess of packages required to build it on the NUC. It would have been great if I could do this with nodejs/npm stuff too but I don’t think that’s possible.
https://media.utxo.nl/wp-content/uploads/nostr/b/e/be56cb1fd6ae02009b43ae2e1ce225e3de040d77b61ef2c26fcb8d39405e3ec7.webp 
 Fulcrum > electrs.
https://sparrowwallet.com/docs/server-performance.html 
 I haven’t heard about this one, is it compatible with Mempool blockchain explorer? 
 It is. But just noticed this. Seems @mempool is running electrs so that might be the better choice if mempool space is your primary concern vs a performant wallet or other software you want to connect to your electrum server. There may be other factors to consider too. 

I tend to say "dont fix it if it aint broke" but dont heed my own advice https://i.nostr.build/hKO71FZrhc7C4n9F.jpg  
 🤦‍♂️ thats their own fork of electrs, but still they forked electrs and not fulcrum 
 the new electrs build is ready, the docs said the build would take ~20 minutes, I didn't measure it but left it running in the background and it took longer than an hour.

bitcoind is still syncing in the background, blocks are at june 2024 now, will probably be finished by tomorrow. After that I will start electrs with a fresh sync too.
https://media.utxo.nl/wp-content/uploads/nostr/0/c/0cd714489d13eafeb5f0dcc5fb8a581599d619a68d693cd4f6d54effc7fa491f.webp 
 I took the latest lightning lnd from https://github.com/lightningnetwork/lnd/releases/tag/v0.18.3-beta

At first thought I copied wrong version because the file dates are jan 1st 2020, but after checking —version it says 0.18.3-beta. Probably the machine used to build it has the wrong date or maybe needed for deterministic builds, I never looked in to how thats done.
https://media.utxo.nl/wp-content/uploads/nostr/7/0/70a64819b224ed31893cf0f9e43299058596605d0c4bd3a20be07e5b6cd6fff9.webp 
 I think we set a default timestamp iirc 
 bitcoind has finished its sync, now I can start electrs. I wasn't sure how slow the sync would be so I tried it first from scratch but it was going very slow, would probably take days, so instead I copied over the data from my old disk, which was around 50 GB.

With bitcoind running, electrs running, I can start the mempool backend and my now local block explorer is working:


https://media.utxo.nl/wp-content/uploads/nostr/d/8/d8c3aee4a8967d6602e352d1522084b6e2b77d3f440b766413d27f564b87b235.webp 
 now I should also be able to start lightning lnd but I was getting errors: 
[ERR] LTND: unable to create partial chain control: unable to determine if bitcoind is pruned: unable to detect bitcoind version

I vaguely remember @Derek Ross posted about a special config flag and after some digging around that was it:

nostr:note18lz63u08tdtxslhznayxw6sq6f7t0mu4vtt6fd6lvfxek0h29d9qtgf8hm

lnd can’t connect to bitcoin core v28 without it, after adding the flag the problem went away and my lightning channels are back online.
 
 Now time to get the BitAxe lottery miner connected, I can't connect it directly to my bitcoin node, it needs something that does stratum protocol in between. A few options I found: public-pool, ckpool, stratum SRI.

public-pool seems easy to use but needs nodejs
stratum SRI looks way too complex for solo lottery mining, I don't understand anything on the docs
so I'm trying out ckpool, it has instructions specifically for solo mining which I'm following: https://bitbucket.org/ckolivas/ckpool-solo/src/solobtc/README

I'm doing it the same as with electrs, building it in the virtual machine so I can keep the NUC clean.

Following the steps, I kept getting stuck on the ./configure command. For some reason this line in configure breaks it: PKG_PROG_PKG_CONFIG(). I'm not sure what it does but the only way I could continue was by removing it.

This resulted in 4 files, I think only 1 is needed for solo mining but I copied all 4 to the NUC just to be sure.

I pointed ckpool to bitcoind, and the bitaxe miner to ckpool and all looks good:


https://media.utxo.nl/wp-content/uploads/nostr/5/5/55373953ccc9bf24d9fe793df10f98d4b63e74d8cf616fb54a099cf4e8fc8c90.webp
https://media.utxo.nl/wp-content/uploads/nostr/0/3/03232d050fc23fc37b6b7bae401e142030780d1d53328ae20f5045a230df6b39.webp
https://media.utxo.nl/wp-content/uploads/nostr/3/1/316a5bc64f12ee0414c1e456c66c96f06bc491ba19bc0080ec1ba9a351987e16.webp 
 Nostur is really great, but seriously? Automatically putting a poop emoji next to tags like #xmr or #monero by default? I thought I wouldn’t find this kind of thing in clients built for Nostr. What a shame! https://image.nostr.build/0e2fcc35f997b63af848ee9324a3e541b6811379eed4a9e8e3b5c76ed6d1f5ef.jpg