Skip to content

Supernode Install & Usage Instruction

Ilya Kitaev edited this page Sep 27, 2020 · 8 revisions

Table of Contents

Requirements

OS: Ubuntu 18.04 LTS Bionic

Build Requirments Run Requirements
RAM, GB 8 2
CPU, Cores 2 2
Storage, GB 100 100

Note: In order to GraftNode (also called the cryptonode) work properly 28680 (P2P) port should be opened for incoming and outgoing traffic. If you are using other ports, please, make sure that you are open P2P port of the cryptonode.

Default RTA Configuration

Ports

28880 - p2p node port.

28881 - rpc node port.

28690 - rpc supernode port.

8081 - block explorer port.

Installation

Environment Preparation

  1. Update package index lists:
sudo apt-get update
  1. Install git (if not installed already):
sudo apt-get install -y git

Build Graft Supernode

  1. Clone Graft Supernode from GitHub repository: https://github.com/graft-project/graft-ng.git
git clone --recursive https://github.com/graft-project/graft-ng.git
  1. Go to graft-ng directory:
cd graft-ng
  1. Switch to develop branch:
git checkout develop
  1. Update submodules:
git submodule update --init --recursive
  1. Install cryptonode dependencies from the list https://github.com/graft-project/GraftNetwork#dependencies
  • Option A - use following command line:
sudo apt-get -y install build-essential cmake \
              pkg-config libboost-all-dev \
              libssl-dev libunwind8-dev \
              liblzma-dev libldns-dev \
              libexpat1-dev doxygen graphviz \
              libzmq3-dev libpgm-dev libnorm-dev libsodium-dev
  1. Install supernode dependencies from the list https://github.com/graft-project/graft-ng/tree/develop#dependencies
sudo apt-get -y install build-essential cmake \
                  pkg-config libboost-all-dev \
                  libssl-dev autoconf automake \
                  check libpcre3-dev rapidjson-dev \
                  libreadline-dev
  1. Create build directory:
mkdir -p <build directory>
cd <build directory>

Where <build directory> is any directory, for example, $HOME/supernode.

  1. Run CMake:
cmake <project root>

Where <project root> is location of your project files; if you downloaded the source into your home directory, it is $HOME/graft-ng.

  1. Start the build:
  • Option A (Use single CPU):
make
  • Option B (Defined CPU affinity):
make -j2

for "-j" param select appropriate number of CPU cores available on your system.

  1. Wait until compilation finished.
  2. Find Graft Supernode executable (supernode) in the <build directory>.
  3. Find Graft Node (graftnoded), Graft Wallet CLI (graft-wallet-cli) executables in the <build directory>/BUILD/bin.

Build Graft Node

Note: Normally you don't need to build Graft Node separately, it currently builds as a part of supernode project.

  1. Clone Graft Network from GitHub repository: https://github.com/graft-project/GraftNetwork.git
git clone https://github.com/graft-project/GraftNetwork.git
  1. Go to GraftNetwork directory:
cd GraftNetwork
  1. Switch to develop branch:
git checkout develop
  1. Install dependencies from the list https://github.com/graft-project/GraftNetwork#dependencies
  • Option A - use following command line:
sudo apt-get -y install build-essential cmake \
              pkg-config libboost-all-dev \
              libssl-dev libunwind8-dev \
              liblzma-dev libldns-dev \
              libexpat1-dev doxygen graphviz
./install_dependencies.sh
  1. Start the build:
  • Option A (Use single CPU):
make release-syslog
  • Option B (Defined CPU affinity):
make -j2 release-syslog

for "-j" param select appropriate number of CPU cores available on your system.

In order to build standalone binaries (i.e. to upload it to the server where no dev packages installed), invoke:

make -j2 release-syslog-static
  1. Wait until compilation finished (Approximate 21 minutes using AWS T2 Medium).
  2. Find Graft Node executable (graftnoded) and Graft CLI Wallet in the <your GraftNetwork path>/GraftNetwork/build/release/bin.

Configuration of RTA Environment

Graft Node Configuration

  1. Run Graft Network daemon from using following commands:
  • With console output:
./graftnoded --testnet --log-file <path_to_log_file>
  • In background mode:
