Skip to content

Compile and run USC node on Linux

Teh Sunn Liu (AlexLiu) edited this page Mar 28, 2019 · 6 revisions

This step by step guide will help you compile and run the USC node on Linux.

Pre-requisites

First of all, you will need to install

Dependency Details
Git for Linux Download this Git command line tool
Java 8 JDK Follow the steps to install Java. To check if the installation went correctly, check the version with the command: java -version. Then, as admin, modify /etc/enviroment adding JAVA_HOME="/usr/lib/jvm/java-8-oracle"
IntelliJ IDEA Community Install this Java IDE

Get external dependency

Clone ulordj-thin. Go to ulordj-thin/src/main/java/co/usc/ulord/hello/ and execute

$ sudo make

the command in your terminal. This will create a libCryptoHello.so in /usr/lib directory.

Before you can launch IntelliJ IDEA, there is an important step. In your terminal move to /Ulord-Sidechain folder and run the command

OR run the following command

$ ./configure.sh

This will download the external dependency (eg. ulordj-thin).

Compiling and running the node

Now, clone Ulord-Sidechain(Older version) or USC-2(New Version) if you want to run the next generation of Ulord-Sidechain, and launch IntelliJ IDEA. After launching the IDE, you should have a window similar to this.

  • Click on Import Project
  • Browse Ulord-Sidechain directory and select build.gradle and click Ok

  • Within the dialog select Use default Gradle wrapper and click Finish. It will take some time to load.

  • Now, click on View->Tool Windows->Gradle, on the window on the right click on the Sync button as shown in the following figure. This will sync all the external dependencies required for the Ulord-Sidechain project.

At this point, the project has all its dependencies downloaded. Now, you will have set Build/Run configuration.

Build/Run configuration

Create a new configuration profile to run the node from IDEA. This can be done by clicking on Run->Edit Configurations as shown in the following figure.

Then set the options as shown below.

  • Main Class: co.usc.Start
  • VM options: -Dusc.conf.file=ulord-testnet.conf
  • Working directory: /path-to-code/Ulord-Sidechain
  • Use classpath of module: uscj-core_main
  • JRE need to be set as: Default (1.8 - SDK of 'uscj-core_main' module)

The last step is to open /Ulord-Sidechain/uscj-core/build.gradle file and then right click on task generateResources and click Run. This will generate build-info.properties file.

Conratulations! Now, you are ready to build and run your node.


Next, configure your node.