How To Become A New Validator[advanced]

How to become a new validator [advanced]

In order to make your assets safer, we need you to set some necessary identification parameters to become a validator. We also set the corresponding threshold so that we can screen those who really want to contribute to the chain. Of course, we will give corresponding rewards to these people.

The following steps are regarded as your first operation, because you only need to perform the following operations once to become a validator. Unless you log off the validator or cancel the corresponding operation, you will not need to perform the second operation to avoid wasting your gas fee.

Step 1: create account

In this step, you need to transfer your identification information to the corresponding management contract, which will manage your account, keys, and metadata.

The purpose of this step is keep your locked MAP more secure by authorizing alternative keys to be used for signing attestations、voting、validating. By doing so, you can continue to participate in the protocol while keeping the key with access to your locked MAP in storage.

You need createAccount command to perform the above operations,more detail about createAccount command please to see this.

Step 2: authorize

Authorizes an address to sign consensus messages on behalf of the account. This authorized address is called the signer. As his name is, he is only responsible for signing, your reward will not be issued to the signer, but to the account created in the previous step。

Step 3: locked MAP

The threshold we set to be the validator is to lock 1000,000 MAP into the corresponding management smart contract.

This part of the locked MAP will be used for future punishment, which is also one of the conditions for being elected.

You need lockedMAP command to perform the above operations,more detail about lockedMAP command please to see this .

Step 4: validator register

This step is a key step for registering as a new validator.

You need register command to perform the above operations,more detail about register command please to see this.

At this step, you will successfully register as a validator. Next, you can try to vote for yourself. How to vote please to seethis.

Step 5: vote

Validators must have at least 0.001 proportion of the total votes to be considered for the election. So the validator can't have no votes.

We can use our validator account to vote for ourselves, or we can let other validators or voters vote for ourselves.

We've locked in 1,000,000 MAP in step 3, and it's a great decision to vote for ourselves now

Advanced example

Start A node that provides RPC services.

You can start a node that provides RPC services by yourself, or you can use the RPC nodes we provide.

  • Clone repositories

  • Build

The file generated by build is in the build/bin directory

Join the network

First, you need to prepare two keystore, one for staking is called account, and one for mining is called signer

keystore of account: account.json

keystore of signer: signer.json

How to build the atlas click here

If you want node to run in the background and not hang up, you can use nohup and & in combination, or screen or similar. Below we will demonstrate using screen

--miner.validator is used to specify the address of the signer

--port 30321 to make sure the port is opend on the firewall

After the node starts, it will automatically connect to other nodes, and then start to synchronize blocks.

Singer operations

Make ECDSA signature from signer

--target is used to specify the address of the account

--signerPriv is used to specify the private key of the signer

Generate signer proof

--validator is used to specify the address of the account

--signerPriv is used to specify the private key of the signer

Account operations

Create account

--keystore is used to specify the address of the account

Authorize by signature

Authorize using the signature (0x59dff185...32f0d700) generated from Make ECDSA signature from signer

--keystore is used to specify the keystore of the account (account.json)

--signer is used to specify the address key of the signer (signer.json)

Locked MAP

--keystore is used to specify the keystore of the account

Validator register by proof

Register the validator using the proof (0xf90149b8...0e56f0ab1) generated by Generate signer proof

--keystore is used to specify the keystore of the account

Verify

So far we have completed the registration steps of validator, now let's verify whether it has become a validator.

As can be seen from the above results, we have become a validator. But our vote count is 0, which prevents us from being elected as a validator that can participate in the block, which is not what we want. So we also need to vote for validators.

Vote

The number of votes cannot be greater than the number of votes locked.

For more information on voting and elections, click on the links below to view:

vote election

--keystore is used to specify the keystore of the account

Verify

Let's verify that our vote was successful.

Judging from the results, I've successfully voted for myself, but it's not enough. We need to call RPC in the next epoch to finally determine whether we are selected as validators who can participate in block generation,Just like the following:

For more information on istanbul_getValidators click here

ps: We recommend using ethkey to create the keystore, export the private key, and use the private key to restore the keystore

Last updated

Was this helpful?