Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

documentation/TRX/Solidity_and_Full_Node_Deployment_EN.md at master · tronprotocol/documentation #43

Open
manxb opened this issue Oct 16, 2024 · 0 comments

Comments

@manxb
Copy link
Owner

manxb commented Oct 16, 2024

Create separate directories for fullnode and soliditynode

 /deploy/fullnode
    /deploy/soliditynode 

Create two folders for fullnode and soliditynode.

Clone our latest master branch of https://github.com/tronprotocol/java-tron and extract it to

Make sure you have the proper dependencies.

  • JDK 1.8 (JDK 1.9+ is not supported yet)
  • On Linux Ubuntu system (e.g. Ubuntu 16.04.4 LTS), ensure that the machine has Oracle JDK 8, instead of having Open JDK 8 in the system. If you are building the source code by using Open JDK 8, you will get Build Failed result.
  • Open UDP ports for connection to the network
  • MINIMUM 2 CPU Cores
  1. Build the java-tron project
 cd /deploy/java-tron 
    ./gradlew build 
  1. Copy the FullNode.jar and SolidityNode.jar along with config files into the respective directories.
 download your needed config file from https://github.com/tronprotocol/TronDeployment.
    main_net_config.conf is the config for mainnet, and test_net_config.conf is the config for testnet.
    please rename the config file to `config.conf` and use this config.conf to start fullnode and soliditynode.

    cp build/libs/FullNode.jar ../fullnode
    cp build/libs/SolidityNode.jar ../soliditynode 
  1. You can now run your Fullnode using the following command:
 java -jar FullNode.jar -c config.conf // make sure that your config.conf is downloaded from https://github.com/tronprotocol/TronDeployment 
  1. Configure the SolidityNode configuration file. You'll need to edit config.conf to connect to your local FullNode. Change trustNode in node to local 127.0.0.1:50051, which is the default rpc port. Set listen.port to any number within the range of 1024-65535. Please don't use any ports between 0-1024 since you'll most likely hit conflicts with other system services. Also change rpc port to 50052 or something to avoid conflicts. Please forward the UDP port 18888 for FullNode.

  2. You can now run your SolidityNode using the following command:

 java -jar SolidityNode.jar -c config.conf //make sure that your config.conf is downloaded from https://github.com/tronprotocol/TronDeployment 

Logs for both nodes are located in /deploy/\*/logs/tron.log. Use tail -f /logs/tron.log/ to follow along with the block syncing.

You should see something similar to this in your logs for block synchronization:

 00:01:14.073 INFO  [nioEventLoopGroup-6-28] [o.t.c.n.TronNetDelegate](TronNetDelegate.java:176) Success process block Num:9171046,ID:00000000008bf06616a0895f515a91fda077e2c7c762b902f2e84414d536ca39. 
 20:06:10.866 INFO  [Thread-14] [app](SolidityNode.java:142) Get last remote solid blockNum: 0, remoteBlockNum: 0, cost: 4 

Create file stop.sh,use kill -15 to close java-tron.jar(or FullNode.jar、SolidityNode.jar). You need to modify pid=ps -ef |grep java-tron.jar |grep -v grep |awk '{print $2}' to find the correct pid.

#!/bin/bash
while true; do
  pid=`ps -ef |grep java-tron.jar |grep -v grep |awk '{print $2}'`
  if [ -n "$pid" ]; then
    kill -15 $pid
    echo "The java-tron process is exiting, it may take some time, forcing the exit may cause damage to the database, please wait patiently..."
    sleep 1
  else
    echo "java-tron killed successfully!"
    break
  fi
done 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant