Big Beautiful Dev Log June 5th, 2025

View this thread on: d.buzz | hive.blog | peakd.com | ecency.com
·@hivetrending·
0.000 HBD
Big Beautiful Dev Log June 5th, 2025
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](https://github.com/Hive-Pizza-Team/hiveenginenodecheck))

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](https://github.com/Hive-Pizza-Team/hivesmartcontracts/tree/dockerize)

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](https://peakd.com/hive-139531/@hivetrending/moon-dev-log-1) 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.

[![PIZZA.WITNESS small.png](https://files.peakd.com/file/peakd-hive/hivetrending/23yJQqRUEuA75ey3XjmPxDu6WA4xj9pEGMufC8CTRCggi5eCEQqNKkzp3aBoBrxDYGk1W.png)](https://vote.hive.uno/@pizza.witness)
👍 , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,