Script en Python - An谩lisis de Transferencias en la Blockchain de Hive: Obt茅n Informaci贸n Detallada sobre Transacciones entre Usuarios 馃嚜馃嚫 馃嚭馃嚫
Espa帽ol
Este script est谩 creado principalmente para aquellos proyectos enfocados en fomentar la adopci贸n de la criptomoneda $HBD, como @hivesucre y futuros proyectos que puedan sumarse a esta iniciativa, tambi茅n para aquellas cuentas o usuarios que llevan control de su econom铆a en Hive y desean obtener informaci贸n detallada de sus finanzas. Adem谩s, es un buen ejemplo para aquellos usuarios (como yo) que se inician en el desarrollo de aplicaciones que interact煤an con la blockchain Hive a trav茅s de sus APIs y bibliotecas.
Este es un paso m谩s en el compromiso que tengo con todos ustedes y con el testigo @hispapro, para impulsar la innovaci贸n y el desarrollo tecnol贸gico en Hive.
Este script desarrollado en el lenguaje de programaci贸n Python, realiza un an谩lisis del historial de las transferencias en la blockchain de Hive para un usuario o un conjunto de usuarios espec铆ficos. A partir de la fecha de donde queremos extraer las transferencias, se calculan los d铆as transcurridos, se lee la lista de usuarios desde un archivo de texto para extraer todas las transacciones de transferencias recibidas y realizadas de la criptomoneda $HIVE y el $HBD, luego se generan las tablas en formato markdown y las gr谩ficas, mostrando un resumen de cada usuario y tambi茅n la suma mensual de todo el conjunto.
De manera pr谩ctica y como ejemplo, he usado 3 cuentas de casas de cambios muy populares, extrayendo la data de todo lo que va de a帽o 2023. Tablas y gr谩ficos a continuaci贸n:
| Username | HIVE Sent | HIVE Received | HBD Sent | HBD Received |
|---|---|---|---|---|
| cuenta1 | 536148 | 301087 | 28622.3 | 118592 |
| cuenta2 | 55250.2 | 10530 | 1258.97 | 16665.4 |
| cuenta3 | 40832 | 25353.5 | 35.121 | 5607.62 |
| Total | 632231 | 336971 | 29916.4 | 140865 |
| Month | HIVE Sent | HIVE Received | HBD Sent | HBD Received |
|---|---|---|---|---|
| 2023-01 | 100634 | 55799.9 | 6049.24 | 20424.1 |
| 2023-02 | 80636.8 | 45383.5 | 7804.59 | 23920.8 |
| 2023-03 | 105059 | 51844.8 | 3197.99 | 24338.5 |
| 2023-04 | 105062 | 56889.4 | 1378.14 | 22172.8 |
| 2023-05 | 108169 | 51380.6 | 6884.31 | 27792.2 |
| 2023-06 | 112874 | 62168.7 | 4578.93 | 19937.7 |
| 2023-07 | 19795.4 | 13503.8 | 23.244 | 2278.54 |
| Total | 632231 | 336971 | 29916.4 | 140865 |
Es posible filtrar los datos y tambi茅n entregar la informaci贸n de muchas maneras distintas, adapt谩ndose a cada necesidad o proyecto, por ejemplo, $Hive enviado o recibido hacia o desde una cuenta en espec铆fico, $HBD enviado o recibido a partir de un memo o o cadena de caracteres de un memo, etc...
Para este script es necesaria la instalaci贸n de la biblioteca beem con la cual hacemos la conexi贸n con la blockchain de Hive y extraemos los datos. Matplotlib, es una biblioteca de c贸digo abierto para generar gr谩ficas de manera sencilla. Adem谩s es necesaria una lista de dependencias que encontrar谩n en el archivo requirements.txt en el repositorio del c贸digo.
El c贸digo est谩 alojado en los repositorios de GitLab de forma p煤blica para que pueda ser utilizado, modificado y distribuido. Ver c贸digo fuente aqu铆.
En el repositorio del c贸digo se encuentra la documentaci贸n para clonar el c贸digo, creaci贸n del entorno virtual, instalaci贸n de bibliotecas de Python y la puesta en marcha del script.
Espero les sea de utilidad y que pueda ser difundido para que llegue a todos los nuevos usuarios que se adentran en el desarrollo de aplicaciones para Hive. Si necesitan ayuda para la implementaci贸n o desean obtener informaci贸n sobre sus proyectos, abajo dejo la informaci贸n de contacto. No se olviden dejar su comentario. Un abrazo.
English
This script is created mainly for those projects focused on promoting the adoption of the $HBD cryptocurrency, such as @hivesucre and future projects that may join this initiative, also for those accounts or users who keep track of their economy in Hive and wish to obtain detailed information on their finances. In addition, it is a good example for those users (like me) who are starting in the development of applications that interact with the Hive blockchain through its APIs and libraries.
This is one more step in the commitment I have with all of you and with the @hispapro token, to drive innovation and technological development in Hive.
This script developed in the Python programming language, performs an analysis of the history of transfers on the Hive blockchain for a specific user or set of users. Starting from the date from where we want to extract the transfers, the elapsed days are calculated, the list of users is read from a text file to extract all the transactions of transfers received and made of the $HIVE cryptocurrency and the $HBD, then tables in markdown format and graphs are generated, showing a summary of each user and also the monthly sum of the whole set.
In a practical way and as an example, I have used 3 very popular exchange house accounts, extracting the data for the whole of 2023 so far. Tables and graphs below:
| Username | HIVE Sent | HIVE Received | HBD Sent | HBD Received |
|---|---|---|---|---|
| cuenta1 | 536148 | 301087 | 28622.3 | 118592 |
| cuenta2 | 55250.2 | 10530 | 1258.97 | 16665.4 |
| cuenta3 | 40832 | 25353.5 | 35.121 | 5607.62 |
| Total | 632231 | 336971 | 29916.4 | 140865 |
| Month | HIVE Sent | HIVE Received | HBD Sent | HBD Received |
|---|---|---|---|---|
| 2023-01 | 100634 | 55799.9 | 6049.24 | 20424.1 |
| 2023-02 | 80636.8 | 45383.5 | 7804.59 | 23920.8 |
| 2023-03 | 105059 | 51844.8 | 3197.99 | 24338.5 |
| 2023-04 | 105062 | 56889.4 | 1378.14 | 22172.8 |
| 2023-05 | 108169 | 51380.6 | 6884.31 | 27792.2 |
| 2023-06 | 112874 | 62168.7 | 4578.93 | 19937.7 |
| 2023-07 | 19795.4 | 13503.8 | 23.244 | 2278.54 |
| Total | 632231 | 336971 | 29916.4 | 140865 |
It is possible to filter the data and also deliver the information in many different ways, adapting to each need or project, for example, $Hive sent or received to or from a specific account, $HBD sent or received from a memo or string of characters from a memo, etc ....
For this script it is necessary to install the beem library with which we make the connection to the Hive blockchain and extract the data. Matplotlib, is an open source library to generate graphs in a simple way. In addition a list of dependencies is required which you will find in the requirements.txt file in the code repository.
The code is publicly hosted in the GitLab repositories so that it can be used, modified and distributed. See source code here.
In the code repository you will find documentation for cloning the code, creating the virtual environment, installing Python libraries and getting the script up and running.
I hope you find it useful and that it can be disseminated to reach all new users who are new to Hive application development. If you need help for the implementation or want to get information about your projects, below I leave the contact information. Don't forget to leave a comment. Best regards.
Translated with www.DeepL.com/Translator (free version)
Mi intenci贸n con esta publicaci贸n es dar mi aporte al software libre y al c贸digo abierto, difundiendo al p煤blico en general todos los beneficios, ventajas y facilidades de obtener versiones seguras, optimas y de vanguardia.
Si necesitas una VPS donde alojar tus servicios en la nube, entra con mi enlace de referido a DigitalOcean y consigue cr茅ditos para tus pruebas
Las im谩genes son m铆as o capturas de pantalla tomadas por m铆, a menos que se indiquen fuentes externas. La portada fue creada con canva e im谩genes libres de derechos de autor.
Discord: alberto0607
S铆gueme en Twitter: alberto_0607