I have been meaning to write a devlog post for a while, but it always takes a back seat to more urgent tasks. I want to talk about some of the "work" I've completed recently for various projects. And dump my brain for some things I started researching.
The current project that generates the most excitement is the MOON game (HiveNova open-source engine), which I have included at the end. Feel free to skip ahead if you'd like.
Proof of Sharing (POSH) (led by @acidyo)
Multiple new things here worth mentioning:
- Blueskyposh was updated to proc on posts that include a Hivelink in richtext, but don't have an external embed attachment
- POSH and GOSH token tip bot set up for tipping PeakD snaps
- GOSH discord notifier script is watching for PeakD snaps with the #GOSH tag and notifies a discord channel
- Lovesniped script for auto-following accounts that have been onboarded by OCD since 2022.
HiveEngine NodeCheck (GitHub)
Small change made to filter out some noisy Discord notifications. Enabled/disabled notifications were sent for nodes that are expected to frequently be enabled and disabled. I added a filter to stop sending those messages. Thanks for the suggestion @forkyishere.
HiveEngine Dockerization Branch
The HE dockerization project started in 2023, and I have had some concerns about ease of use. Starting up the Docker cluster was complicated due to Hive-Engine's reliance on MongoDB replication sets. You must send the command rs.initiate()
before the database can be accessed from NodeJS. I found a workaround for this, which is to call the initiate() and other setup commands from docker-start.sh script.
The dockerization changes add three files to the repo:
Dockerfile
- Describes how to build the Node.js container, including installing MongoDB tools
- Tells the container to run docker-start.sh on startup
docker-start.sh
- Initializes mongo, setting parameters
- Checks if the hsc chain is in a good state by running find_divergent_blocks.js
- Runs restore_partial.js to restore the DB, if asked to do so by setting RESTORE_PARTIAL env variable
docker-compose.yml
- Describes the cluster: network, and the dependency between the two containers. he depends on mongo.
- The cluster comprises a MongoDB instance and a Node.js instance.
Why do all of this?
It allows a Hive-Engine node cluster to be spun up with two commands:
docker compose build && docker compose up
Switching the MongoDB version or NodeJS engine version is a single line code change.
Testing
While testing the Docker cluster, I observed a couple of cases where the node's blockchain data diverged from the network consensus. Therefore, dockerized HE requires further testing before being encouraged for broader usage. Additionally, I have not yet tested peer-to-peer (P2P) communication.
High-Level MongoDB vs Other Databases
I believe MongoDB is run in replica set mode, allowing MongoDB tools, such as mongodump and mongorestore, to be used for archiving and restoring the database. The archive/restore enables node operators to load a snapshot for repairs rather than syncing from the genesis block.
MongoDB is designed for horizontal scaling, but to the best of my knowledge, no Hive-Engine witness node does any horizontal scaling. Maybe some of the core team infrastructure runs multiple instances of the DB for reliability.
When Hive-Engine node software reads blocks and executes smart contract code, it reads from and writes to MongoDB. The speed of the database is critical to the sync speed. Is another type of DB, such as LevelDB, PostgreSQL, or GraphQL, better suited for this task?
The Hive-Engine JSON-RPC API also serves requests and reads data from MongoDB. For this task, MongoDB appears well-suited, as it's designed for high throughput and distributed systems.
An interesting science experiment would be to profile the performance of Hive-Engine and replace MongoDB with another database technology.
MOON
There is so much to talk about I don't know where to start. We launched MOON less than 2 months ago. My previous DevLog post was 1 week after the launch of the game.
Here are some of the more notable changes:
- Discord notifications - numerous adjustments
- Moon.records on-chain notifications added w/ beneficiaries (thanks for help from @thecrazygm)
- MOON Season rewards script. Calculating the rewards is complicated, and I wanted an easily repeatable way to calculate them. This can be reused for future seasons.
- Fix: Battle Engine - The simulator was not using the same battle engine as actual battles, leading to confusing results. Within the PHP code, identical function names were used by 2 different battle engines, making code review ineffective for finding the issue.
- Fix: Battle Engine - BE was using hard-coded debris settings and not honoring the Universe settings values set by the admin.
- This "fix" disrupted the game balance because the settings were far higher than the previous hard-coded values. Higher debris makes attacking more lucrative. The settings were adjusted 3 days later.
What's next?
There are endless things to build for MOON. Players have suggested many changes and improvements that we haven't gotten to yet. The MOON team also has many ideas for more web3 Hive integrations.
Here's a few top of mind items that need to get done:
- Multi-universe isn't working. It relies on Apache or nginx web proxy settings, but we don't use either of those and we need to find an alternative.
- The home page needs to be re-done to make it more attractive to new players.
- Various quality of life improvements for players and alliances
- Make colonization missions less confusing by checking requirements in the fleet launch steps before launching the fleet
- Allow deletion of Main Planet if player has 1 more colonies
- Re-balance Officer prices and bonuses
That's all for now. Thanks for reading! Do you want to hear more about any of these projects? Please let me know in a comment.
I had no idea you were working on so many things! Thank you for setting up MOON and letting us break it. Yall have set up a great team and have been incredibly fast at rolling out patches.
The Hive-Engine stuff sound cool, but maybe still over my head. I have been trying to understand how docker files are set up, and a prebuilt container sounds very helpful to get started.
Hype I got a MOON!
!PIZZA
!HOPE
!LUV
What an exciting period to be alive!
Thanks for taking the time to empty your notebook onto the chain so we can celebrate and think along with you.
Its an interesting idea, I wonder if another db type for h-e would make some of the data retreival issues easier to deal with.
!PAKX
!PIMP
!PIZZA
Maybe, maybe not! An experiment, which could be a lot of work with no helpful outcome.
it also sounds like something i would do for shits and giggles though 😂
View or trade
PAKX
tokens.Use !PAKX command if you hold enough balance to call for a @pakx vote on worthy posts! More details available on PAKX Blog.
Big beautiful dev log is crazy! 😂😂😂
Moon is my new jam on here. Great work though… 🙏🏾
!LOLZ
!PIZZA
lolztoken.com
But in the end, it doesn’t even matter.
Credit: reddit
@hivetrending, I sent you an $LOLZ on behalf of bigtakosensei
(3/10)
Delegate Hive Tokens to Farm $LOLZ and earn 110% Rewards. Learn more.
That means that Universe 2 can't start before you find a solution to this, right? That's without counting for anything else you may be working on for the beginning of Universe 2...
I think we can pivot to a Red vs Blue (vs purple) story line in Universe 1 where three alliances fight to onboard the most users ✍🏼
That sounds ok to me! OGame still attracts players after more than 20 years. It's a gameplay that attracts a certain category of players, and with or without rewards, Moon should attract more players and users for Hive.
I thought the replication setup was odd too, considering there are no nodes are actually using it as it's meant to shard and sync.
I could be wrong about the reasoning. I wasn't around in the early phase. @rishi556 probably knows why it uses replica sets.
$PIZZA slices delivered:
@txracer(1/15) tipped @hivetrending
ecoinstant tipped hivetrending
bigtakosensei tipped hivetrending
Come get MOONed!
Congratulations @hivetrending! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)
Your next target is to reach 54000 upvotes.
You can view your badges on your board and compare yourself to others in the Ranking
If you no longer want to receive notifications, reply to this comment with the word
STOP
Check out our last posts: