What Mining Sim is
I’ve been working for the past couple of months on a project called Mining Sim, at least for now.
The idea behind it comes partly from something I’ve thought for years now. I’ve always regretted not knowing about Bitcoin back when you could still mine it yourself on a normal PC.
I’m not trying to make a new Bitcoin with this. What I want to recreate is more the feeling around mining itself.
The project is being built as an L2 on Hive. Players do their actions through real HIVE transactions, and those transactions are then picked up by the nodes I run to validate what needs to happen in the game and update the game state from there.
What went wrong
I originally started building this off-chain, and for most of the testing I used a fake chain so I could control things more easily.
Now that I’ve started testing against the live chain, I’ve had to make backend changes so the system works with real HIVE blocks instead of the fake ones I used before.
Yesterday I noticed a bug where difficulty was showing as 10, even though it was supposed to start at 1. A value like 10 was meant for a much later stage, when there are already many miners active.
While fixing that, I added an update that was supposed to activate only after a certain HIVE block. That part seemed to work, and at first everything looked fine.
Today I started my second node again, the one I run on my PC and usually stop and start each day. Once it caught up, I compared its state to the other node and noticed they no longer matched.
That immediately stood out, because for about the past two weeks both nodes had always stayed in sync.
After digging into it a bit more, I found that the second node had already forked as soon as it started catching up. My first thought was that maybe restarting it from 0 would fix it, but after checking the first block again, it forked right from the start.
At that point it was clear something deeper was wrong.
What it came down to in the end was pretty simple: while fixing the earlier problem, I had added a new game state field but forgot to gate that part behind the same activation block.
It was a small mistake, but exactly the kind that matters when the whole point is getting multiple nodes to end up in the same state.
Where it stands now
But not all was lost. I added a way to create a checkpoint from the chain that stores the current database and game state, then restarted the local node from that.
That got everything working again, so at least the fork issue is fixed.
The difficulty bug is still there though, so that part still needs more work.
Here is the current dashboard after getting things back in sync:
The first logo in this post was AI-generated. I made it so I’d have something to use for the Discord as well.
For anyone curious, the current test build is here:
Game link:
https://mining-sim-player.netlify.app/
Discord:
https://discord.gg/kfvFamvNQe