Nexus Dev
Search…
Tritium++ Private Testnet
This guide is to run a single or island node for testing. It does not require mining or staking to produce blocks

Introduction:

This guide will help to setup a private testnet for development. The private node has no consensus, and is a private database. This node can be used to test API calls, without spending on mining or the use of coins

Understanding Public, Private & Hybrid

The Nexus wallet can be used to run public, private and hybrid networks, the configuration is what sets them apart. The private and hybrid networks will not be compatible with legacy.
Public network is the mainnet which is an open public network. Private mode is a permissioned network, it is not connected to the mainnet and is a standalone network. Hybrid network is the amalgamation of the private and the public network. Hybrid mode helps organisations to keep their sensitive data safe, private and in their control, but use the security of the public network and also transfer value between the two.
In a private network, throughput can be increased by adding additional nodes. In a private network there is no mining or staking needed to secure the network.

Before Beginning this guide:

  • Any computer with minimum of 1 CPU, 2GB RAM and 20GB hard disk space, Raspberry Pi 4 with 2 GB RAM
  • Ubuntu server 20.04 LTS for AMD/IA64 or Ubuntu IOT for Raspberry Pi. (Use any linux distribution of choice, but this guide is tailored for ubuntu)
  • USB drive or SD card to install ubuntu
  • Etcher – To burn the OS image file to USB/SD card
  • Putty if using ssh via windows.

1. Prepare the Node

Install ubuntu server 20.04 LTS or distro of choice, install open-ssh server during the install and once the installation is complete, restart the node. SSH into the node and follow the below commands. Copy the commands and paste it in the terminal using keys CTRL+SHIFT+v
Update and upgrade the node:
1
sudo apt update; sudo apt upgrade -y
Copied!
Open SSH port before enabling firewall:
1
sudo ufw allow ssh
Copied!
Enable firewall:
1
sudo ufw enable
Copied!
Check firewall status:
1
sudo ufw status
Copied!
Set timezone:
1
sudo dpkg-reconfigure tzdata
Copied!
To change the hostname – Optional
1
sudo hostnamectl set-hostname <newhostname>
Copied!
Reboot node:
1
sudo reboot
Copied!
The computer is ready to install the nexus core

2. Compiling Nexus core:

Install the dependencies required for compiling nexus core, It will take some time to complete depending on the internet speed
1
sudo apt-get install -y build-essential libssl-dev libminiupnpc-dev git
Copied!
Download the latest nexus core 5.1 source code, should only take a few seconds to complete (This link may change as development progresses)
1
git clone --branch merging https://github.com/Nexusoft/LLL-TAO
Copied!
Tritium++ is in merging branch at the time of writing this guide
If Tritium++ moved to merging use the following command
1
git clone --depth 1 https://github.com/Nexusoft/LLL-TAO
Copied!
Change into the source code directory
1
cd LLL-TAO
Copied!
Run the command to compile from source, please be patient, as this can take a very long time depending on your CPU. Replace the 1 in ‘j1’ to the number of cores / threads for compiling faster.
1
make -f makefile.cli clean
Copied!
For x86/IA64 computers use:
1
make -f makefile.cli -j1 AMD64=1 NO_WALLET=1
Copied!
For compiling on Raspberry Pi use:
1
make -f makefile.cli -j1 ARM64=1 NO_WALLET=1
Copied!
Will show “Finished building nexus” on a successful compile.
The make command creates a new executable file named 'nexus'. To check use the list command
1
ls
Copied!
"ls" command lists the contents of the folder. The "nexus" executable is shown
There are two ways to access the wallet; from the LLL-TAO folder, API's can be accessed from this location only via terminal and for every command you have to specify the path (./) before the executable filename (./nexus) or if the executable file is moved to the /usr/bin directory, it can be accessed universally from any location without path (nexus). For this guide will not use the path.
To move the nexus executable to the /usr/bin folder:
1
sudo mv ~/LLL-TAO/nexus /usr/bin
Copied!

