Only this pageAll pages
Powered by GitBook
1 of 17

HyperCore

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Loading...

Legacy

  • Specifications

  • Cryptography

  • Node Paths

  • Tutorials

  • Linux

    • Node Deployment

Roles

Pillar

Welcome

Welcome to our official guide for setting up a Zenon Network Pillar. This comprehensive manual will walk you through selecting the right hosting provider, configuring your server, installing necessary dependencies, and deploying the Zenon controller. Whether you're a seasoned developer or new to blockchain infrastructure, this guide will ensure a smooth and secure setup process.

Technical

Welcome to the Zenon technical documentation. Please email [email protected] if you'd like to contribute to its maintenance.

Legacy

Specifications
Cryptography
Node Paths
Tutorials
Linux
Node Deployment

Node Paths

The Zenon Node znnd has the following default data paths:

  • Linux: ~/.znn

  • MacOS: ~/Library/znn Please note that the path can be different due to the hardened runtime policy

  • Windows: C:\Users\yourusername\AppData\Roaming\znn

You can change the default DataPath using znnd --data "value"

Folder Structure

The Zenon Node has the following folder structure:

.
├── config.json               - config file used by znnd 
├── consensus                 - consensus DB used by znnd
├── genesis.json              - genesis config file. Used to create the genesis Momentum
├── log                       - logs generated by znnd
│   ├── error                 - only error logs generated by znnd
│   │   └── zenon.error.log   - latest logs - maxes out at 100MB
│   └── zenon.log             - latest logs - maxes out at 100MB
├── network                   - network DB used by znnd
├── network-private-key       - network identity
├── nom                       - nom DB used by znnd
├── syrius                    - syrius files
└── wallet                    - folder cointaining all keyFiles
    ├── user-1                - keyFile with custom name
    └── z1qpnq2hl2...         - keyFile with no custom name

Specifications

Phase 1 Specs

  • EpochDurationInSeconds: 24 60 60 (1 day)

  • MomentumTime: 10 seconds

Pillar Node Parameters

  • PillarStakeAmount: 15000 ZNN

  • PillarQsrStakeBaseAmount: 150000 QSR

  • PillarQsrStakeIncreaseAmount: 10000 QSR

  • PillarEpochLockTime: 83 epochs

  • PillarEpochRevokeTime: 7 epochs

  • PillarNameLengthMax: 40 characters

Sentinel Node Parameters

  • SentinelZnnRegisterAmount: 5000 ZNN

  • SentinelQsrDepositAmount: 50000 QSR

  • SentinelEpochLockTime: 27 epochs

  • SentinelEpochRevokeTime: 3 epochs

Staking Parameters

  • StakeTimeUnit: 30 epochs

  • StakeTimeMin: 30 epochs

  • StakeTimeMax: 360 epochs

  • StakeMinAmount: 1 ZNN

Plasma Parameters

  • FuseMinAmount: 10 QSR

  • FuseExpiration: 10 hours

ZTS Token Parameters

  • TokenIssueAmount: 1 ZNN (burned)

  • TokenNameLengthMax: 40 characters

  • TokenSymbolLengthMax: 10 characters

  • TokenDomainLengthMax: 128 characters

  • TokenMaxSupplyBig: 2^255 - 1

  • TokenMaxDecimals: 18

Swap Parameters

  • SwapAssetDecayEpochsOffset: 90

  • SwapAssetDecayTickEpochs: 30

  • SwapAssetDecayTickValuePercentage: 10

Papers

Node Deployment

There are 3 types of nodes: Pillar, Sentinel, Full Node.

Pillar

For the Pillar deployment process one will need access to both a local and a remote machine. The local machine is represented by the controller wallet, where you create the Pillar Slot and register the Pillar on the network. The remote machine is usually represented by a VPS with some minimum recommended specs and a public IP that is actively participating in the consensus protocol.

You will need to generate 3 distinct addresses for the Pillar creation tutorial:

  • pillarAddress = address from which the Pillar is registered that contains the necessary funds (15,000 ZNN that will be locked and can be recovered after you disassemble the Pillar and 150,000 QSR + additional 10,000 QSR for every new Pillar Slot in the network that will be burned and cannot be recovered)

  • pillarRewardsAddress = address used to collect the Pillar rewards

  • producerAddress = address used to produce the momentums that is stored on the remote machine; must be generated from a different seed than your local wallet keyStore for security purposes

Sentinel

The Sentinel deployment process is similar to the Pillar deployment process.

Controller Wallet

The latest version of the s y r i u s wallet is recommended to be used as controller wallet. Advanced users can use the znn-cli instead.

Remote Machine

These commands should be issued from your remote machine (e.g. VPS). If you won't use a VPS provider, you will need an additional setup including enabling port forwarding. This tutorial is intended for a VPS with some minimum recommended specs and a public IP.

Minimum Requirements

Hardware:

  • CPU >= 4 cores

  • RAM >= 4 GB

  • Storage >= 40 GB free space

  • >100Mbps network dedicated bandwidth

Software:

  • Linux distros e.g. Ubuntu 20.04 LTS/Debian 11

  • Recommended NTP configuration*

  • Recommended Watchdog service*

(*) Included if the setup is performed using the znn-controller

Steps

1. Download the znn-controller

See for the latest releases.

2. Run znn-controller as root

3. Follow the provided instructions

sudo ./znn-controller
zenon-network / go-zenon
lightpaper.pdf
whitepaper.pdf

Migration Guide (On Pillar)

This guide outlines the steps to migrate an existing orchestrator from one Pillar virtual machine (VM) to another, preserving its ability to participate in the HyperCore bridge’s Threshold Signature Scheme (TSS) signer set. It builds on the Orchestrator Setup Guide on Pillar.

Table of Contents

  1. Prerequisites

  2. Set Up the Orchestrator on the New VM

  3. Transfer the Orchestrator Configuration

  4. Set Up and Start the Orchestrator Service

  5. Verify Migration


1) Prerequisites

  • Old VM Access: Ensure the original VM (old Pillar) is still accessible and running the orchestrator.

  • New VM Setup: The new VM should have a working Pillar node synced with the Zenon Network of Momentum (NoM), as per the Pillar setup guide.

  • Backup: Back up the old VM’s orchestrator directory (/root/.orchestrator) and producer keystore before proceeding.

  • SSH Access: You need SSH access to both the old and new VMs with sufficient permissions (e.g., root or sudo).


2) Set Up the Orchestrator on the New VM

If the orchestrator isn’t already installed on the new VM, follow the initial setup steps from the Orchestrator Setup Guide first.


3) Transfer the Orchestrator Configuration

Copy the entire .orchestrator folder from the old VM to the new VM. This includes the old /producer folder and old config.json:

scp -r root@<old-vm-ip>:/root/.orchestrator /root/

4) Set Up and Start the Orchestrator Service

Follow step 6 of the Setup Guide.


5) Verify Migration

Confirm the orchestrator is functioning and recognized by the bridge.

a) Check Logs:

View recent logs for errors:

journalctl -u orchestrator -n 50

b) Test Health Check:

Query the orchestrator’s API:

curl -X POST -d '{"method":"getBuildInfo", "params":[]}' -H "Content-Type: application/json" http://localhost:55000

Expected output includes version info, e.g.,

{"result":{"version":"v0.0.9a","gitCommit":"edf58a929989e70656a5f04501b25fb918f6ef71","goVersion":"go1.22.1"},"error":""}.

Orchestrator

Linux

The Zenon Alphanet (Phase 0) binaries are available for Linux, macOS and Windows x86_64 CPU architecture operating systems.

Ubuntu 20.04 LTS was used for this tutorial.

1. Download the Binaries

Download znnd, znn-cli and znn-controller from their respective GitHub repos. Please note that znn-controller is only available for Linux at the moment.

2. Verification (depreciated)

Import the Zenon Testnet PGP key from hkps.pool.sks-keyservers.net

gpg --keyserver hkps.pool.sks-keyservers.net --recv E2D8289C0A9D2C28A3320B62D2AAFD5D9088F1A2

If you don't have gpg installed, please use sudo apt install gnupg

gpg: key E2D8289C0A9D2C28A3320B62D2AAFD5D9088F1A2: public key "Zenon Testnet <[email protected]>"

Verify the signature. The same command can be used on macOS:

gpg --verify `path_to_sig`.sig `path_to_release_bundle`

gpg: Good signature from "Zenon Testnet <[email protected]>"

3. Start the Node Daemon

If you are on a Linux machine, use the znn-controller option 1) Deploy:

./znn-controller

Otherwise use:

./znnd

4. Verify Node RPC Communication

Inspect the config.json file using your favorite text editor.

Navigate to ~/.znn/config.json.

Check if the http, websocket entries are enabled (true). By default, all Endpoints are public.

The default HTTPPort is 35997 and WSPort is 35998.

{
  "RPC": {
    "EnableHTTP": true,
    "EnableWS": true,
    "Endpoints": null
  }
}

You can also disable the RPC communication via znn-cli:

./znn-cli disableRPC

RPC successfully disabled
Start znnd to use the new configuration

5. Generate a ZNN Alphanet Address (optional)

./znn-cli wallet.createNew yourComplexPassphrase

Successfully created keystore: z1qz8tylu88et6ffy227pw8gak5qvn5awg35l96x

6. Check for Pending Funds (optional)

./znn-cli unreceived --keyStore z1qz8tylu88et6ffy227pw8gak5qvn5awg35l96x --passphrase yourComplexPassphrase

If you have pending funds you should see messages like these:

Unreceived 15000.00000000 ZNN from z1qqjr86g6220kmhn2jrelwhtk7u0mp4r5amjwf2.
Use hash b3e51142119174f8af3ea793a7353ec8b5b4e2208f9ebe50549ead5440fd6b49 to receive.

Unreceived 15000.00000000 QSR from z1qqjr86g6220kmhn2jrelwhtk7u0mp4r5amjwf2.
Use hash c68c674c81d4d9abc2b7a20c999352c21a8128033f9b34105b3616119f116e3c to receive.

7. Receive the Pending Funds (optional)

In order to receive the ZNN you need to issue the command receive with the corresponding hash:

./znn-cli receive b3e51142119174f8af3ea793a7353ec8b5b4e2208f9ebe50549ead5440fd6b49 --keyStore z1qz8tylu88et6ffy227pw8gak5qvn5awg35l96x --passphrase yourComplexPassphrase

If you don't have Plasma, you'll need to generate it via PoW, please wait.

Creating receive transaction ...
Generating Plasma, please wait ...
Done

Similarly, you'll receive the QSR by issuing the command receive with the corresponding hash:

./znn-cli receive c68c...6e3c --keyStore z1qz8tylu88et6ffy227pw8gak5qvn5awg35l96x --passphrase yourComplexPassphrase

