Ctrl + X and Y to exit and confirm saving changes to a file.
Create Data Directory to store chain data for Rootstock blockchain.
mkdir /root/rootstock/database/mainnet/
Download Rootstock
# Download Rootstock within your "rootstock" directory.
cd ./root/rootstock/
git clone --recursive https://github.com/rsksmart/rskj.git
cd rskj
git checkout tags/ARROWHEAD-6.3.1 -b ARROWHEAD-6.3.1
# From within the root of your "rskj" directory, run the following.
./configure.sh
# This will download and set important components (ex. Gradle Wrapper)
Compile the node
# From within the root of your "rskj" directory, run the following.
./gradlew build -x test
Create systemd service for Rootstock node
# Copy and paste the code below and run it within your terminal.
sudo echo "[Unit]
Description=Rootstock Node
After=network.target
StartLimitIntervalSec=200
StartLimitBurst=5
[Service]
Type=simple
Restart=on-failure
RestartSec=5
TimeoutSec=900
User=root
Nice=0
LimitNOFILE=200000
WorkingDirectory=/root/rootstock/rskj/rskj-core/build/libs/
ExecStart=/usr/bin/java -Drsk.conf.file=/root/rootstock/config/node.conf -jar /root/rootstock/rskj/rskj-core/build/libs/rskj-core-6.3.1-ARROWHEAD-all.jar co.rsk.Start
KillSignal=SIGTERM
[Install]
WantedBy=multi-user.target" > /etc/systemd/system/rootstock.service
Start Rootstock Node
sudo systemctl daemon-reload # refresh for systemd configuration changes
sudo systemctl enable rootstock.service # enable rootstock.service at start up
sudo systemctl start rootstock.service # start rootstock.service
View Logs for Debugging
This method of installing does not allow you to view sync progress.
journalctl -fu rootstock.service
Query Rootstock Node
curl -H "Content-Type: application/json" -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}' http://localhost:4444
# The response should resemble the follow
{"jsonrpc":"2.0","id":1,"result":"0xcab5ab"}