./graftnoded --testnet --log-file <path_to_log_file> --detach

Additional options:

    --data-dir - specify testnet data directory.
    --p2p-bind-port <port> - specify custom testnet p2p binding port. For example, 28680.
    --rpc-bind-port <port> - specify custom testnet rpc binding port. For example, 28681.
    --rpc-bind-ip <ip> - specify ip to bind rpc server. For example, 0.0.0.0 for external binding.
    --confirm-external-bind - confirm rpc-bind-ip value is not a loopback (local) IP.
    --help - display help message with all supported commands.
  1. Wait for blockchain synchronization.

Graft Supernode Configuration

  1. [NOTE: Only for new setup] in case you running from scratch, please create new wallet with graft-wallet-cli and deposit stake amount ( > 50000 GRFT) to this wallet. In case you don't have a test coins - please request stake amount for your supernode in the https://t.me/rtatestnet group - we will load up your stake wallet with testnet coins.

IMPORTANT NOTE: [known bug workaround] graftnoded should be started at the moment when new wallet being generating. Otherwise you will need to “fix” the wallet by invoking command within wallet console:

set refresh-from-block-height 0
rescan_bc
  1. [NOTE: Only for existing setup] In case you already have previous installation and valid stake wallet, please note/copy it's address (it written in file ~/.graft/supernode/data/stake-wallet.address.txt), you will need to add it to config.ini in next steps.

  2. Having built supernode binary (“supernode”), please copy <graft_ng-source-dir>/data/config.ini to the same file in the directory with “supernode” binary. In case you already have a config.ini - please merge it with new one or just overwrite it.

  3. Edit config.ini: find a line wallet-public-address= and set your stake wallet address here.

  4. Run “supernode” binary having “config.ini” in the same directory as binary. It make sense to redirect the log to a file - in case any bug we might request a log from you. This can be done with the following starter script:

  • With console output:
cd <build directory>
./supernode --log-file <path_to_log_file>
  • In background:
./supernode --log-file <path_to_log_file> >/dev/null 2>&1 &
  1. In order to run qualified supernode you need to send stake transaction:

a) Receive supernode public identifier key, supernode public wallet address and signature from the supernode:

curl --request GET http://<SUPERNODE_HOST>:<SUPERNODE_PORT>/dapi/v2.0/cryptonode/getwalletaddress

The result should look like the following output:

{
"testnet":true,
"wallet_public_address":"FAyaNgWCqSaBBDyXrksJwVZQxGwQ35ga...",
"id_key":"4bdb642dfe398ceb9e78adf95f77bab2e4ad3452d5c08a1...",
"signature":"e71ed946521d1272a760647b0990091f837fa2d56265..."
}

b) Send stake transaction using graft-wallet-cli utility:

stake_transfer <SUPERNODE_WALLET_PULIC_ADDRESS> <STAKE_AMOUNT> <LOCK_BLOCKS_COUNT> <SUPERNODE_PUBLIC_ID_KEY> <SUPERNODE_SIGNATURE>

where:

  • SUPERNODE_WALLET_PULIC_ADDRESS is a wallet_public_address from /dapi/v2.0/cryptonode/getwalletaddress response;
  • STAKE_AMOUNT is a stake amount; any amount may be sent, but transaction will be accepted as a stake transaction only if STAKE_AMOUNT is not less than 50000 GRFT;
  • LOCK_BLOCKS_COUNT is a number of blocks for transaction to be locked;
  • SUPERNODE_PUBLIC_ID_KEY is a id_key from /dapi/v2.0/cryptonode/getwalletaddress response;
  • SUPERNODE_SIGNATURE is a signature from /dapi/v2.0/cryptonode/getwalletaddress response.
  1. Once you received coins and coins are unlocked - the supernode is ready to be used

