Nyzo techSetup instructionsRelay server

Relay server

The relay server is a run mode provided by the Nyzo verifier codebase. The following instructions are for an Ubuntu Linux system, but the server will also run on Windows, Mac OS, and other Linux distributions.

Ensure that your server has port 80 open to all IP addresses to which you want to permit access. Begin the installation by updating apt.

sudo apt update

Next, install haveged. This is a program that provides entropy for cryptographically secure random-number generators. It is not necessary for the core tasks of the relay server, but the Verifier class loads its private seed in a static block, and lack of sufficient entropy on a system can cause the application to block indefinitely when trying to generate a new private seed for the verifier.

sudo apt install haveged -y

Install the Java development kit (JDK). JDK 8 is preferred for Nyzo.

sudo apt install openjdk-8-jdk -y

Install supervisor. This is used to manage the server Java process.

sudo apt install supervisor -y

Clone the Nyzo verifier repository.

git clone https://github.com/n-y-z-o/nyzoVerifier.git

Change to the new nyzoVerifier directory and build the code.

cd nyzoVerifier && ./gradlew build

Make the Nyzo data root directory.

sudo mkdir -p /var/lib/nyzo/production

Create the supervisor configuration file. The first command makes the script executable. The second command runs the script to generate the file. The third command copies the file to the supervisor configuration directory.

chmod +x nyzoRelayServer.sh && ./nyzoRelayServer.sh && sudo cp nyzoRelay Server.conf /etc/supervisor/conf.d/

Create the /var/lib/nyzo/production/relay_endpoints file. On https://relay0.nyzo.co, the file is similar to the following. For endpoints echoed from other URLs, the third parameter is the refresh interval in milliseconds.

https://nyzo.co/cycleUpdatePrivate,/cycleUpdate,5000
file://var/lib/nyzo/production/web/index.html,/
file://var/lib/nyzo/production/web/staticWeb,/staticWeb
file://var/lib/nyzo/production/web/seedTransactions,/seed Transactions
file://var/lib/nyzo/production/web/graffiti.json,/graffiti.json

Start the relay server.

sudo supervisorctl reload

You should now be able to view your relay server in a web browser. If you cannot load pages, check the firewall to ensure port 80 is open. Also, refer to /var/log/nyzo-relay-server.log.

If you want to enable SSL on your relay server, ensure port 443 is open and follow the Web listener HTTPS instructions.