Background: I want to have a better understanding of the Hive ecosystem and blockchain. I will walk through the developer documentation and add my own personal notes as I go along. This information may help you if you're looking into becoming a developer or want a better understanding of the Hive Blockchain.
This journey will not cover the Node install and operations. I will be more focused on the development environment for now. In the future, I’ll focus on the node install and operation .
OS: Fedora/Redhat/Centos
Technology used : Docker
Quickstart-hive-full-nodes guide : https://developers.hive.io/quickstart/#quickstart-testnet
Docker image: https://hub.docker.com/r/inertia/tintoy
Tinman repo: https://gitlab.syncad.com/hive/tinman#running-testnet-witness-node-s-
Coding language ( Python ): https://developers.hive.io/tutorials/#tutorials-python
Docker run command (This creates the container from the docker image inertia/tintoy:latest)
( docker run --name hive-testnet -d -p 2001:2001 -p 8080:8080 -p 8090:8090 -p 8091:8091 -p 8092:8092 inertia/tintoy:latest )
The primary port needed for testing is 8090
OS Firewall issue : Fedora includes firewalld. You will need to open port 8090 if you wish to access the service remotely. Run the below commands to open port 8090
firewall-cmd --list-ports
firewall-cmd --add-port=8090/tcp --permanent
firewall-cmd --reload ( This may not work fully and require a service restart )
systemctl restart firewalld
Python:
Use pip to install beem
pip3 install beem
Beem source : https://github.com/holgern/beem
Beem project page : https://pypi.org/project/beem/
Install openssl-devel and python-devel
yum install gcc openssl-devel python-devel
Beem basic usage:
Type “beempy” and this will take you to the CLI
If you type currentnode , it will output the current node you are connected to.
beempy> currentnode
+----------+-----------------+
| Key | Value |
+----------+-----------------+
| Version | 1.25.0 |
| Chain | hive |
| Node-Url | https://anyx.io |
You’ll notice you are not connected to your test node. Beem will connect to the public nodes by default.
To connect your local test node use the command below.
beempy --node http://IP:8090
The three user accounts I will use for testing are tnman,porter and mandagoi. No particular reason for using these accounts. You can obtain the private keys for the accounts by running the below commands
docker exec -it <container_ID> get_dev_key tintoy owner-tnman active-tnman posting-tnman memo-tnman
docker exec -it <container_ID> get_dev_key tintoy owner-porter active-porter posting-porter memo-porter
docker exec -it <container_ID> get_dev_key tintoy owner-mandagoi active-mandagoi posting-mandagoi memo-mandagoi
((this step may not be needed as even when using the old snapshot. I was able to work with the testnet. More reading may be required to learn about the snapshot json file ))
Run a snapshot as the snapshot file in the docker image is dated for April 2021
(The above command took an hour to complete.)
/root/ve/tinman/bin/tinman snapshot -s https://anyx.io | pv -l > snapshot.json
If pv is not installed run apt install pv
Next run /root/ve/tinman/bin/tinman sample -i snapshot.json -o sample-snapshot.json
And remove snapshot.json
----------------------------- user accounts --------------
To grab some users accounts for testing i used the curl command
curl -s --data '{"jsonrpc":"2.0", "method":"condenser_api.lookup_witness_accounts", "params":["a",10], "id":1}' http://localip:8090
https://developers.hive.io/apidefinitions/#condenser_api.lookup_witness_accounts-curl-examples
Returned dataset
{
"jsonrpc": "2.0",
"result": [
"mandagoi",
"mangou007",
"maninayton",
"mantaxr",
"mapetoke",
"marc5",
"marcbrands",
"marcelhattingh",
"marcj11",
"marcus747"
],
"id": 1
}
Next step will be to walk through the Python tutorials
https://developers.hive.io/tutorials-python/using_keys_securely.html