Graft Clients (Point-of-Sale and Wallet) Configuration

  1. Upload Graft Clients:
  • iOS Clients: Check if you have access to iPhone clients for RTA Testnet. For this check your email if you got notification from TestFlight with Redeem Code or open TestFlight application and check if GRAFT Mobile Point of Sale version 1.13.x and GRAFT CryptoPay Wallet version 1.13.x is available for you.
  • macOS Clients: Download macOS packages for desktop clients (Graft Point-of-Sale and Graft Wallet): https://github.com/graft-project/GraftMobile/releases/latest.
  1. Configure Graft Account
  • Open Graft Point-of-Sale or Graft Wallet application.
  • Select RTA Testnet and press Confirm.
  • If you want to change service settings, for example, connect to your supernode, press the Settings button. How to configure custom service settings see 3.
  • If you want to create a new account, enter the password, confirm it and press Create New Wallet. Then copy mnemonic phrase and press I saved it!.
  • Also, you can restore your existing wallet (from Public RTA Testnet). For this, press Restore/Import Wallet. Then enter or paste mnemonic phrase, enter and confirm the password, and press Restore.
  1. Configure custom service settings
  • Open Settings Screen.
  • If you haven’t HTTPS access, disable HTTPS.
  • Select one two options and enter your service address:
    • Service address, for access via IP and Port.
    • Service URL, for access via HTTPS or HTTP URL.
  • Press Done to save changes.

Appendix 1. Running Graft Node

  1. Under folder <path to GraftNetwork>/GraftNetwork/build/release/bin, the following components may be found:
  • graftnoded - Graft Network daemon;
  • graft-wallet-cli - Graft Network CLI Wallet.
  1. Running Graft Network daemon
graftnoded --testnet --detach
    --detach  - Running service in the background. Running without "--detach" will provide on
                screen visual daemon log and alscrelow to invoke daemon commands.
    --testnet - Running on the test network.
  1. Additional Graft Network daemon functions:
graftnoded --help
  1. Status and log files are saved at $HOME/.graft/testnet directory. To specify any arbitrary directory, add --testnet-data-dir to the command line. Example: --testnet-data-dir .

Appendix 2. Graft CLI Wallet Commands

Creating a wallet and connecting to the local testnet node

To create new wallet for the public testnet, invoke:

./graft-wallet-cli --generate-new-wallet <wallet_name> \
                   --testnet --daemon-address localhost:28681

File location : <your GraftNetwork path>/GraftNetwork/build/release/bin.

This will try to connect to the local daemon, running in testnet mode, ask password for a new wallet, electrum seed language, generate new wallet and finally open wallet with CLI interface. Invoke help to see available commands. E.g. CPU mining (Solo mining) can be started with start_mining command.

Here are the shell scripts automating wallet creation and other tasks in non-interactive mode: https://github.com/graft-project/GraftNetwork/tree/master/tests/libwallet_api_tests/scripts

Opening an existing wallet

To open a previously created testnet wallet, invoke:

./graft-wallet-cli --wallet-file <wallet_name> --password "" \
                   --testnet --trusted-daemon \ 
                   --daemon-address localhost:28681

Restoring an existing wallet

To restore your wallet via Graft CLI, you need to get the mnemonic phrase of your Graft wallet and run Graft CLI with the following options:

--restore-deterministic-wallet - allow creating wallet from mnemonic phrase

--electrum-seed "<mnemonic phrase>" - mnemonic phrase of your Graft wallet

For example:

Linux/MacOS:

./<path to GraftNetwork install directory>/graft-wallet-cli \
                    --testnet --restore-deterministic-wallet \
                    --electrum-seed "<mnemonic phrase>"

Windows:

<path to GraftNetwork install directory>\graft-wallet-cli.exe \
                      --testnet --restore-deterministic-wallet \
                      --electrum-seed "<mnemonic phrase>"

Then Graft CLI will ask to enter a file name for your wallet and password to secure your wallet.

To get more information about options of Graft CLI you can run it with --help option:

./<path to GraftNetwork install directory>/graft-wallet-cli --help

To get information about actions which are available for your wallet in the Graft CLI, enter help command when opening your Graft wallet in the Graft CLI.

Appendix 3. Reporting Bugs, Suggestions, and Information Requests

Jira for reporting bugs, suggesting improvements, and asking devs for information: https://graftnetwork.atlassian.net/projects/SUP/

To collect additional information about the issue:

  1. Run graftnode and supernode with detailed logging:
  • Run graftnode with option --log-level 3
  • Run supernode with option --log-level 2