Hive Engine NFT/Token Explorer - Soft Launch!

in #hiveengine3 years ago

Hive Engine NFT/Token Explorer - Soft Launch!

A seed is planted...

Last week a message from @aggroed floated through the #witness channel on the Hive Engine Discord:

seed.png

Well, I couldn't agree more so I got to work!!

Where is the data?

Today, we have a sidechain on top of the main blockchain and data just pouring out everywhere. As I looked at this my consideration was both which data to get and where to get it from. As I was exploring the answer hit me square in the face.

You see, I am a Hive Engine Witness so I've got a server running, a server with literally all the data I need and an API hanging off the back that I can call!

Which data?

I started playing around with that API and found the getBlockInfo method to be the best endpoint to hit and then parse through everything in there. Drilling down into the data, I see the contract and action sort of defining the underlying data so I started building out tables in MySQL to match these records.

All the tables I've deployed are in the schema below.

Explore the Blocks!

First and foremost, I am far more of a backend developer. I love data, I can pull in data, parse it, transform it, and do anything really. While I can do front end work, I suck, it's slow, and I always put it last. This is to say, I have no front end yet, lol.

I want to both validate my data and get your thoughts on what sort of a front end I should put together. What features you wanna see, and more specifically, what features do you want but can't find anywhere else?

So to start, just jump right in and look at all my data. Also, since this is all just a proof of concept MVP, I only have roughly the last week of data. Once we validate everything I'll pull in everything.

Get the Data - Basic API Calls

I threw up a basic GET API in front of my database so you can jump in and get at the data right now. Please note, this is on a basic server so you should expect to run into issues, this is far from production ready.

There's just a few pieces to this puzzle:

General URL: http://144.126.250.230:3000/api/{TableName}/{TOKEN}?page={page_number}

Key point: the URLs are case sensitive, follow the case from the table schema below. Also, tokens are ALLCAPS, again case sensitive.

Here's a complete URL: http://144.126.250.230:3000/api/MarketBuy/WORKERBEE?page=3.

You can walk through all the data in all these tables. At last count, I have 509,759 total records across all these tables, from just the last week. You probably want to install a JSON extension to format everything nicely in your browser.

My biggest concerns are missing data. Did I forget any tables? Are any fields missing from my tables? Can you find a transaction from the last week that's not in my database?

Conclusion

I'm really excited to fully launch this and find more projects that I can contribute. I'm even more excited to see that I have been able to climb up the ranks on the witness list!

Even so, I'd like to firm up my position and earn even more of your trust. If you think I am a good Hive Engine witness I would appreciate your vote.

As always, hit me up on Discord: blervin#9759

Database Schema