Creating receive transaction ...
Generating Plasma, please wait ...
Done

8. Check Your Balance (optional)

./znn-cli balance --keyStore z1qz8tylu88et6ffy227pw8gak5qvn5awg35l96x --passphrase yourComplexPassphrase

Balance for account-chain z1qz8tylu88et6ffy227pw8gak5qvn5awg35l96x having height 2
150000.00000000 QSR
15000.00000000 ZNN

9. Deploy a Pillar, Sentinel or Full Node

Follow these Node Deployment instructions to deploy a Pillar or Sentinel.

10. Stop the Node Daemon

You can use the stop command from znn-cli if znnd is located at the same working directory:

./znn-cli stop znnd

If you deployed via znn-controller please use option 4 (Stop service)

Otherwise use:

pkill -9 znnd

Cryptography

Wallet

The wallet data is stored inside a KeyStore

AES-256-GCM for symmetric encryption

Argon2.IDkey as Key Derivation Function

  • time: 1

  • memory: 64 * 1024

  • threads: 4

  • key_length: 32

An encrypted KeyStore is referred to as KeyVault.

KeyVault Example

Digital Signing Algorithm

Ed25519 is a deterministic signature scheme using curve25519

Key Derivation

Ed25519 which is compatible with BIP44

  • key parameter: ed25519 seed

  • hardened offset: 0x80000000

BIP44 Format

Alphanet (Network of Momentum Phase 0) uses coin_type value 73404

Alphanet Address Format

bech32

  • human readable part: z

data

  • user account prefix byte: 0

  • embedded contract prefix byte: 1

  • core: first 19 bytes of sha3(pubKey)

address: bech32(hrp, data)

Example

Entropy

Mnemonic

BIP44 Path

Private Key

Public Key

User Prefix Byte

Core Bytes

Address

Zenon Dart SDK Example

Code

Output

{
  "baseAddress":"z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7",
  "crypto":{
    "argon2Params": {
      "salt":"0x1563f86f7afa59dd0be150ffeac10896"
    },
    "cipherData":"0xe81dbb96f5b9839f3741ceff8362e1ebf09e05a8311354658ddf979577ffd0dd34df55757d1fd37e677e3ae7d055b2ed",
    "cipherName":"aes-256-gcm",
    "kdf":"argon2.IDKey",
    "nonce":"0xb7cc39120d5b87a3b7af58b7"
  },
  "timestamp":1633548746,
  "version":1
}
m / purpose' / coin_type' / account' / change / address_index
bc827d0a00a72354dce4c44a59485288500b49382f9ba88a016351787b7b15ca
route become dream access impulse price inform obtain engage ski believe awful absent pig thing vibrant possible exotic flee pepper marble rural fire fancy
m/44'/73404'/0'
d6b01f96b566d7df9b5b53b1971e4baeb74cc64167a9843f82d04b2194ca4863
3e13d7238d0e768a567dce84b54915f2323f2dcd0ef9a716d9c61abed631ba10
00
25374a419f32736f61ecc5ac4059d2f1b5884d
z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7
import 'package:hex/hex.dart';
import 'package:znn_sdk_dart/znn_sdk_dart.dart';

Future<void> main() async {
  final mnemonic =
      'route become dream access impulse price inform obtain engage ski believe awful absent pig thing vibrant possible exotic flee pepper marble rural fire fancy';

  var keyStore = KeyStore.fromMnemonic(mnemonic);
  var keyPair = keyStore.getKeyPair(0);
  var privateKey = keyPair.getPrivateKey();
  var publicKey = await keyPair.getPublicKey();
  var address = await keyPair.address;

  print('Entropy: \n${keyStore.entropy}\n');
  print('Mnemonic: \n${keyStore.mnemonic}\n');
  print('BIP44 path: \n${Derivation.getDerivationAccount(0)}\n');
  print('Private key: \n${HEX.encode(privateKey!)}\n');
  print('Public key: \n${HEX.encode(publicKey!)}\n');
  print('User & Core bytes: \n${HEX.encode(address!.core!)}\n');
  print('Address: \n$address');
}
Entropy:
bc827d0a00a72354dce4c44a59485288500b49382f9ba88a016351787b7b15ca

Mnemonic:
route become dream access impulse price inform obtain engage ski believe awful absent pig thing vibrant possible exotic flee pepper marble rural fire fancy

BIP44 path:
m/44'/73404'/0'

Private key:
d6b01f96b566d7df9b5b53b1971e4baeb74cc64167a9843f82d04b2194ca4863

Public key:
3e13d7238d0e768a567dce84b54915f2323f2dcd0ef9a716d9c61abed631ba10

User & Core bytes:
0025374a419f32736f61ecc5ac4059d2f1b5884d

Address:
z1qqjnwjjpnue8xmmpanz6csze6tcmtzzdtfsww7

Setup Guide

By setting up a Zenon Pillar, you play a pivotal role in enhancing the decentralization, security, and overall robustness of the Zenon ecosystem.

Table of Contents

  1. Prerequisites

  2. Choosing a Hosting Provider

  3. Minimum Hardware Requirements

  4. Choosing the Operating System

  5. Server Setup and Configuration

    • Accessing the Server

    • Updating the System

    • Installing Required Packages

  6. Installing the Zenon Controller

  7. Configuring Automatic Restarts with Cron

  8. Deploying the Pillar

  9. Post-Deployment Steps

  10. Useful Commands


