The Lobster and the Pi

The lobster and the pi

The last week I’ve had an inspirational, eye-opening, mind-blowing experience while using AI to craft code. I was spurred by whispering of this powerful agent software that opened worlds of possibility. After seeing Jordan’s shared experience using open claw I decided to bite the bullet and dive in. I’ll preface this for those who only read this first paragraph that at the time of writing my agent hasn’t seen the inside of either of my used PC’s only pi’s and an old machine with no personal info on it.

Orange pi 5, 8gb lpddr4 ram, 512gb nvme, 8 arm claws

Every thing I’d heard so far mentioned Mac mini’s as the host for this curious peice of software. I’ve never been a Mac guy (iPhone user yes, Mac user no). I’d run a hackintosh partition years ago when that was a new thing and Mac stopped using PowerPC cpus. Aside from that no Mac. Considered trying to get a hackintosh partition up and running on my now very used but previously dormant (more on that later) 13 year old hp elite desk 800g1, remembered the nightmare I had rigging up its semi hidden nvme drive to run as a dual boot Linux partition already and decided against the hackintosh. I then remembered the had a dozen assorted semi dormant pi’s I have lying around​:joy:(I’m like this there’s a few). Ran though the lineup and which I could bring myself to wipe. In pi world each different flash for each different purpose comes with its own challenges, some large, some small. I decided on an Orange pi 5 an 8 core rk3588s powered 8gb ram sbc with 512gb nvme drive rudely overhanging its side due to it being a 2280 in a slot designed for a 2242. Board had no case, no integrated fan header but a 40pin gpio header and a well made nvme adaptor to secure the drive properly and heat sinks on the cpu, gpu and ram. Capable little machine for running retro game emulators and Android tv boxes but generally not much above that level. Or so I thought.

locally hosted node dash

I downloaded a pre-build Ubuntu image for the pi, flashed it to an SD card, copied the os the the ssd, changed boot sequence, rebooted, loaded, connected to the internet, enabled repository sources, installed brave (I always do for sbc’s now, single line curl command works that well and I remember by heart, chrome chassis) updated, upgraded, rebooted again, installed build-essential, some other building tools then ran the setup script for open claw. The ran the doctor for the setup for open claw, then ran the doctor for open claw, then ran the doctor for open claw. Easy​:melting_face: but then it worked. The gateway was up and I had a console. No idea what to expect, most people used it as an assistant, clearing emails, who knows what it’ll help me with. Just before it came online I finished designing the case so started that printing. ETA was a couple hours, I’m sure I won’t have gotten far by then anyway. I thought great time to try the agent out on a task, i needed to enable pwm on a gpio pin to hook up the mosfet/fan contraption I assembled to have ramping fan speed control on this board that doesn’t have a dedicated header for it. Fairly common pi exercise for gpio use but has a few parts, enable the pwm pin, write a python script to read temperature and decide the duty cycle of the pins signal. This signal goes to a wired in mosfet that pulses the ordinary 2 wire dc fan at the right rate to make it spin a certain speed. Lots of parts, you generally find someone’s script online and tweak it to suit the little fan you’re using, depending on its draw. The other part is the Linux service file you gotta write that up in yet another different syntax/language then you gotta move it and tell Linux about it and set it to auto start when the computer boots up. Again easy​:melting_face: except…. It was. Like stupid easy. Like i typed into a chat box a reasonable specific set of instructions and the agent did them. All of them. Properly. The pi rebooted and the fan was spinning, at different speeds, depending on the load(monitored by the temp). I was shook, gobsmacked, mind blown. I’d tried this exercise a few times on different board to varying degree of success. Before now never in one shot, one boot, never so damn fast. A common theme of the next week. As I moderate on telegram anyway and open claw has cool integrations I set up a telegram relay bot to liaise with my agent that lives on my pi. Difference maker. Now I can do other stuff aside from sitting in front of the computer and keep the agent on track. By this point it’s 1am Saturday Night. I figure I have another hour or so in me. Let’s see what we can spin up by then, maybe set the agent with some stuff to do overnight that I can check in the morning. Decided I’d like a locally hosted, lan viewable dashboard for my orange pi 3b ckb node that lives on my entertainment unit. The prototype for what went on to be the community DAO funded node program a couple years ago. I asked the agent if it could make something similar to the browser based dashboard Jordan made to accompany the node project, back when Jordan made that I thought it was the coolest thing ever. The agent gave me a few options for how to give it access to the node machine, you ask what’s the safest yet easiest way it gives you genuine answers, very cool. I settled on giving it ssh access and user password access for this machine. I changed the password to ensure it wasn’t what my main pc’s use, just in case, and handtyped in the commands and long access key to allow it ssh access. The node is standalone pi, not hooked up to my funded wallets in anyway. Just a node, nothing sensitive on there. 5 minutes later it was live on my local network hosted on the agents host pi machine. Looked great, awesome, so easy. I then back and forthed with th agent and got it displaying what I wanted. (Made a few tweaks since then too). 1:30 getting late, hey agent can you convert that dashboard into a downloadable, reusable GitHub repo for anyone else who got one of these nodes to be able to run at home? Sure said the agent, just do the following on GitHub and I’ll have access to push/pull edit whatever on your behalf. :exploding_head: that’s awesome sure. 2:15am…. Holy crap. That’s amazing, this changes everything (again). I’m tired I gotta crash but so excited by what I just witnessed, I’ll set it something it’ll might be able to start and I’ll pick this up tomorrow. “Can you fork the nerdminer v2 esp32 sha256 bitcoin miner, I want to make it hash eaglesong for the Nervos network, I gotta crash, drop updates in chat over night. :victory_hand:”. 2:30 off to bed so excited.