TABLE: MarketBuy
+---------------+--------------+------+-----+-------------------+----------------+
| Field         | Type         | Null | Key | Default           | Extra          |
+---------------+--------------+------+-----+-------------------+----------------+
| Id            | int(11)      | NO   | PRI | NULL              | auto_increment |
| ActiveKey     | bit(1)       | YES  |     | NULL              |                |
| AppId         | int(11)      | YES  | MUL | NULL              |                |
| BlockNumber   | int(11)      | YES  |     | NULL              |                |
| CreatedAt     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| Price         | double(18,8) | YES  |     | NULL              |                |
| Quantity      | double(18,8) | YES  |     | NULL              |                |
| Sender        | varchar(255) | YES  |     | NULL              |                |
| Symbol        | varchar(255) | YES  |     | NULL              |                |
| Timestamp     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| TransactionId | varchar(255) | YES  | UNI | NULL              |                |
+---------------+--------------+------+-----+-------------------+----------------+
TABLE: MarketCancel
+---------------+--------------+------+-----+-------------------+----------------+
| Field         | Type         | Null | Key | Default           | Extra          |
+---------------+--------------+------+-----+-------------------+----------------+
| Id            | int(11)      | NO   | PRI | NULL              | auto_increment |
| ActiveKey     | bit(1)       | YES  |     | NULL              |                |
| AppId         | int(11)      | YES  | MUL | NULL              |                |
| BlockNumber   | int(11)      | YES  |     | NULL              |                |
| CancelId      | varchar(255) | YES  | UNI | NULL              |                |
| CreatedAt     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| Sender        | varchar(255) | YES  |     | NULL              |                |
| Timestamp     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| TransactionId | varchar(255) | YES  | UNI | NULL              |                |
+---------------+--------------+------+-----+-------------------+----------------+
TABLE: MarketSell
+---------------+--------------+------+-----+-------------------+----------------+
| Field         | Type         | Null | Key | Default           | Extra          |
+---------------+--------------+------+-----+-------------------+----------------+
| Id            | int(11)      | NO   | PRI | NULL              | auto_increment |
| ActiveKey     | bit(1)       | YES  |     | NULL              |                |
| AppId         | int(11)      | YES  | MUL | NULL              |                |
| BlockNumber   | int(11)      | YES  |     | NULL              |                |
| CreatedAt     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| Price         | double(18,8) | YES  |     | NULL              |                |
| Quantity      | double(18,8) | YES  |     | NULL              |                |
| Sender        | varchar(255) | YES  |     | NULL              |                |
| Symbol        | varchar(255) | YES  |     | NULL              |                |
| Timestamp     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| TransactionId | varchar(255) | YES  | UNI | NULL              |                |
+---------------+--------------+------+-----+-------------------+----------------+
TABLE: NftBurn
+---------------+--------------+------+-----+-------------------+----------------+
| Field         | Type         | Null | Key | Default           | Extra          |
+---------------+--------------+------+-----+-------------------+----------------+
| id            | int(11)      | NO   | PRI | NULL              | auto_increment |
| ActiveKey     | bit(1)       | YES  |     | NULL              |                |
| AppId         | int(11)      | YES  | MUL | NULL              |                |
| BlockNumber   | int(11)      | YES  |     | NULL              |                |
| created_at    | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| Nfts          | text         | YES  |     | NULL              |                |
| Sender        | varchar(255) | YES  |     | NULL              |                |
| Timestamp     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| TransactionId | varchar(255) | YES  | UNI | NULL              |                |
+---------------+--------------+------+-----+-------------------+----------------+
TABLE: NftIssue
+---------------+--------------+------+-----+-------------------+----------------+
| Field         | Type         | Null | Key | Default           | Extra          |
+---------------+--------------+------+-----+-------------------+----------------+
| id            | int(11)      | NO   | PRI | NULL              | auto_increment |
| ActiveKey     | bit(1)       | YES  |     | NULL              |                |
| AppId         | int(11)      | YES  | MUL | NULL              |                |
| BlockNumber   | int(11)      | YES  |     | NULL              |                |
| created_at    | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| FeeSymbol     | varchar(255) | YES  |     | NULL              |                |
| LockTokens    | varchar(255) | YES  |     | NULL              |                |
| Properties    | varchar(255) | YES  |     | NULL              |                |
| Sender        | varchar(255) | YES  |     | NULL              |                |
| Symbol        | varchar(255) | YES  |     | NULL              |                |
| Timestamp     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| To            | varchar(255) | YES  |     | NULL              |                |
| TransactionId | varchar(255) | YES  | UNI | NULL              |                |
+---------------+--------------+------+-----+-------------------+----------------+
TABLE: NftIssueMultiple
+---------------+--------------+------+-----+-------------------+----------------+
| Field         | Type         | Null | Key | Default           | Extra          |
+---------------+--------------+------+-----+-------------------+----------------+
| id            | int(11)      | NO   | PRI | NULL              | auto_increment |
| ActiveKey     | bit(1)       | YES  |     | NULL              |                |
| AppId         | int(11)      | YES  | MUL | NULL              |                |
| BlockNumber   | int(11)      | YES  |     | NULL              |                |
| created_at    | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| Instances     | text         | YES  |     | NULL              |                |
| Sender        | varchar(255) | YES  |     | NULL              |                |
| Timestamp     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| TransactionId | varchar(255) | YES  | UNI | NULL              |                |
+---------------+--------------+------+-----+-------------------+----------------+
TABLE: NftMarketBuy
+---------------+--------------+------+-----+-------------------+----------------+
| Field         | Type         | Null | Key | Default           | Extra          |
+---------------+--------------+------+-----+-------------------+----------------+
| id            | int(11)      | NO   | PRI | NULL              | auto_increment |
| ActiveKey     | bit(1)       | YES  |     | NULL              |                |
| AppId         | int(11)      | YES  | MUL | NULL              |                |
| BlockNumber   | int(11)      | YES  |     | NULL              |                |
| CreatedAt     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| MarketAccount | varchar(255) | YES  |     | NULL              |                |
| Nfts          | text         | YES  |     | NULL              |                |
| Sender        | varchar(255) | YES  |     | NULL              |                |
| Symbol        | varchar(255) | YES  |     | NULL              |                |
| Timestamp     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| TransactionId | varchar(255) | YES  | UNI | NULL              |                |
+---------------+--------------+------+-----+-------------------+----------------+
TABLE: NftMarketCancel
+---------------+--------------+------+-----+-------------------+----------------+
| Field         | Type         | Null | Key | Default           | Extra          |
+---------------+--------------+------+-----+-------------------+----------------+
| id            | int(11)      | NO   | PRI | NULL              | auto_increment |
| ActiveKey     | bit(1)       | YES  |     | NULL              |                |
| AppId         | int(11)      | YES  | MUL | NULL              |                |
| BlockNumber   | int(11)      | YES  |     | NULL              |                |
| CreatedAt     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| Nfts          | text         | YES  |     | NULL              |                |
| Sender        | varchar(255) | YES  |     | NULL              |                |
| Symbol        | varchar(255) | YES  |     | NULL              |                |
| Timestamp     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| TransactionId | varchar(255) | YES  | UNI | NULL              |                |
+---------------+--------------+------+-----+-------------------+----------------+
TABLE: NftMarketChangePrice
+---------------+--------------+------+-----+-------------------+----------------+
| Field         | Type         | Null | Key | Default           | Extra          |
+---------------+--------------+------+-----+-------------------+----------------+
| id            | int(11)      | NO   | PRI | NULL              | auto_increment |
| ActiveKey     | bit(1)       | YES  |     | NULL              |                |
| AppId         | int(11)      | YES  | MUL | NULL              |                |
| BlockNumber   | int(11)      | YES  |     | NULL              |                |
| CreatedAt     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| Nfts          | text         | YES  |     | NULL              |                |
| Price         | double(18,8) | YES  |     | NULL              |                |
| Sender        | varchar(255) | YES  |     | NULL              |                |
| Symbol        | varchar(255) | YES  |     | NULL              |                |
| Timestamp     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| TransactionId | varchar(255) | YES  | UNI | NULL              |                |
+---------------+--------------+------+-----+-------------------+----------------+
TABLE: NftMarketSell
+---------------+--------------+------+-----+-------------------+----------------+
| Field         | Type         | Null | Key | Default           | Extra          |
+---------------+--------------+------+-----+-------------------+----------------+
| id            | int(11)      | NO   | PRI | NULL              | auto_increment |
| ActiveKey     | bit(1)       | YES  |     | NULL              |                |
| AppId         | int(11)      | YES  | MUL | NULL              |                |
| BlockNumber   | int(11)      | YES  |     | NULL              |                |
| CreatedAt     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| Fee           | int(11)      | YES  |     | NULL              |                |
| Nfts          | text         | YES  |     | NULL              |                |
| Price         | double(18,8) | YES  |     | NULL              |                |
| PriceSymbol   | varchar(255) | YES  |     | NULL              |                |
| Sender        | varchar(255) | YES  |     | NULL              |                |
| Symbol        | varchar(255) | YES  |     | NULL              |                |
| Timestamp     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| TransactionId | varchar(255) | YES  | UNI | NULL              |                |
+---------------+--------------+------+-----+-------------------+----------------+
TABLE: NftSetProperties
+---------------+--------------+------+-----+-------------------+----------------+
| Field         | Type         | Null | Key | Default           | Extra          |
+---------------+--------------+------+-----+-------------------+----------------+
| id            | int(11)      | NO   | PRI | NULL              | auto_increment |
| ActiveKey     | bit(1)       | YES  |     | NULL              |                |
| AppId         | int(11)      | YES  | MUL | NULL              |                |
| BlockNumber   | int(11)      | YES  |     | NULL              |                |
| created_at    | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| Nfts          | text         | YES  |     | NULL              |                |
| Sender        | varchar(255) | YES  |     | NULL              |                |
| Symbol        | varchar(255) | YES  |     | NULL              |                |
| Timestamp     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| TransactionId | varchar(255) | YES  | UNI | NULL              |                |
+---------------+--------------+------+-----+-------------------+----------------+
TABLE: NftTransfer
+---------------+--------------+------+-----+-------------------+----------------+
| Field         | Type         | Null | Key | Default           | Extra          |
+---------------+--------------+------+-----+-------------------+----------------+
| id            | int(11)      | NO   | PRI | NULL              | auto_increment |
| ActiveKey     | bit(1)       | YES  |     | NULL              |                |
| AppId         | int(11)      | YES  | MUL | NULL              |                |
| BlockNumber   | int(11)      | YES  |     | NULL              |                |
| created_at    | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| Nfts          | text         | YES  |     | NULL              |                |
| Sender        | varchar(255) | YES  |     | NULL              |                |
| Timestamp     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| To            | varchar(255) | YES  |     | NULL              |                |
| TransactionId | varchar(255) | YES  | UNI | NULL              |                |
+---------------+--------------+------+-----+-------------------+----------------+
TABLE: TokensIssue
+---------------+--------------+------+-----+-------------------+----------------+
| Field         | Type         | Null | Key | Default           | Extra          |
+---------------+--------------+------+-----+-------------------+----------------+
| id            | int(11)      | NO   | PRI | NULL              | auto_increment |
| ActiveKey     | bit(1)       | YES  |     | NULL              |                |
| AppId         | int(11)      | YES  | MUL | NULL              |                |
| BlockNumber   | int(11)      | YES  |     | NULL              |                |
| created_at    | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| Quantity      | double(18,8) | YES  |     | NULL              |                |
| Sender        | varchar(255) | YES  |     | NULL              |                |
| Symbol        | varchar(255) | YES  |     | NULL              |                |
| Timestamp     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| To            | varchar(255) | YES  |     | NULL              |                |
| TransactionId | varchar(255) | YES  | UNI | NULL              |                |
+---------------+--------------+------+-----+-------------------+----------------+
TABLE: TokensStake
+---------------+--------------+------+-----+-------------------+----------------+
| Field         | Type         | Null | Key | Default           | Extra          |
+---------------+--------------+------+-----+-------------------+----------------+
| id            | int(11)      | NO   | PRI | NULL              | auto_increment |
| ActiveKey     | bit(1)       | YES  |     | NULL              |                |
| AppId         | int(11)      | YES  | MUL | NULL              |                |
| BlockNumber   | int(11)      | YES  |     | NULL              |                |
| created_at    | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| Quantity      | double(18,8) | YES  |     | NULL              |                |
| Sender        | varchar(255) | YES  |     | NULL              |                |
| Symbol        | varchar(255) | YES  |     | NULL              |                |
| Timestamp     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| To            | varchar(255) | YES  |     | NULL              |                |
| TransactionId | varchar(255) | YES  | UNI | NULL              |                |
+---------------+--------------+------+-----+-------------------+----------------+
TABLE: TokensTransfer
+---------------+--------------+------+-----+-------------------+----------------+
| Field         | Type         | Null | Key | Default           | Extra          |
+---------------+--------------+------+-----+-------------------+----------------+
| id            | int(11)      | NO   | PRI | NULL              | auto_increment |
| ActiveKey     | bit(1)       | YES  |     | NULL              |                |
| AppId         | int(11)      | YES  | MUL | NULL              |                |
| BlockNumber   | int(11)      | YES  |     | NULL              |                |
| created_at    | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| Memo          | text         | YES  |     | NULL              |                |
| Quantity      | double(18,8) | YES  |     | NULL              |                |
| Sender        | varchar(255) | YES  |     | NULL              |                |
| Symbol        | varchar(255) | YES  |     | NULL              |                |
| Timestamp     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| To            | varchar(255) | YES  |     | NULL              |                |
| TransactionId | varchar(255) | YES  | UNI | NULL              |                |
+---------------+--------------+------+-----+-------------------+----------------+
TABLE: TokensUnstake
+---------------+--------------+------+-----+-------------------+----------------+
| Field         | Type         | Null | Key | Default           | Extra          |
+---------------+--------------+------+-----+-------------------+----------------+
| id            | int(11)      | NO   | PRI | NULL              | auto_increment |
| ActiveKey     | bit(1)       | YES  |     | NULL              |                |
| AppId         | int(11)      | YES  | MUL | NULL              |                |
| BlockNumber   | int(11)      | YES  |     | NULL              |                |
| created_at    | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| Quantity      | double(18,8) | YES  |     | NULL              |                |
| Sender        | varchar(255) | YES  |     | NULL              |                |
| Symbol        | varchar(255) | YES  |     | NULL              |                |
| Timestamp     | timestamp    | YES  |     | CURRENT_TIMESTAMP |                |
| TransactionId | varchar(255) | YES  | UNI | NULL              |                |
+---------------+--------------+------+-----+-------------------+----------------+
Sort:  

Great job!

Nice work you did there. I would love the see more details about how you actually did stuff. Are you planning on putting the project on github?
Also I would love to see a frontend for exploring of the data!

!BEER !WINE

Thanks, this is sloppy so not ready for github yet. And I've already got some front-end pages in the works, so that'll be coming soon.

Amazing work! I have the same question as @primersion: will you open-source it? 😄 If so I would love to contribute with code.

P.S. I guess I unintendedly did something similar (in a small scope) by using my node to expose some endpoints with my "hive-engine witness voter tool" however I limited it to endpoints relating to witnesses. (https://github.com/DannyChain/votify#features)

!HYPNO

Hey @blervin, here is your HYPNO ;)

Congratulations @blervin! You have completed the following achievement on the Hive blockchain and have been rewarded with new badge(s) :

You received more than 1000 upvotes.
Your next target is to reach 1250 upvotes.

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 the last post from @hivebuzz:

Hive Tour Update - Advanced posting
Valentine's day challenge - Give a badge to your beloved!

Awesome. It indeed will be helpful as hive engine transactions seems like a mess. Keep it up.