1) Prerequisites

Before proceeding, ensure you have the following:

  • Basic Knowledge: Familiarity with command-line interfaces and server management.

  • Access Credentials: SSH access to your chosen server with sudo privileges.


2) Choosing a Hosting Provider

Selecting a reliable hosting provider is crucial for the stability and performance of your Zenon Pillar. Consider the following factors when choosing a provider:

  • Reliability and Uptime: Ensure the provider offers high uptime guarantees (99.9% or higher).

  • Performance: Look for providers with robust CPU and RAM options to handle blockchain operations.

  • Scalability: Ability to upgrade resources as your node grows.

  • Security: Features like DDoS protection, firewalls, and regular backups.

  • Support: 24/7 customer support can be invaluable.

  • Cost: Balance between features and your budget.

Popular Hosting Providers:

  • DigitalOcean

  • Amazon Web Services (AWS)

  • Hetzner

  • Google Cloud Platform (GCP)

  • Microsoft Azure

  • Vultr

  • Linode

Choose a provider that best fits your requirements and budget.


3) Minimum Hardware Requirements

To ensure optimal performance and stability of your Zenon Pillar, your server should meet the following minimum hardware specifications:

Component
Minimum Requirement

CPU

≥ 4 cores (ideally 8 CPU for the initial sync)

RAM

≥ 4 GB (ideally 16 GB for the initial sync)

Storage

≥ 40 GB free space

Network

Dedicated bandwidth with speeds exceeding 100 Mbps


4) Choosing the Operating System

For optimal performance and compatibility with the Zenon controller, it is recommended to use a Linux distribution. The x86/64 znn_controller-linux release is compatible with several distros, including:

  • Ubuntu 22.04 LTS (Recommended)

  • Debian 11

  • CentOS 8

  • Fedora 36


5) Server Setup and Configuration

Accessing the Server

  1. Obtain SSH Credentials: After setting up your server with your chosen provider, retrieve the SSH IP address, username, and password/key.

  2. Connect via SSH:

    ssh username@your_server_ip

    Replace username with your server's username (commonly root) and your_server_ip with your server's IP address.

  3. Switch to Root User:

    sudo -i

    This command grants you root privileges for the installation process.

Updating the System

Ensure your server's package lists and installed packages are up to date by running the command individually:

apt update
apt upgrade -y
  • apt update: Updates the package index.

  • apt upgrade -y: Upgrades all installed packages to their latest versions.

Installing Required Packages

Install unzip and other necessary utilities:

apt install -y unzip wget
  • unzip: Required for extracting the Zenon controller ZIP file.

  • wget: Facilitates downloading files from the internet.


6) Installing the Zenon Controller

  1. Download the Zenon Controller: Execute the following command to download and extract the Zenon controller:

    wget -O znn_controller-linux-x86_64.zip https://github.com/zenon-network/znn_controller_dart/releases/download/v0.0.4-alpha/znn_controller-linux-x86_64.zip && \
    unzip -o znn_controller-linux-x86_64.zip && \
    rm znn_controller-linux-x86_64.zip

    Visit the official Zenon Network Github repository for the latest znn_controller_dart release: https://github.com/zenon-network/znn_controller_dart/releases

    • wget -O: Downloads the file and saves it with the specified name.

    • unzip -o: Extracts the ZIP file, overwriting existing files if necessary.

    • rm: Removes the ZIP file after extraction to save space.

  2. Verify Installation:

    Ensure the znn-controller executable is present:

    ls -la | grep znn-controller

    You should see the znn-controller file listed.


7) Configuring Automatic Restarts with Cron

For the initial sync of your Zenon Pillar, it's recommended to configure automatic restarts. This ensures that the controller restarts hourly, speeding up the sync process.

  1. Open Crontab Editor:

    crontab -e

  2. Add Cron Job:

    1. Press i to enter insert mode.

    2. Navigate to the end of the file.

    3. Add the following line to schedule a restart every hour:

      0 * * * * /usr/bin/sudo /usr/sbin/service go-zenon restart

  3. Save and Exit:

    1. Press Esc to exit insert mode.

    2. Type :wq and press Enter to save and quit.

Once your Pillar catches up to the latest height, disable the automatic restart cron by commenting out the line: # 0 * * * * /usr/bin/sudo /usr/sbin/service go-zenon restart


8) Deploying the Pillar

  1. Start the Zenon Controller:

    ./znn-controller

  2. Deployment Options:

    Upon running the controller, you will be presented with deployment options. To deploy your pillar:

    • Select option 1) Deploy

  3. Monitoring Synchronization: The controller will begin syncing to the latest block height of the Zenon network. This process may take some time (even days) depending on network conditions and server performance. To monitor the status of your sync:

    Select option 2) Status And compare it to the latest height in your syrius wallet, or trusted Zenon Network explorers: https://www.zenonhub.io https://explorer.zenon.org https://www.zenon.tools


9) Post-Deployment Steps

After your pillar has successfully synced to the latest height, it's crucial to remove the cron job so that the Pillar doesn't miss momentums unnecessarily:

  1. Comment Out the Cron Job:

    Prevent the automatic restart to avoid interrupting the controller's operation.

    • Re-open Crontab Editor:

      crontab -e

    • Locate the Cron Job:

      # 0 * * * * /usr/bin/sudo /usr/sbin/service go-zenon restart

    • Add a # at the Beginning:

      This comments out the line, disabling the scheduled restart.

  2. Save and Exit:

    1. Press Esc to exit insert mode.

    2. Type :wq and press Enter to save and quit.


