# Masternode launch

The only difference between a regular node and a masternode (validator) is that it takes part in the production and verification/signing of blocks. Technically, both of these nodes work almost identically. For example, each node always has its own identifier (node_id) and a pair of ed25519 format private/public keys used to sign blocks in case the node becomes a masternode.

# Requirements

1) git;
2) golang 1.14+;
3) shell tools curl and jq;
4) building tools;
5) key-value storage library LevelDB.

To install building tools (which include make) and LevelDB use following commands:

# RHEL 8 / CentOS 8:

sudo dnf groupinstall "Development Tools"
sudo dnf install leveldb leveldb-devel snappy

# Ubuntu:

sudo apt-get install build-essential
sudo apt-get install libsnappy-dev libleveldb-dev

# macOS:

brew install coreutils
brew install leveldb snappy

# Installation

To work with the node you need decd and deccli programs. Firstly, install the Go compiler and the Make utility and then compile decd and deccli. In order to compile the node:

  1. Clone the node source code:

    git clone https://bitbucket.org/decimalteam/go-node.git
    
    1
  2. Carry out decd and deccli compilation and installation:

    make all
    
    1
  3. Make sure that decd and deccli are available:

    decd version
    deccli version
    
    1
    2

# Configuring

  1. It is necessary to initialize the node by creating the folder $HOME/.decimal using the command:

    decd init YOUR_NODE_NAME --network mainnet|testnet|devnet
    
    1

    YOUR_NODE_NAME - the node name, for example `my-great-node;
    mainnet|testnet|devnet - choose one of them for appropriate network.

  2. Execute the command:

    cat $HOME/.decimal/daemon/config/priv_validator_key.json | jq --raw-output '.pub_key.value'
    
    1

    This command will display an ed25519 public key encoded in base64. This is the node's public key, you will need it later to register the validator (in the Public key field), you must save it.

# Starting

  1. Start the node and wait for the synchronization to end:

    decd start
    
    1
  2. While the node is synchronizing, you need to prepare an account with coins for the stake and the validator registration. To obtain tDEL test coins a faucet is available on Console.

  3. Once the node has been synchronized and is in the up-to-date state, it is necessary to register the prepared node as a validator and assign the initial stake, you need to form and send the Declare candidate transaction via the Console from the account planned to manage the validator on the blockchain. On this page https://console.decimalchain.com/masternode you are to fill in the information about the node and send the transaction. On the same page it is possible to activate and deactivate the validator.

    To find out the Public key, on a system with the node, you are to run the following command (Public key will be displayed in the Terminal):

    cat $HOME/.decimal/daemon/config/priv_validator_key.json | jq --raw-output '.pub_key.value'
    
    1