Skip to content

Install RskJ Using Fat JAR

Martín Coll edited this page May 30, 2018 · 20 revisions

Following the instructions below you will install and run the RSK node and it will work connected to RSK MainNet (by default).

Then, you can:

Install the node using RSKj Fat (or Uber) JAR

The Fat JAR or Uber JAR can be downloaded or compiled (in a reproducible way or not).

Once you have the JAR, you should install the Solidity Compiler and the Java 8 JDK.

Also you should download the node config file.

Next step is to complete your configuration by generating your node keys and identifiers. Type this command on terminal:

$ java -cp <PATH-TO-THE-RSKJ-FATJAR> co.rsk.GenNodeKeyId
  • Replace <PATH-TO-THE-RSKJ-FATJAR> with your path to the jar file. As an example: C:/RskjCode/rskj-core-0.4.2-BAMBOO-all.jar

It creates an unique identifier for the node and generates a valid key to be used:

{
   "privateKey": "47e50ddc101094b1a078c52507fb65d5a30cf492a69d1520e2b2a7de40c6a3ad",
   "publicKey": "0477a96a97e274113fd4519b01fa968b5706f3d2b5e70fa7a4b6c2fa09a1c6cddeca837419ba4874767cb533601f3f601976f871bc1287c35aef24e10d47254481",
   "address": "6512be26a5f9bb9fc1badbf8274d9121b7a8c296",
   "nodeId": "77a96a97e274113fd4519b01fa968b5706f3d2b5e70fa7a4b6c2fa09a1c6cddeca837419ba4874767cb533601f3f601976f871bc1287c35aef24e10d47254481"
}

You can use the generated values to replace in the config file:

  • <NODE_ID> with the generated nodeId
  • <PRIVATE_KEY> with the generated privateKey

Other values that should be configured are:

  • <DATABASE_PATH> should be replaced with the path to the directory where the database will be stored. It can be any directory you have write permissions. E.g. /home/user/Documents/rskj-database.
  • <SOLC_PATH> should be replaced with the path to the Solidity Compiler binary. If you don't have it installed, you can point to a dummy executable file (example: /bin/false).

When everything is configured, you can run the node by executing:

$ java -Drsk.conf.file=<PATH-TO-THE-CONFIG-FILE> -cp <PATH-TO-THE-RSKJ-FATJAR> co.rsk.Start 
  • Replace <PATH-TO-THE-CONFIG-FILE> with your path to the config file. As an example: C:/RskjCode/rsk-sample.conf
  • Replace <PATH-TO-THE-RSKJ-FATJAR> with your path to the jar file. As an example: C:/RskjCode/rskj-core-0.4.2-BAMBOO-all.jar

Check everything's working with an RPC call

If you see no output, then it means the node is running. To check, you can open a new console tab (it's important you don't close this one or interrupt the process) and issue a request to the node's RPC HTTP server. This is an example using cURL:

$ curl localhost:4444 -X POST -H "Content-Type: application/json" --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

The response should be something like {"jsonrpc":"2.0","id":1,"result":"0xfc0"}, where the result property is the number of the latest block you've synced so far (in hexadecimal).

Any problems?

We hope our Troubleshooting section can help you!

Clone this wiki locally