You are viewing a single comment's thread from:

RE: 5th update on BlockTrades' Hive development progress

in HiveDevs3 years ago

I have heard about hivemind a lot. But still have difficulty of understanding how one can use it. I see you mention SQL a lot with hivemind. I have been using HiveSQL and python to learn and experiment with things on Hive.

My question is are there ways to use SQL to get data from hivemind, similar to HiveSQL? Are there resources for beginners programmers to learn from and utilize hivemind using SQL and/or python?

While using HiveSQL and making experimental apps, I came across references to Steem and SBD in Hive Developer Portal. For example here: https://developers.hive.io/docs/tutorials-recipes/understanding-dynamic-global-properties.html

Somebody probably needs to review and get those things up to date. I can help if necessary. My knowledge and skills are limited though.

Thanks for all the work you and your team doing.

Sort:  

Hivemind as it stands to do is essentially a python application coupled with a postgres database that stores blockchain data. It has various APIs (implemented internally using SQL queries on the blockchain data) that are used by Hive apps such as condenser (hive.blog), peakd, vision (ecency), leofinance, dpoll, quello, etc. These APIs are documented here: https://developers.hive.io/ under APPBASE API (although it documents both hived and hivemind APIs together). So hivemind is essentially a microservice that can serve up blockchain data using REST API calls. You can also add your own new API calls by writing SQL queries.

We're also developing a new microservice called "modular hivemind". The goal of this is to replace the monolithic design of hivemind with a customizable microservice. A basic implementation of modular hivemind will get all the blockchain data and have a very compact API that can serve up basic data: account info and transaction history and block data. An operator of a modular hivemind node can then optional select additioinal "modules" that create additional tables to support other categories of API data (for exact, installing the social module would allow that hivemind instance to support APIs for posting data and post voting information).

The idea behind this is that new Hive apps can be built just by adding SQL queries over the blockchain data and other modules installed in the hivemind instance to create whatever APIs are needed for their application. And to do this in such a way that the app developer doesn't have to worry about low level details such as how to get efficient access to the blockchain data or how to handle forks (this is where blocks that have happened get discarded and replaced by new blocks, it requires the ability to "undo" operations that already been processed).