Introducing a public Hivemind node

in #hivemind6 years ago

Hivemind:

Hive is a "consensus interpretation" layer for the Steem blockchain, maintaining the state of social features such as post feeds, follows, and communities. Written in Python, it synchronizes an SQL database with chain state, providing developers with a more flexible/extensible alternative to the raw steemd API. source

It also defines a specification to handle community actions with custom_json operations. However, the communities part is not there, yet.

Since api.steemit.com migrates some of the endpoints to a Hivemind node, I wanted to learn more about the project, and it's capabilities. Moreover, as a witness, I wanted to test it.

That being said, after a one-week sync process, my hivemind instance is up to date and ready to use. It's accessible at hivemind.emrebeyler.me.

condenser_api endpoints

The following endpoints belongs to condenser_api endpoints.

condenser_api.get_followers
condenser_api.get_following
condenser_api.get_follow_count

condenser_api.get_content
condenser_api.get_content_replies

condenser_api.get_state

condenser_api.get_trending_tags

condenser_api.get_discussions_by_trending
condenser_api.get_discussions_by_hot
condenser_api.get_discussions_by_promoted
condenser_api.get_discussions_by_created

condenser_api.get_discussions_by_blog
condenser_api.get_discussions_by_feed
condenser_api.get_discussions_by_comments
condenser_api.get_replies_by_last_update

Every method has its own signature. It's always best to see the source code to find out which kind of arguments you need to pass.

All of these endpoints are basically replaces the steemd's follow and tag plugin queries. Instead of directly querying the blockchain, hivemind queries its internal database.

hive endpoints

In addition to condenser_api namespace, there are a couple of extra endpoints can be used. (These are subject to change in the future considering the project is alpha.)

hive.db_head_state
hive.payouts_total
hive.payouts_last_24h
hive.get_accounts
hive.get_accounts_ac

Note: hive.payouts_total and hive.payouts_last_24h endpoints are disabled on my node. These SQL queries takes a long time to complete and since the current database driver of Hivemind is blocking, it makes the server process unresponsive. Therefore, they're disabled.

Disclaimer

This node is in public use for the hobbyist developers. Hivemind itself is on the alpha state and may not be production ready.

However, if you're a developer and want to try Hivemind, or if you want to hack a Hivemind client in your programming language of choice, you can use hivemind.emrebeyler.me for testing purposes.

Example calls

Get followers of 'emrebeyler'

curl -s --data '{"jsonrpc":"2.0", "method":"condenser_api.get_followers", "params":["emrebeyler", null, "blog", 10], "id":1}' https://hivemind.emrebeyler.me

Get the head state of the db

 curl -s --data '{"jsonrpc":"2.0", "method":"hive.db_head_state", "params":[], "id":1}' https://hivemind.emrebeyler.me

Health Page

Vote for me as a witness

I do my best to support the blockchain with my skills. If you like what I do, consider casting a vote on via Steemconnect or on steemit.com.

Sort:  

Been running it for a few weeks now. Currently building a graphql api to aid developers building frontend apps because it seems to be the trend recently. My public instance is at https://hivemind.jakerawsthorne.co.uk/ but I can't guarantee any stability.

Nice one! Thank you. :-)

just voted for you as a witness.

Thanks for the public node!

Thank you, much appreciated! :)

This story was recommended by Steeve to its users and upvoted by one or more of them.

Check @steeveapp to learn more about Steeve, an AI-powered Steem interface.

Great job!

Thank you 🤘

Written in Python

This node is in public use for the hobbyist developers. Hivemind itself is on the alpha state and may not be production ready.

Nice work any how. Much appreciated!

For me, it's exactly the opposite. One of the reasons that I like Hivemind it's coded on my beloved Python :)

I really like Python. I'm getting to use it at work recently and have experimented a little with Steem stuff.

So, we have a few nodejs maximalists on the SFR discord and I feel a bit outnumbered being more inclined to use Python.

Perhaps it's just because it was the first one I started learning but had dabbled with Java back in my high school Comp Sci.

How would you describe the advantages of Python over other languages?

Contrasted from PowerShell (which I believe is a language based around .net), I know that Python seems to be much more slim syntactically. (Ie for loops much simpler. Forgot those damn curly braces!)

IIRC Java is a compiled language while Python is interpreted so perhaps that has some significance.

I really hope they will implement custom filtering for posts, accounts etc. asap. Feel like any advanced implementation of steem cripples you from the start with what you can return and how.
Will running custom hivemind give you the ability to make your own custom end-points ?

That's why one should vote him as witness!

