In the past I used a wallet that allowed me to do TRON (TRX) staking. Some times ago, that wallet provider disabled the staking function. Accordingly, I was looking for a way to do everything necessary from the command line on myself. With the tronapi from PyPi I found a Python package that seems to be useful for testing purposes and more.
In order to understand how access to the TRON blockchain is possible, I wrote scripts in BASH and Python so far. Unlike in other cryptocurrencies, the operation of a local TRON node is not necessary. This is a great advantage if you want to interact with the TRON blockchain.
TRON is a fork of the crypto currency Ethereum. As a result of this, programming methods, which were developed for Ethereum are used by TRON in variations. This is important for understanding how to program methods for TRON.
Python scripts based on the last tronapi
version works well. Using the Python module requests
from PyPi, direct access to the TRON RPC API is possible. This allows to use every command from the TRON RPC API.
Tron (TRX) staking works as follows. First step is to freeze an amount of Tron. Next one has to identify an so called Super Representative (SR). Afterwards one votes for this SR. That's it in principle. Rewards can be claimed on a daily basis.
It is implemented so far:
-
Creating TRON accounts.
-
Requesting account informations from the TRON blockchain.
-
Freezing TRON balance for staking.
-
Unfreezing TRON balance from staking.
-
Voting for TRON Super Representatives.
-
Claiming rewards from the TRON blockchain.
-
and some more ...
I am gradually organising the scripts under main-categories like BASH and Python for the used programming languages, and sub-categories like account creation and staking for the methods etc.
TQamF8Q3z63sVFWiXgn2pzpWyhkQJhRtW7