How to become a validator

How to become a shard validator:

For a node to become a shard validator, its signing public key must be present in the nodesSetup.json file. The position in this file will define the node’s allocation in a shard.

How to become a metachain validator:

For a node to become a metachain validator, its signing public key must be present in the nodesSetup.json file in the same manner as a shard validator.

How to become an observer:

For a node to become an observer its public key must not be present in the nodesSetup.json file. Otherwise it will become a validator. Observers can be allocated to any shard, including the metachain by altering the option “DestinationShardAsObserver” from the config.toml file. The permitted values are the shard ID numbers (0, 1 … maxShards-1) or the keyword “metachain”.

This mechanism is the first the protocol will support. In the following iterations switching between a shard validator, a node validator or an observer will be done through the use of dedicated smart contracts present in the protocol.

nodesSetup.json file

An example of the nodesSetup.json file is presented in the following section, depicting the way a node can determine on which shard it should operate. The values from this file are kept low intentionally as to present the way nodes are allocated using a small number of lines of code:

{
"startTime": 1560791040,
"roundDuration": 4000,
"consensusGroupSize": 2,
"minNodesPerShard": 3,
"metaChainConsensusGroupSize": 3,
"metaChainMinNodes": 4,
"initialNodes": [
{
"pubkey": "5e91c426c5c8..."
},
{
"pubkey": "73972bf46dca..."
},
{
"pubkey": "7391ccce066a..."
},
{
"pubkey": "3efb714c90dd..."
},
{
"pubkey": "5498d09d5cc1..."
},
{
"pubkey": "671a8df542bf..."
},
{
"pubkey": "7feee0aa8ee1..."
},
{
"pubkey": "47cac956e48e..."
},
{
"pubkey": "13fef1141f6f..."
},
{
"pubkey": "1e04f7541788..."
},
"pubkey": "5466c7ed09d1..."
},
{
"pubkey": "713a64380561..."
},
{
"pubkey": "1f4d1c336ca9..."
}
]
}

This file can be read as following: the first 4 public keys are allocated to the metachain, the next three groups of three public keys are allocated to shards 0, 1 and 2. So the configuration will create a network of 3 shards and a metachain. The other values found in this file represent the consensus parameters: round duration, consensus group size in each shard, consensus group size in the metachain and the unix timestamp considered as the genesis start time.

genesis.json file

This file is used to define initial minting addresses. It is basically a list of tuples consisting of a public key and an initial balance.