Skip to content

Validators

Note

This information can only be used by STRATO node administrators that have been voted in to be "Validator Administrators" for the network.

Make Nodes the Validators

Info

For detailed information about validators and their management, see PBFT Consensus - Validator Nodes.

In previous topic, we covered the deployment of a 4 node network with the root node (Node 1) being the only validator.

Follow these steps to make the rest of nodes in the network validator nodes:

  1. Make Node 2 the validator. Send a voteToAddAdmin function call to the Validator Governance Contract (requires the sender to be a Validator Admin):

    curl -X POST \
    -H "Authorization: Bearer <token>" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{
        "txs": [
        {
            "payload": {  
            "contractName": "MercataGovernance",
            "contractAddress": "0000000000000000000000000000000000000100",
            "method": "voteToAddValidator",
            "args": {
                _org : "<node2Org>",
                _orgUnit : "<node2OrgUnit>",
                _commonName : "<node2CommonName>"
            }
            },
            "type": "FUNCTION"
        }
        ],
        "txParams": {
        "gasLimit": 32100000000,
        "gasPrice": 1
        }
    }' \
    "https://<strato_address>/strato/v2.3/transaction?resolve=true"
    

  2. Since there is only 1 Validator Admin, the node will be approved as a validator immediately.

    To view the list of validators, query this endpoint:

    GET https://<strato_address>/metadata
    
  3. Vote-in the other two nodes using the same method as above. Note that since the number of Validator Admins has not changed, the number of votes needed for a majority has not changed.

Make Users Validator Admins

Since Validators are added via function calls, the votes must be protected so that not just any user can vote in a new validator node. For this reason the Validator Governance Contract keeps a list of authorized "Validator Admin" users. This is the list of user addresses that are allowed to vote for Validators. Admins are controlled by a ⅔ vote of all existing admins, just like voting in validators. Since there must be at least one Admin to start the network, it is declared in the genesis block at the network's boot time.

To add a validator Admin, follow these steps:

  1. Retrieve Identity information of the user you want to vote in.

  2. Call the voteToAddAdmin function on the Validator Governance Contract at address 0x100.

    curl -X POST \
    -H "Authorization: Bearer <token>" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{
        "txs": [
        {
            "payload": {  
            "contractName": "MercataGovernance",
            "contractAddress": "0000000000000000000000000000000000000100",
            "method": "voteToAddAdmin",
            "args": {
                _org : "<userOrg>",
                _orgUnit : "<userOrgUnit>",
                _commonName : "<userCommonName>"
            }
            },
            "type": "FUNCTION"
        }
        ],
        "txParams": {
        "gasLimit": 32100000000,
        "gasPrice": 1
        }
    }' \
    "https://<strato_address>/strato/v2.3/transaction?resolve=true"
    
  3. If you are the only Validator Administrator, then the vote will automatically meet the ⅔ consensus requirement, and the user will be added as an Admin. That user will now be able to vote for validator nodes and other validator admins.