3. Configuring The Wallet (nexus.conf)

Create Nexus core directory (it’s a hidden directory, Nexus daemon creates it automatically on first start. We are creating it manually to create the configuration file. If the directory is available, skip this step.)
1
mkdir ~/.Nexus
Copied!
Th wallet configuration is stored in nexus.conf. Create the nexus.conf file
1
nano ~/.Nexus/nexus.conf
Copied!
Copy the configuration below, to the nexus.conf file with ctrl+shift+v and edit or disable the parameters as needed.
1
#Nexus private standalone node config- Only for 5.1 rc1 & above
2
#Default API user/pass to blank for private network
3
#apiuser=<username>
4
#apipassword=<password>
5
#Disable authentication of API requests
6
apiauth=0
7
#To remotely access the node API's
8
apiremote=1
9
#To remotely access API's use the llpallowip flag. The <ipaddress> can use wildcards; (llpallowip=192.168.*.*:7080)
10
llpallowip=<ipaddress>:7080
11
#Run wallet as a daemon
12
daemon=1
13
#Run node in private mode (defaults to testnet in 5.1)
14
private=1
15
#Run as a standalone node. (Disable this on additional nodes)
16
manager=0
17
#Run as a local node, disable for public node
18
nodns=1
19
#Enables multiple users to be logged in concurrently
20
multiuser=1
21
#Latency is in ms, this is the min time between blocks
22
latency=500
23
#Enables creation of blocks in private mode.( Use only on one node) (Use a secure password)
24
generate=<password>
25
#To connect additional nodes use addnode flag, the ipaddress will be of the first node with the ‘generate’ flag)
26
addnode=<ipaddress>
27
#To avoid accidental node shutdown with the stop command
28
system/stop=<password>
Copied!
Ctrl+s and Ctrl+x to save and exit the editor
To add an additional node to the private network, disable ‘manager’ and ‘generate’ flags. Add the ‘addnode’ flag with ipaddress referring to the first node or the one with the ‘generate’ flag and an additional line for any other node in the network

4. API Commands

To interact with the nexus core, use API commands via the terminal or remotely. If you have any doubts you can refer to the API documentation here. The documentation for 5.1.rc1 may take some time to be updated at the time of writing the guide.
Open port 7080 and 8336 on the firewall.
1
sudo ufw allow 7080/tcp
Copied!
1
sudo ufw allow 8336/tcp
Copied!
If the executable is in the LLL-TAO directory to start nexus core, change into the LLL-TAO folder to run all the following commands "cd LLL-TAO To start the daemon, use the path and the executable file name ./nexus If you have moved the nexus executable file to the /user/bin then use the following command from any location nexus
To stop the daemon without password protection in config:
1
nexus system/stop
Copied!
To stop the daemon with password protection in config:
1
nexus system/stop password=<password>
Copied!
To get the node info:
1
./nexus system/get/info
Copied!
To monitor your logs:
1
// tail -f ~/.Nexus/testnet1/log/0.log
Copied!
To create a user account (signature chain). Username must be a minimum of 2 characters, passwords must be 8 characters and pin 4 characters. The PIN can be a combination of letters/numbers/symbols.
1
nexus users/create/user username=<username> password=<password> pin=<pin>
Copied!
Multiuser mode creates a new session for every user logged in and the user has to use that particular sessionID with every API request for the particular user. Save the session ID.
To login the user
1
nexus users/login/user username=<username> password=<password> pin=<pin>
Copied!
To unlock the account for automatically credit incoming transactions set (notifications=1). If it's not set you will have to manually credit the incoming transactions else it will be credited back to the sender's account after 24 hrs. This is the reversible transaction function working as designed.
1
nexus users/unlock/user pin=<pin> notifications=1 session=<sessionid>
Copied!
To check the full node metrics.
1
./nexus system/get/metrics
Copied!
The API commands can be used from the browser and output in JSON is displayed. (JSON formatter extension used to parse the JSON output)
Hope this guide was helpful !!