Happy Sunday, everyone.
Today's post is a bit of a story and a ramble about a development journey I went on this morning. I've been working on a new tool to help manage the settings for Hive communities, and it sent me down a rabbit hole trying to understand how community accounts are actually created.
First, here's a sneak peek at the tool I'm building. The goal is to create a simple interface for community owners and moderators to update properties like the title, description, and rules. It's still a work in progress, but it should be ready soon-ish.
While building this, I wanted to understand the process for creating a community. I knew the account names were hive-XXXXXX
, but I wasn't sure how the numbers were generated or if there was a specific protocol to follow.
So, I started by reading the official documentation, which says:
Communities are registered by creating an on-chain account which conforms to
/^hive-[1-3]\d{4,6}$/
, with the first digit signifying the type.
The documentation goes on to explain the different types:
I never knew "Journals" and "Councils" were even a thing! This seemed like a cool feature to support.
My next question was: how are the numbers in the account name generated? I initially started digging through the condenser (hive.blog) source code, but after a while, I got tired of searching. So, I turned to my new favorite tool, DeepWiki, and had it ingest the condenser and wallet repositories.
After my coffee, I finally had some answers. DeepWiki analyzed the wallet source code and told me this:
No Collision Detection: The system does not check if the account already exists before attempting creation. It simply generates a random number and hopes it's not taken, as you suspected.
Oof. But it gets more interesting:
The current implementation doesn't match the documented regex pattern... The actual code only generates numbers in the 100000-199999 range (effectively type "1" communities), and doesn't implement the type system or the full range mentioned in the documentation.
So, it seems the functionality for creating "Journals" and "Councils" might not even be implemented, despite being in the documentation. I'd rather know this now than build options into my tool that aren't really options.
The investigation continues!
As always,
Michael Garcia a.k.a. TheCrazyGM
While I rarely comment these days, @thecrazygm, I do often at least glance through your work and, in this case, read your post word for word.
Wny this one?
I used to support my family programming. Making no claim to being at your level, I am nonetheless aware of what your title brought back to my mind:
Oh man! I don't have
TIME for that right now ...
You may be different, but updating documentation was always literally the lowest priority I had. Simple reasoning was involved. I already knew what the code was supposed to be doing! The end users? Well ... They worked for me, so ... 😉
Thankfully I ended my career with a full-time aide who was enormously helpful in staying right with me in keeping all that "complete, current, and accurate" (my old mantra).
🫡 🤝 👋
Hahaha. It works on my machine!
Do you think the documentation is wrong or the interface isn't up to date with all the options?
!PAKX
!PIMP
!PIZZA
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.
I'm guessing the options are supported by the chain, probably just took the easy way on the account creation. I'm not sure if peakd has the options either. But I guess there is really only one way to find out.
Let's break stuff! ⚠️🔥
ive come to learn documentation of Hive is pretty lacking... but hey, I'm also aware of the monumental task it is to clean it up.
This, as steevec said, is probably the best use of AI we could come up with.
Didn't know too there was more options, but I see where this comes from... and 2 and 3 were probably WIP or long term ideas. Which if you think a bit about it, it would be hard because the way it would work would not be able to prevent the "meaning" of it to be hardcoded anytime by someone, so I guess it was a DOA idea, hence why it probably never continued.
Congratulations @thecrazygm! You have completed the following achievement on the Hive blockchain And have been rewarded with New badge(s)
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:
First of all, this is s tool that I'm very much looking forward to trying out, as I help manage a community, and secondly, I've seen that so often, where there is a notable difference between the software and its documentation. Documentation almost always lags behind the actual development. The example that you gave is reverse, of course, which is rather interesting in itself. 😁🙏💚✨🤙
$PIZZA slices delivered:
@ecoinstant(1/20) tipped @thecrazygm
Come get MOONed!