10) Useful Commands

Watch the Pillar's logs in real-time:

watch systemctl status go-zenon

Verify the Sync / Height Status:

Replace the PRIVATE-IP with your Pillar's Private IP address:

curl -X GET http://PRIVATE-IP:35997 -H "content-type: application/json" -d '{"jsonrpc": "2.0", "id": 21, "method": "stats.syncInfo", "params": []}'

You will receive a response:

{"jsonrpc":"2.0","id":21,"result":{"state":1,"currentHeight":1998515,"targetHeight":5113554}}

When the state goes from 1 to 2, then your Pillar is fully synced.

Migration Guide

If you're looking to migrate your Pillar to a new hosting provider.

Table of Contents

  1. Prerequisites

  2. Choosing a Hosting Provider

  3. Minimum Hardware Requirements

  4. Choosing the Operating System

  5. Server Setup and Configuration

    • Accessing the Server

    • Updating the System

    • Installing Required Packages

  6. Installing the Zenon Controller

  7. Configuring Automatic Restarts with Cron

  8. Deploying the Pillar

  9. Update Producer Address

  10. Post-Deployment Steps

  11. Useful Commands


It's recommend leaving your existing Pillar online during the migration if it's still producing momentums. The migration is seemless, the only difference between the Setup Guide and this Migration Guide, is that you will copy your new Pillar's producer address and update it in your syrius wallet for the Pillar's reward address. Details are provided in Step 9) Update Producer Address.


1) Prerequisites

Before proceeding, ensure you have the following:

  • Basic Knowledge: Familiarity with command-line interfaces and server management.

  • Access Credentials: SSH access to your chosen server with sudo privileges.


2) Choosing a Hosting Provider

Selecting a reliable hosting provider is crucial for the stability and performance of your Zenon Pillar. Consider the following factors when choosing a provider:

  • Reliability and Uptime: Ensure the provider offers high uptime guarantees (99.9% or higher).

  • Performance: Look for providers with robust CPU and RAM options to handle blockchain operations.

  • Scalability: Ability to upgrade resources as your node grows.

  • Security: Features like DDoS protection, firewalls, and regular backups.

  • Support: 24/7 customer support can be invaluable.

  • Cost: Balance between features and your budget.

Popular Hosting Providers:

  • DigitalOcean

  • Amazon Web Services (AWS)

  • Hetzner

  • Google Cloud Platform (GCP)

  • Microsoft Azure

  • Vultr

  • Linode

Choose a provider that best fits your requirements and budget.


3) Minimum Hardware Requirements

To ensure optimal performance and stability of your Zenon Pillar, your server should meet the following minimum hardware specifications:

Component
Minimum Requirement

CPU

≥ 4 cores (ideally 8 CPU for the initial sync)

RAM

≥ 4 GB (ideally 16 GB for the initial sync)

Storage

≥ 40 GB free space

Network

Dedicated bandwidth with speeds exceeding 100 Mbps


4) Choosing the Operating System

For optimal performance and compatibility with the Zenon controller, it is recommended to use a Linux distribution. The x86/64 znn_controller-linux release is compatible with several distros, including:

  • Ubuntu 22.04 LTS (Recommended)

  • Debian 11

  • CentOS 8

  • Fedora 36


5) Server Setup and Configuration

Accessing the Server

  1. Obtain SSH Credentials: After setting up your server with your chosen provider, retrieve the SSH IP address, username, and password/key.

  2. Connect via SSH:

    ssh username@your_server_ip

    Replace username with your server's username (commonly root) and your_server_ip with your server's IP address.

  3. Switch to Root User:

    sudo -i

    This command grants you root privileges for the installation process.

Updating the System

Ensure your server's package lists and installed packages are up to date by running the command individually:

apt update
apt upgrade -y
  • apt update: Updates the package index.

  • apt upgrade -y: Upgrades all installed packages to their latest versions.

Installing Required Packages

Install unzip and other necessary utilities:

apt install -y unzip wget
  • unzip: Required for extracting the Zenon controller ZIP file.

  • wget: Facilitates downloading files from the internet.


6) Installing the Zenon Controller

  1. Download the Zenon Controller: Execute the following command to download and extract the Zenon controller:

    wget -O znn_controller-linux-x86_64.zip https://github.com/zenon-network/znn_controller_dart/releases/download/v0.0.4-alpha/znn_controller-linux-x86_64.zip && \
    unzip -o znn_controller-linux-x86_64.zip && \
    rm znn_controller-linux-x86_64.zip

    Visit the official Zenon Network Github repository for the latest znn_controller_dart release: https://github.com/zenon-network/znn_controller_dart/releases

    • wget -O: Downloads the file and saves it with the specified name.

    • unzip -o: Extracts the ZIP file, overwriting existing files if necessary.

    • rm: Removes the ZIP file after extraction to save space.

  2. Verify Installation:

    Ensure the znn-controller executable is present:

    ls -la | grep znn-controller

    You should see the znn-controller file listed.


7) Configuring Automatic Restarts with Cron

For the initial sync of your Zenon Pillar, it's recommended to configure automatic restarts. This ensures that the controller restarts hourly, speeding up the sync process.

  1. Open Crontab Editor:

    crontab -e

  2. Add Cron Job:

    1. Press i to enter insert mode.

    2. Navigate to the end of the file.

    3. Add the following line to schedule a restart every hour:

      0 * * * * /usr/bin/sudo /usr/sbin/service go-zenon restart

  3. Save and Exit:

    1. Press Esc to exit insert mode.

    2. Type :wq and press Enter to save and quit.