Will @holger80 follow and update beem for it? :)

Great work!
beem already supports hivemind:

from beemapi.graphenerpc import GrapheneRPC
rpc = GrapheneRPC("https://hivemind.emrebeyler.me", disable_chain_detection=True)
print(rpc.get_followers("emrebeyler", None, "blog", 10, api="condenser"))

returns

[{'follower': 'a-0-0', 'following': 'emrebeyler', 'what': ['blog']},
 {'follower': 'a-0-0-0-real-dex', 'following': 'emrebeyler', 'what': ['blog']},
 {'follower': 'a-0-3', 'following': 'emrebeyler', 'what': ['blog']},
 {'follower': 'a-0-abul', 'following': 'emrebeyler', 'what': ['blog']},
 {'follower': 'a-0-labon', 'following': 'emrebeyler', 'what': ['blog']},
 {'follower': 'a-0-mita', 'following': 'emrebeyler', 'what': ['blog']},
 {'follower': 'a1000carv', 'following': 'emrebeyler', 'what': ['blog']},
 {'follower': 'a-3', 'following': 'emrebeyler', 'what': ['blog']},
 {'follower': 'a-7', 'following': 'emrebeyler', 'what': ['blog']},
 {'follower': 'a-a-1', 'following': 'emrebeyler', 'what': ['blog']}]

Wow I did not even go into such details and did not know now I will know. Author respect and thank you!

Calling @originalworks :)
img credz: pixabay.com
Nice, you got an awesome upgoat, thanks to @mahsumakbas
BuildTeam wishes everyone a bullish new Year!
Want a boost? Minnowbooster's got your back!

Awesome Work!

🤘

Thank you so much for participating the Partiko Delegation Plan Round 1! We really appreciate your support! As part of the delegation benefits, we just gave you a 3.00% upvote! Together, let’s change the world!

Is it just higher-level API or it provides some additional functionality?

We're using steemd to query the endpoints listed with condenser_api namespace. With hivemind, a sync process listens to the blockchain events and syncs related data into an RDBMS.

Which makes it a good alternative to use instead of steemd, directly. Also, since it's a relational database, there is a lot of potential for interesting SQL queries.

Currently, new endpoints are limited. They're listed on hive namespace on the root post. In the future, hive namespace may get bigger. (communities, extra calls, etc.)

Do you see a lot of progress is beeing made (as you probably checked out the github project) ?

The last touch to the indexer code related to communities was 6 months ago and the recent git history tells that the community features are not the focus at the moment.

Considering recent posts of @steemitblog, looks like they're focusing on moving away tag and follow api endpoints from steemd to hivemind. (Probably targeting a cost reduction on official RPC nodes.)

However, I have to add, this is just an educated guess from my side. The roadmap and plans may be different in Steemit inc.

Hey, @emrebeyler!

Thank you for your contribution to the crowd. We are the Steemit project dedicated to empowering The Wisdom of Crowds. You can find more about us on our official website or whitepaper and you can support us by voting for our witness and joining our curation trail on Steemauto . We are also inviting you to join Crowdmind Discord server. Don't forget to use the #crowdmind hashtag and happy crowdsourcing!

Thank you. 🎉

Good stuff. I like to see progress like this within dev community. SQL queries are a lot more flexible for sure, thus the apps can benefit from this without a doubt.

Posted using Partiko Android

The community feature could be key to the success of Steem. I know various communities want to move away from other platforms. Is anyone working on it?

Looks like the community side is not the focus at the moment. There are a couple of alternative projects in process from the community, trying to solve the issue.

I appreciate there are limited resources and they got reduced recently. I just want to see Steem progress.

This post has been included in the latest edition of SOS Daily News - a digest of all you need to know about the State of Steem.



Fantastic work! Thank you.

Well done! Your witness voted.

much appreciated! :)

Congratulations @emrebeyler!
Your post was mentioned in the Steem Hit Parade in the following category:

  • Pending payout - Ranked 5 with $ 123,4

Would love to learn more about this. But clicking on the link hivemind.emrebeyler.me returns this:
405: Method Not Allowed

What do I do wrong? Sorry for a non-techies question?

Hey, no worries.

This is an API server and not really usable for non-techies :-) It doesn't have any user interface.

Wish I had this knowledge great work I have resteemed for you mate.😁😀😁

Posted using Partiko Android

very useful.

This is cool. Just wondering how does the CPU and RAM usage looks like as this is almost a blockchain snapshot written in an interpreted language and backed by a db :)

This is amazing !! Well done bro

What have we here,one year !BEER