blockbook icon indicating copy to clipboard operation
blockbook copied to clipboard

Add Tron Network Support to Blockbook

Open cranycrane opened this issue 8 months ago • 7 comments

The focus of my Bachelor's thesis was to implement a blockchain explorer for Tron. I have used Blockbook for this and would like to contribute my work to this repository.

Summary of changes

  1. Added Coin configuration for Tron and Tron Nile Testnet
  2. TronRPC extends the EthereumRPC due to the fact that Java-Tron client has JSON-RPC interface compatible with Ethereum
  3. The interface is not fully compatible, which leads to specific implementations and certain limitations described below
  4. Unit, JSON-RPC, API and FakeBlockchain tests were implemented.
  5. Extended the ZeroMQ implementation to be modular due to the fact that Java-Tron uses ZeroMQ for notifying of new blocks and transactions.

Merge Checklist

  • [x] Coin configuration file added (tron.json)
  • [x] tron package implements JSON-RPC, parser, client, and types
  • [x] Unit and integration tests added and passing
  • [x] Documentation updated (docs/ports.md, docs/config.md)
  • [ ] Code review by at least one maintainer

Known limitations

  • Java-Tron JSON-RPC does not support an equivalent method to eth_sendRawTransaction. This could be solved by implementing HTTP Client and calling the /wallet/broadcasthex endpoint in HTTP API.
  • TRC-10 tokens are a specific function of Tron, recognition of such transactions can be done only through the HTTP API. For the same reason, recognition of staking, delegating, voting and other Tron-specific transactions can be done only through the HTTP API
  • This solution relies on the current implementation of the eth package, but utilises the current code and minimises duplicates.

The Tron Blockbook is currently running on http://147.229.8.210:51661/.

I will be happy to discuss my implementation and improve my current solution, so it can be integrated into the Blockbook repository.

cranycrane avatar Jun 16 '25 19:06 cranycrane

@martinboehm could you please take a look?

cranycrane avatar Sep 02 '25 12:09 cranycrane

@cranycrane thank you very much for your contribution! We are very busy with other tasks but will review it asap.

martinboehm avatar Sep 11 '25 09:09 martinboehm

@etimofeeva Can you also take a look, please ? 🙏

MiroslavProchazka avatar Sep 22 '25 15:09 MiroslavProchazka

@cranycrane testing is in process, will start on review shortly, apologies for the delay with this.

etimofeeva avatar Sep 24 '25 10:09 etimofeeva

Hello @cranycrane, thank you a lot for your contribution! Can you please reach out to me at [email protected], so we can chat about the PR outside of GH?

Thanks a lot! MP

MiroslavProchazka avatar Sep 24 '25 13:09 MiroslavProchazka

Hi @cranycrane, could you share the hardware requirements for running a mainnet node and a testnet node?

overcat avatar Sep 30 '25 13:09 overcat

Hello @overcat,

I don't have a minimum hw requirements, but I can give you the specs we run Tron mainnet: 3.1TB - javatron 1.3TB - blockbook 24GB - RAM (up to 124GB - on a shared server) 32 CPU cores at 2-10% utilisation

cranycrane avatar Sep 30 '25 13:09 cranycrane