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/litetokens/java-litetokens and extract it to
/deploy/java-litetokens
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
- Build the java-litetokens project
cd /deploy/java-litetokens
./gradlew build
- Copy the FullNode.jar and SolidityNode.jar along with config files into the respective directories.
download your needed config file from https://github.com/litetokens/LitetokensDeployment.
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
- 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/litetokens/LitetokensDeployment
- Configure the SolidityNode configuration file. You'll need to edit
config.conf
to connect to your localFullNode
. ChangetrustNode
innode
to local127.0.0.1:50051
, which is the default rpc port. Setlisten.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 changerpc port
to50052
or something to avoid conflicts. Please forward the UDP port 18888 for FullNode.
rpc {
port = 50052
}
- 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/litetokens/LitetokensDeployment
Logs for both nodes are located in /deploy/\*/logs/litetokens.log
. Use tail -f /logs/litetokens.log/
to follow along with the block syncing.
You should see something similar to this in your logs for block synchronization:
12:00:57.658 INFO [pool-7-thread-1] [o.t.c.n.n.NodeImpl](NodeImpl.java:830) Success handle block Num:236610,ID:0000000000039c427569efa27cc2493c1fff243cc1515aa6665c617c45d2e1bf
12:00:40.691 INFO [pool-17-thread-1] [o.t.p.SolidityNode](SolidityNode.java:88) sync solidity block, lastSolidityBlockNum:209671, remoteLastSolidityBlockNum:211823
Create file stop.sh,use kill -15 to close java-litetokens.jar(or FullNode.jar、SolidityNode.jar).
You need to modify pid=ps -ef |grep java-litetokens.jar |grep -v grep |awk '{print $2}'
to find the correct pid.
#!/bin/bash
while true; do
pid=`ps -ef |grep java-litetokens.jar |grep -v grep |awk '{print $2}'`
if [ -n "$pid" ]; then
kill -15 $pid
echo "The java-litetokens 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-litetokens killed successfully!"
break
fi
done