cherokee4life cross-posted this post in Guides & How To's 29 days ago


Digging into the chain with the HiveSQL series : getting started

in #hive29 days ago (edited)

[Artistly Design] 0196b05c-05c5-7381-8364-bc3cdb7d803a.png
(1)

Hi folks @bitcoinman here

Backstory/fluff

Now you may be used to lots of AI generated content from this account but this is not one of those posts so I will be accepting upvotes on this one.

I personally think the content I released on this account is fairly useful and valuable and it is important folks don't discount it just because of the use of AI.

Some of the research is fairly extensive and probably too much for most hive users, that is why I also created condensed audio version for easier digestion.

As I mentioned in the introduction post for this account, along side the AI stuff I will also be releasing other learning resources and research, although AI is a powerful tool we should leverage I believe it is also important to know how to do things on your own as the AI is not perfect and also it can't access HiveSQL and that is a fairly large limitation especially in regards to hive related research.

HiveSQL

What is it ? SQL is basically like a database management tool, hive is a blockchain which is a decentralized database and HiveSQL is an elegant way to view and analyze it's data, due to the immutable nature of blockchain HiveSQL is read only unlike regular databases that can be fully managed by SQL(read ,write)

Getting started

First you will need to get some credentials that will cost you 1 HBD and this goes directly to the @hivesql account

Screenshot 2025-05-08 112119.png

Link to the HiveSQL registration information page here

Once @hivesql gets the 1 HBD you will get a micropayment with a memo, you can unlock the message with your memo key, they have more info on that in the link above if you are struggling.

After that you will have the following credentials
Server: vip.hivesql.io
Database: DBHive
Login: Hive-your@
Password: yourpassword
Expiration: not applicable

You will need these to access HiveSQL

Now you will also need to download a SQL client this will be the software that access HiveSQL with your credentials.

There are many options but I will be showing you how to use
A free light weight SQL client called heidisql

Link to heidisql here

Get it installed and we are ready to go,
Be sure to disable your VPN when using HiveSQL or it may not connect.

Now in the heidi interface we are going to click new and input our credentials, it should looks something like this ( minus your @ and password)
Also be sure your network type and library are matching what you see below

Screenshot 2025-05-08 113646.png

Click open and you should be in the HiveSQL database

Screenshot 2025-05-08 114558.png

Congratulations you now have all this data but where do we go form here, sure you can manually explore this data but that would not be very useful or efficient, SQL is also a fairly simple programing language that we can use to pull up data naturally this code needs to be made but we will not be getting into that today.

However I will share some quires that you can use (quires are the code/requests that we make to HiveSQL to get data)

You will want to click on the query button copy one of the codes below and then click the blue play button above the query section and you will get the requested data

Screenshot 2025-05-08 115803.png

-- ================================
-- Query 1: Total Curation Rewards
-- ================================

-- Calculate TOTAL curation rewards (VESTS) since a specific start date

Copy paste this section below change to desired account name and date


SELECT
SUM(reward) AS total_curation_reward_vests
FROM
VOcurationRewards
WHERE
curator = 'duo-curator'
-- !!! UPDATE THE HARDCODED START DATE/TIME STRING BELOW !!!
AND timestamp >= '2025-02-03 00:00:00';


-- ================================
-- Query 2: Total Author Rewards
-- ================================
-- Calculate TOTAL author rewards (HBD, HIVE, VESTS) since a specific start date

Copy paste this section below change to desired account name and date


SELECT
SUM(hbd_payout) AS total_author_reward_hbd,
SUM(hive_payout) AS total_author_reward_hive,
SUM(vesting_payout) AS total_author_reward_vests
FROM
VOauthorRewards
WHERE
author = 'duo-curator'
-- !!! UPDATE THE HARDCODED START DATE/TIME STRING BELOW !!!
AND timestamp >= '2025-02-03 00:00:00';


That is all for today I encourage you all to give HiveSQL a go and dig deeper into the chain, with this being a series, we will be sure to explore and learn more, in the mean time you could try to use AI to help you craft SQL quires for what data you want to find out.

if you have any question or are looking for some help be sure to reach out.

@bitcoinman made a Hive academy channel in the HOC discord so feel free to check it out if you are interested in the efforts here or need help

HOC Discord link here

This account is managed by @bitcoinman