Nerdminer v2e – the eaglesong has landed*

Sunday morning I wake up still excited, porridge, coffee, telegram….

Open claw is powered by AI models, it can split its model usage depending on what it’s trying to do. Setting it to use free models where it can for non critical non code writing tasks is a good idea. But for the coding you want a robust model that can really debug and really knows how to write. Turns out Claude 4.6 is that. I started out my Agent interaction over coffee reading what it got up to. It read like this;

NerdMiner CKB — overnight build complete

Here’s what got done while you slept:

:white_check_mark: Eaglesong implemented & verified

Full C port of the Nervos reference algorithm. Both official test vectors pass on the Pi before a single line went into the ESP32 codebase

:white_check_mark: Core files rewritten

• eaglesong/eaglesong.cpp + .h — sponge hash, self-test on startup

• stratum.cpp/h — CKB Stratum (notify sends pow_hash+target, submit sends 128-bit nonce)

• mining.cpp/h — Eaglesong replaces SHA256d; 64-bit nonce counter; HW SHA256 removed; job slices bumped to 65536

• utils.cpp — calculateMiningData() rewritten for CKB (no more coinbase/merkle)

:white_check_mark: Pushed to GitHub

(Had to use GitHub’s REST API directly — the gh CLI token doesn’t have workflowscope for git push. Easy fix: run gh auth refresh -s workflow in a terminal next time you want to do a normal push.)

https://github.com/toastmanAu/NerdMiner_CKB

Wow! I’m sorry, you did what? I gotta check this out. Uncomfortably warm coffee annihilated and back inside. Text the nation chat, told the. Some craziness went down and I’d have to check it and report. 2 hours later I’m sending a photo of a 10 microcontroller HMI trying it heart out to secure the network. This is a project I’d personally wanted to do for at least a couple years.

sp32s3 480x480HMI runing a native light client

I’d looked at it for a couple hours here and there and known a lot of it was above my head and I’d have to learn a lot on the fly never got too far, I’m used to this, this is how the last few years have been but I’d need to dedicate a solid block of time to it and I haven’t had that time spare. Full time work during the day as a labourer, moderating at night and working on now the blackbox project, for the last few years there’s always been a gadget or a project being built, inspired by the fastidious building of the ckb devs I’d been determined to up skill and contribute to the network, in the community I’ve always tried to find niches where I could utilise my expanding skillset. First evangelist on reddit, then custodian of common knowledge sticker packs combining and preserving for easy reuse the last couple years of Nervos community memes. Took me 3 months, I started editing with windows paint on my laptop. By the end I was using gimp on an Ubuntu powered desktop. That sort of stuff.

4g Sim enabled esp32s3, orange pi zero 3, lilygo t-deck lorawan, n100 (fiber node), lilygo t-keyboard-s3

