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! :)

Great work!

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.

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 :)

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!

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

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!

Coin Marketplace

STEEM 0.20
TRX 0.26
JST 0.039
BTC 100331.97
ETH 3646.26
USDT 1.00
SBD 3.05