Once your Pillar catches up to the latest height, disable the automatic restart cron by commenting out the line: # 0 * * * * /usr/bin/sudo /usr/sbin/service go-zenon restart


8) Deploying the Pillar

  1. Start the Zenon Controller:

    ./znn-controller

  2. Deployment Options:

    Upon running the controller, you will be presented with deployment options. To deploy your pillar:

    • Select option 1) Deploy

  3. Monitoring Synchronization: The controller will begin syncing to the latest block height of the Zenon network. This process may take some time (even days) depending on network conditions and server performance. To monitor the status of your sync:

    Select option 2) Status And compare it to the latest height in your syrius wallet, or trusted Zenon Network explorers: https://www.zenonhub.io https://explorer.zenon.org https://www.zenon.tools


9) Update Producer Address

Once and ONLY once your new Pillar has synced up to the latest height, should you proceed with this step of the migration. If you update your producer address prior to a full sync, you will miss rewards as your Pillar will not be participating in the network until it's fully caught up. Therefore if your new Pillar reached the latest height:

  1. Open Your syrius Desktop Wallet

    1. Click on the ⚙️ in the navigation bar.

    2. Select the address of the Pillar you're migrating.

    3. Click on Pillars in the navigation bar.

    4. Click on +Update Pillar

    5. For the Pillar producer address field, paste the new Pillar's Producer Address, and press Next and Update until it saves the new address. Steps to get your new Pillar's Address are written below.

  2. Start the Zenon Controller:

    ./znn-controller

  3. Deployment Options:

    Upon running the controller, you will be presented with deployment options. To deploy your pillar:

    • Select option 2) Status

  4. Copy Producer Address Use this new Pillar Producer Address to update in the syrius wallet.


10) Post-Deployment Steps

After your pillar has successfully synced to the latest height and you've updated your Pillar's Producer Address in your syrius wallet, it's crucial to remove the cron job so that the Pillar doesn't miss momentums unnecessarily:

  1. Comment Out the Cron Job:

    Prevent the automatic restart to avoid interrupting the controller's operation.

    • Re-open Crontab Editor:

      crontab -e

    • Locate the Cron Job:

      # 0 * * * * /usr/bin/sudo /usr/sbin/service go-zenon restart

    • Add a # at the Beginning:

      This comments out the line, disabling the scheduled restart.

  2. Save and Exit:

    1. Press Esc to exit insert mode.

    2. Type :wq and press Enter to save and quit.

  3. Shut down old Pillar on old Hosting Provider: Once the above steps have been completed, you can shut down your server which hosted your old Pillar. It is recommended that you delete the server only after you've successfully collected your Pillar rewards in the syrius wallet (using the new Pillar's Producer Address). You can wait until the next reward distribution for this (the next day, depending at which hour of the day you've migrated).


11) Useful Commands

Watch the Pillar's logs in real-time:

watch systemctl status go-zenon

Verify the Sync / Height Status:

Replace the PRIVATE-IP with your Pillar's Private IP address:

curl -X GET http://PRIVATE-IP:35997 -H "content-type: application/json" -d '{"jsonrpc": "2.0", "id": 21, "method": "stats.syncInfo", "params": []}'

You will receive a response:

{"jsonrpc":"2.0","id":21,"result":{"state":1,"currentHeight":1998515,"targetHeight":5113554}}

When the state goes from 1 to 2, then your Pillar is fully synced.

Update Guide

Keeping your Zenon Network Pillar up-to-date is essential for maintaining optimal performance, security, and access to the latest features.

Table of Contents

  1. Prerequisites

  2. Stop the znnd Service

  3. Download the Latest znn-controller

  4. Replace the Existing znn-controller File

  5. Deploy the Updated Controller

  6. Verify the Update


1) Prerequisites

Before proceeding with the update, ensure you have the following:

  • Access Credentials: SSH access to your server with sudo privileges.

  • Basic Knowledge: Familiarity with command-line interfaces and server management.

  • Backup: It's recommended to back up your current configuration and controller files before performing the update.


2) Stop the znnd Service

  1. Access Your Server via SSH:

    Open your terminal and connect to your server using SSH:

    ssh username@your_server_ip

    Replace username with your server's username (commonly root) and your_server_ip with your server's IP address.

  2. Stop the znnd Service:

    Run the znn-controller executable and select the option to Stop Service the znnd service.

    ./znn-controller

    • Interactive Prompt:

      1) Deploy
      2) Status
      3) Start service
      4) Stop service
      5) Resync
      6) Help
      7) Quit
      Select an option from the ones listed above

    • Action:

      • Enter 4 and press Enter to stop the running the znnd service.

    Note: Ensure the service has completely stopped before proceeding to the next step. You can enter 2 and press Enter to verify the Status of the znnd service.


3) Download the Latest znn-controller

  1. Identify the Latest Release URL:

    Visit the Zenon Network GitHub Repository to find the latest version of the znn-controller. Copy the download URL for the x86/64 Linux release.

  2. Download the Latest Controller:

    Replace YOUR_LATEST_URL with the actual URL of the latest znn-controller release.

    wget -O znn_controller-linux-x86_64.zip YOUR_LATEST_URL

    Example:

    wget -O znn_controller-linux-x86_64.zip https://github.com/zenon-network/znn_controller_dart/releases/download/v0.0.5-beta/znn_controller-linux-x86_64.zip