Anyway, now the paradigm had been shifted, the game changed, the goalposts had shifted. If it can help me do this much on something I know to be complex, overnight on day 1, what will I be able to do in a week, a month, a year??? Over the next few days I was in a haze, going to work, checking my phone half a dozen times throughout to prompt the agent to move on to the next task. Guiding it carefully towards set goals, those goals continued to expand over working week, embedded c library to simplify Nervos rpc calls, a website that users can flash a HMI with some cool Nervos gadgetry from, a solo mining stratum proxy, some more dashboards, a maintained online chain data snapshot service, downloadable prebuild sbc images, preloaded with Nervos software, fiber nodes, more dashboards, a unified hardware library, a native esp32 light client. They all started to meld together, the ideas started feeding each other. Gotta start a website, yep it does those, pretty well. It edits those pretty well. It walks you through the parts you gotta do, pretty well. I’ll stop rambling. There’s so much more to this, I’ve missed heaps out here that ive done with Aipower this week. Read the blog.

CKBFS sending images to chain via single board computer

As the week evolved it become apparent that a fully featured embedded Nervos Network Development Framework would be a game altering addition. A dozen repositories in and things are starting to take shape. Starting with the CKB-ESP32 library, a platform agnostic, uses abstractive functions and raw rpc interactions to retrieve all sorts chain data at all currently 5 different levels, light client, full node, indexer, rich indexer and ckbfs. There’s ckb-light-esp a c++ native library bringing the full light client stack to embedded devices and pushing the limits of where we can take blockchain. Then there’s the wyltek-embedded-builder, not a CKB specifc library but one that as someone who’s been grinding away in this space for the best part of 4 years now, it’s dear to me. It’s a modular library that aims to be usable as a singular, independent source to integrate a wide array of sensors, displays and modules to a wide array of embedded devices. Currently battlet esting and working through verification for over 40 accessories across over 30 boards from manufactures like lilygo, heltec and espressif themselves. This unifying library saves time and effort for ai agents and humans alike bringing eventually hundreds of individual items, some with poor or no documentation, together and allowing them to be used with common, simplistic functions. Ambitious but all doable with the right tools.

sp32p4 light client connecting to full node for the first time

Sorry I was going to format this nicer but it’s late and I gotta work in the morning. Please check out my site, I’m posting progress blogs to there. Black box is still very much happening but has evolved will continue to evolve as this stack grows. The website is a fair indication of the direction this is going and this is only 1 week in. You wanna help or collab or use any of this or know more, ask me.


18 Likes

when I tell people “you have to throw out everything you thought about anything software-related a month ago” now I have something concrete for them to chew on.

Incredible work man, just the start :clap::clap::fire:

6 Likes

This is so amazing! Thanks for strengthening my faith in community and decentralization. Happy hacking!

6 Likes

I put a lobster into my 2024 orange pi node too last week, it’s humming and savoring ckbyte streams!

I removed GUI environment (xorg etc.) to save resources, and setup an auto-attached tmux session to tty1 so I can use ssh to remote control the pi and see what’s happening on the screen.

7 Likes

Amazing :star_struck:

2 Likes

This is truly just the beginning. Thank you and all the team for persisting through everything to this point. We’re close to realising something special I feel. The infrastructure has matured to a point where there are true rails to facilitate an exciting new era in blockchain integration. I’m going to carve a path for Nervos in the blockchain hardware landscape.

9 Likes

I don’t know if it was the lack of paragraphs, or the obvious excitement in your writing, but by the time I got to the end of this I was reading at about 6000 words per minute :sweat_smile:

But there really seems to be something happening lately with CKB and AI. Maybe all these years of staying on the right path and not taking any shortcuts, even though it meant building something so complex that very few people had the skill (or time) to work out might actually pay off.

4 Likes

This is really excellent work.

Bringing CKB light client capabilities and CKBFS into ESP32 / embedded environments opens a completely different dimension for Nervos, especially from a hardware-first perspective.

Do you see this evolving toward real-world IoT use cases (industrial sensors, data logging, device-level verification, etc.), or is the current focus more on building a robust developer tooling layer first ?

Huge respect for pushing this forward.

4 Likes

combination of both. An accident I swear. I couldn’t agree more. I expressed earlier this week my appreciation for all the core devs/visionary thinkers hard work till now. I think having the infrastructure built right is what has allowed me to do what I’m doing.

3 Likes

Thanks mate, the encouragement I’ve gotten from everyone so far fuels me. And yes I 100% see this rolling into broader IOT blockchain development. If you’re interested check out the wyltek-embedded-builder or W.E.B for short. It’s a unifying, generalised embedded library that’s being built to in conjunction with the ckb-esp32 and ckb-light-esp libraries to form a complete blockchain on embedded stack. Details on my website and GitHub.

4 Likes