How to Deploy a TRON Node on Linux
Ready to explore the exciting world of TRON and become a validator? Our easy-to-follow guide will lead you through the necessary steps of deploying a node on TRON to support the network's health.
TRON Node: An Overview
TRON (TRX): A Brief Background
Decentralization is everything that aligns with TRON's vision.
Established in 2018, TRON is a blockchain-based project that aims to create a universal decentralized infrastructure for users. Initially, TRON focused on enabling the global distribution of content and the development of applications without the need for a central authority. The blockchain has successfully onboarded over 160 million users five years since its debut.
Early achievements have motivated the team to strive for even greater goals. In June 2023, Justin Sun, the founder of TRON DAO, unveiled a new mission for the blockchain - creating a 'Metaverse Free Port.' This ambitious undertaking aims to establish a financial environment that is accessible to all, further solidifying TRON's commitment to decentralization.
What is a TRON Node?
Nodes are crucial as they are the specialized client software's operational units. The TRON nodes act as the guardians of the TRON network by verifying blocks and transaction data, ensuring the network's integrity and security.
TRON encompasses different types of nodes, but two types stand out:
- Fullnode:
A Fullnode serves as a comprehensive repository that stores and synchronizes the complete blockchain data. It verifies all blocks and states while offering external query capabilities through HTTP API and Grpc API. Super Representatives are required to run a Fullnode for block generation and transaction packaging.
- Lite Fullnode:
A Lite Fullnode shares the same codebase as the Fullnode but operates using a state data snapshot. This snapshot includes account state data and historical data from the most recent 256 blocks.
Unlike the Fullnode, the Lite Fullnode conserves disk space, starts up rapidly, but sacrifices the ability to provide historical block and transaction data queries. Developers seeking block synchronization, transaction processing, and transaction broadcasting capabilities can choose to run a Lite Fullnode.
Running a TRON node offers numerous advantages.
First, your node independently verifies transactions and blocks against consensus rules. So you don't need to rely on external services or place blind trust in them. The only person you need to trust is yourself.
Second, running a node grants you the freedom to program custom RPC endpoints tailored to your specific needs.
And finally, by running a TRON node, you contribute to the growth of the ecosystem.
TRON Node Requirements
Before plunging into the installation process, ensuring your computing resources meet the node's hunger is vital. The recommended specifications stand tall as follows:
Fullnode:
- CPU: A brawny 16 cores
- RAM: An ample 32 GB
- Bandwidth: A swift 100 Mbps
- SSD: At least 2.5 TB
Fullnode running by Super Representatives:
- CPU: An impressive 32 cores
- RAM: A hefty 64 GB
- Bandwidth: A swift 100 Mbps
- SSD: At least 2.5 TB or beyond
Important prerequisites:
- Ensure sufficient disk space to accommodate the client's demands.
- Validate that memory and CPU resources remain untethered and unfettered by other voracious programs.
- Keep your operating system up-to-date, adopting the latest advancements.
- Time and date synchronization.
You can refer to TRON Nodes and Clients guide to get more information.
How to Set Up a TRON Node on Linux
Step 1: Obtain Fullnode.jar
First, you can acquire FullNode.jar by compiling the source code or downloading the released jar directly.
Compiling the source code:
- Start by obtaining the java-tron source code using the following commands:
$ git clone https://github.com/tronprotocol/java-tron.git
$ git checkout -t origin/master
- Proceed to compile the source code by executing the following:
$ cd java-tron
$ ./gradlew clean build -x test
Upon successful completion of the build process, you will find the FullNode.jar within the ./java-tron/build/libs/
directory.
Step 2: Starting the Node
To deploy a full node for the mainnet, carefully follow these steps:
- Acquire the mainnet configure file named
main_net_config.conf
. Refer to their respective files if you are working with other network configurations. - Launch the full node for the mainnet using the following command:
$ java -Xmx24g -XX:+UseConcMarkSweepGC -jar FullNode.jar -c main_net_config.conf
Note:
The -XX:+UseConcMarkSweepGC
flag specifies parallel garbage collection and should be placed before the -jar
parameter, not at the end.
The -Xmx
flag defines the maximum value of the JVM heap, which can be set to 80% of the available physical memory.
To initiate a full node that produces blocks for the mainnet, implement the following steps:
- Include the
--witness
parameter in the startup command. - Add the private key of the super representative address to the
localwitness
list in themain_net_config.conf
file. For instance:
localwitness = [ 650950B193DDDDB35B6E48912DD28F7AB0E7140C1BFDEFD493348F02295BD812]
Ensure you possess a super representative account and have garnered votes from other participants. Starting a full node that produces blocks is imperative if your votes rank among the top 27.
Note: It is advisable to utilize session-keeping tools like screen or tmux rather than the nohup
command, as interaction may be required during the node's operation.
Additional Information:
- If you prefer to specify the private key of the witness account using keystore + password, please consult the provided documentation for detailed instructions.
- Consider the tcmalloc optimization method outlined in the documentation for optimal memory allocation. Specific steps may vary based on your Linux distribution.
Remember, deploying a Tron node requires attentiveness and a comprehensive understanding of the instructions provided. Exercise caution and ensure you possess the necessary knowledge and expertise before proceeding with the deployment.
That's it! You've successfully set up a TRON node. Remember to refer to the TRON network documentation for more details on each command and additional best practices.