4) Replace the Existing znn-controller File

  • Extract the Downloaded ZIP File:

    unzip -o znn_controller-linux-x86_64.zip

    • -o Flag: Overwrites existing files without prompting.

  • Remove the ZIP File:

    rm znn_controller-linux-x86_64.zip

5) Deploy the Updated Controller

  • Run the Updated znn-controller:

    ./znn-controller

  • Deployment Options:

    Upon execution, you will be presented with deployment options:

    1) Deploy
    2) Status
    3) Start service
    4) Stop service
    5) Resync
    6) Help
    7) Quit
    Select an option from the ones listed above

  • Select Deploy Option:

    • Action: Enter 1 and press Enter to deploy the updated controller.

  • Continue Using Existing Configuration:

    • Prompt:

      Continue using the existing configuration? (Y/N):

    • Action: Enter Y and press Enter to confirm.


6) Verify the Update

  • Check the Status of the Controller:

    Run the znn-controller and select the status option to verify that the update was successful.

    ./znn-controller

    • Interactive Prompt:

      1) Deploy
      2) Status
      3) Start service
      4) Stop service
      5) Resync
      6) Help
      7) Quit
      Select an option from the ones listed above

    • Action: Enter 2 and press Enter to view the current status.

Tutorials

Setup Guide (On Pillar)

By setting up a Zenon Pillar, you play a pivotal role in enhancing the decentralization, security, and overall robustness of the Zenon ecosystem.

This setup guide is for operators looking to setup the Orchestrator binary on the same server as their Pillar. If you're looking to setup on a remote server (not on the Pillar), then please follow the following: Setup Guide (Remote).

Table of Contents

  1. Prerequisites

  2. Opening Required Firewall Ports

  3. Obtaining an Ethereum Node from Alchemy

  4. Server Setup and Configuration

    • Accessing the Server

    • Updating the System

    • Installing Required Packages

  5. Installing the Orchestrator

  6. Setting Up Orchestrator as a Service

  7. Fusing QSR Tokens

  8. Useful Commands


1) Prerequisites

Before proceeding, ensure you have the following:

  • Basic Knowledge: Familiarity with command-line interfaces and server management.

  • Access Credentials: SSH access to your chosen server with sudo privileges.

  • BNB and Ethereum Nodes: Access to a BNB and Ethereum node provider like Alchemy to obtain WebSocket (WSS) endpoints.

  • Producer Passphrase: The passphrase for your Producer Key File, retrievable via the znn-controller.

  • QSR Tokens: At least 120 QSR tokens fused to the Pillar Producer Address.


2) Opening Required Firewall Ports

To facilitate communication and health checks, ensure the following ports are open on your server’s firewall:

1. Port 55055 (TCP): Open for gossip communication between nodes.

2. Port 55000 (TCP): Open for API health checks.

Steps to Open Ports:

Assuming you’re using ufw (Uncomplicated Firewall) on Ubuntu:

sudo ufw allow 55055/tcp
sudo ufw allow 55000/tcp
sudo ufw reload

Note: If you’re using a different firewall management tool, adjust the commands accordingly.


3) Obtaining a Binance Smart Chain and Ethereum Node from Alchemy

To interact with the Binance Smart Chain and Ethereum network, you need access to a Binance Smart Chain and Ethereum node. Alchemy provides reliable node services.

Steps to Obtain the WSS Endpoint

  1. Sign Up/Login to Alchemy:

    1. Visit Alchemy and create an account or log in.

  2. Create a New App:

    1. Navigate to the dashboard and create a new app.

    2. Select the desired network (e.g., Mainnet, Ropsten).

  3. Retrieve the WSS Endpoint:

    1. Once the app is created, go to the app’s dashboard.

    2. Locate the WebSocket endpoint URL.

  4. Example Endpoint:

wss://eth-mainnet.alchemyapi.io/v2/your-api-key

4) Server Setup and Configuration

Accessing the Server

  1. Obtain SSH Credentials: After setting up your server with your chosen provider, retrieve the SSH IP address, username, and password/key.

  2. Connect via SSH:

    ssh username@your_server_ip

    Replace username with your server's username (commonly root) and your_server_ip with your server's IP address.

  3. Switch to Root User:

    sudo -i

    This command grants you root privileges for the installation process.

Updating the System

Ensure your server's package lists and installed packages are up to date by running the command individually:

apt update
apt upgrade -y
  • apt update: Updates the package index.

  • apt upgrade -y: Upgrades all installed packages to their latest versions.

Installing Required Packages

Install unzip and other necessary utilities:

apt install -y unzip wget
  • unzip: Required for extracting the Zenon controller ZIP file.

  • wget: Facilitates downloading files from the internet.


5) Installing the Orchestrator

This section covers downloading the Orchestrator binary, setting up the configuration file, and preparing the orchestrator for deployment.

  1. Download the Orchestrator Binary

First, download the latest Orchestrator binary. Ensure you're using the most recent release by checking the OrchestratorGitHub Releases.

Download Command:

wget https://github.com/HyperCore-Team/orchestrator/releases/download/v0.0.9a-alphanet/orchestrator-linux-amd64.zip

Note: Replace the URL with the latest release if a newer version is available.

2. Extract the Orchestrator Binary

Unzip the downloaded file:

unzip orchestrator-linux-amd64.zip

