## A Hacker's Guide to Hive It has been a while since I last tried posting a tutorial series. As I am getting closer to releasing my first 'real app' for Hive, I want to blog about its development and what thoughts have gone into the system I am using. Developing for Hive (blockchain) has some unique challenges. Instead of describing these abstract problems, I'll try to 'hack' my way into it. This is a hands-on approach. _Inspired by:_ [A Hackers' Guide to Language Models, by Jeremy Howard](https://youtu.be/jkrNMKz9pWU) I watched all sorts of talks and presentations on LMs. This guide actually made it 'click' for me. He brushes over the necessary theory you need to know, but then jumps straight into 'how to use it'. Turns out, he is not some random dude, but his 'invention' caused the current revolution in AI. Not comparing myself to him, but I let his 'hacker' approach inspire me.
![blackbox.png](https://files.peakd.com/file/peakd-hive/felixxx/23uEwkJXVQZBWGMuTPbMF8HMbrgmFb8HsRrt8uPYCJVS2xKpwunsw1C7yQ14WRrjmSxa9.png)
# Hive as a black box Let's say you know a little bit about - computers - programming ...you found Hive and want to build a service, a 'bot', a game... ### what is Hive? ...you go to https://hive.io/ It's blockchain. It's fast. It's scalable... - what does it do? - how does it work? ### _black box_ In the following I try to work out the only things you **absolutely need** to know. The most practical approach; Treat Hive like a _black box_.
![hive_tables_small.png](https://files.peakd.com/file/peakd-hive/felixxx/242NcwVbrJ283sAScDfvsdp7TjSiG81AxeW7MLwpPzVE4HrTtkc7toXJxW5CsZdUyHQUj.png)
## Hive State API reference: - https://developers.hive.io/ ### example - https://developers.hive.io/apidefinitions/#database_api.get_dynamic_global_properties #### Python + requests: ``` import requests hive_api_url = 'https://api.hive.blog' def hive_api_get_properties(url): data = '{"jsonrpc":"2.0", "method":"database_api.get_dynamic_global_properties", "id":1}' return requests.post(url, data=data) response = hive_api_get_properties(hive_api_url) result = response.json()["result"] print(result) ``` * ``pip install requests`` _I try to avoid dependencies, but ``requests`` just makes this so much cleaner..._ * save file as ``test.py``, run like: ``python test.py`` _If you need any help with Python, please ask below._ #### Javascript in browser: ``` <!DOCTYPE html> ``` * save as ``test.html``, open with browser * check out console _If you need any help with JS, please ask below._ ## What you **need** to know * **You can access Hive's API through https.** * **Hive's state changes;** Make the same request later, the response can be different. Hive's a black box, that changes state over time. ___ Please let me know, if this interests you and if I should tag you in the next post. **Happy New Year!**