3. Setup the Config.json File

Move the Binary and Create the Configuration Directory

  1. Copy the Binary to /usr/local/bin/:

    cp orchestrator-linux-amd64 /usr/local/bin/
  2. Run the Orchestrator Binary to Initialize:

    /usr/local/bin/orchestrator-linux-amd64
    • Expected Outcome: The process will fail initially but will create a working directory at /root/.orchestrator/.

4. Configure the Config.json File

Edit the config.json file to suit your environment:

nano /root/.orchestrator/config.json

Configuration Steps:

  1. Update WebSocket URLs:

    • BNB: Replace with your Alchemy BNB WSS endpoint.

    • Ethereum: Replace with your Alchemy Ethereum WSS endpoint.

  2. Provide Producer Key File Passphrase:

    • Retrieve by running the znn-controller and selecting the 2) Status option.

  3. Maintain Unique EvmAddress:

    • Do not change or remove the EvmAddress once created.

  4. Add Bootstrap Address:

    "Bootstrap": "/dns/bootstrap.zenon.community/tcp/55055/p2p/12D3KooWBVQYaz3yuJor8oW7bUqoAGDZDpFBGbGerL3SprHn57pQ"
  5. Sample config.json Structure:

    {
        "DataPath": "/root/.orchestrator",
        "EventsPath": "",
        "QueuesPath": "",
        "GlobalState": 0,
        "EvmAddress": "",
        "Networks": {
            "BNB Chain": {  <= UPDATE THIS
                "Urls": [
                    "ws://127.0.0.1:8545" <= UPDATE THIS
                ],
                "FilterQuerySize": 1500
            },
            "Ethereum": {
                "Urls": [
                    "wss://eth-mainnet.alchemyapi.io/v2/your-api-key"  <= UPDATE THIS
                ],
                "FilterQuerySize": 2000
            },
            "Zenon": {
                "Urls": [
                    "ws://127.0.0.1:35998"
                ],
                "FilterQuerySize": 0
            }
        },
        "TssConfig": {
            "Port": 55055,
            "PublicKey": "",
            "DecompressedPublicKey": "",
            "LocalPubKeys": null,
            "Bootstrap": "/dns/bootstrap.zenon.community/tcp/55055/p2p/12D3KooWBVQYaz3yuJor8oW7bUqoAGDZDpFBGbGerL3SprHn57pQ",
            "PubKeyWhitelist": {},
            "BaseDir": "/root/.orchestrator/tss",
            "BaseConfig": {
                "PartyTimeout": 60000000000,
                "KeyGenTimeout": 900000000000,
                "KeySignTimeout": 60000000000,
                "KeyRegroupTimeout": 60,
                "PreParamTimeout": 600000000000,
                "EnableMonitor": false
            }
        },
        "ProducerKeyFileName": "producer",
        "ProducerKeyFilePassphrase": "YOUR_PASSPHRASE",  <= UPDATE THIS
        "ProducerIndex": 0
    }

5. Copy the Producer File

Assuming you are running the Orchestrator on the pillar, copy the producer file to the Orchestrator's data path:

cp /root/.znn/wallet/producer /root/.orchestrator/producer

Note: Ensure the path to the producer file is correct. Adjust the command if your producer file is located elsewhere.


6) Setting Up Orchestrator as a Service

To ensure that the Orchestrator runs continuously and starts on boot, set it up as a systemd service.

1. Create a systemd Service File

Open a new service file for the Orchestrator:

nano /etc/systemd/system/orchestrator.service

2. Add Service Configuration

Copy and paste the following content into the service file:

iniCopy code[Unit]
Description=Orchestrator Service
After=network.target
StartLimitIntervalSec=300s
StartLimitBurst=10

[Service]
User=root
Group=root
ExecStart=/usr/local/bin/orchestrator-linux-amd64
ExecStop=/usr/bin/pkill -9 orchestrator-linux-amd64
Restart=on-failure
RestartSec=60
TimeoutStopSec=10s
TimeoutStartSec=10s
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=orchestrator

[Install]
WantedBy=multi-user.target

3. Activate and Start the Orchestrator Service

Reload systemd to recognize the new service:

systemctl daemon-reload

Enable the service to start on boot:

systemctl enable orchestrator

Start the Orchestrator service:

systemctl start orchestrator

4. Verify the Orchestrator Service Status

Check if the Orchestrator service is running correctly:

systemctl status orchestrator

Expected Output:

● orchestrator.service - Orchestrator Service
   Loaded: loaded (/etc/systemd/system/orchestrator.service; enabled; vendor preset: enabled)
   Active: active (running) since Thu 2024-04-27 10:00:00 UTC; 5s ago
 Main PID: 12345 (orchestrator-)
    Tasks: 10 (limit: 4704)
   CGroup: /system.slice/orchestrator.service
           └─12345 /usr/local/bin/orchestrator-linux-amd64

Note: The Active: active (running) status indicates that the service is running correctly.


7) Fusing QSR Tokens

To fully deploy your Orchestrator with the Zenon Network, ensure that you have fused at least 120 QSR tokens to the Pillar Producer Address.

Steps to Fuse QSR Tokens

  1. Access Your Pillar Producer Address:

    • Use your Syrius wallet or another compatible wallet to access your producer address.

  2. Fuse QSR Tokens:

    • Follow the wallet's instructions to fuse QSR tokens.

    • Ensure you have at least 120 QSR fused to meet the network's requirements.


8) Useful Commands