Run A Staking Node


Starts with EVT 4.x versions, staking is supported and every stake holder can take part in. For more detail about staking design in everiToken, you can refer to: Staking.

Before creating the validator you need to setup staking TestNet node(evtd) and wallet node(evtwd) locally.

Here're the brief instruments for creating one Testnet staking node without postgres support(complex querying). And be sure to install docker environment properly. Also check this document to get and set up

Postgres is an optional module to support complex queries in everiToken blockchain and it's not necessary for a node. Refer this document to know more.

1. Setup docker network

./ network init

2. Setup evtd container

docker pull everitoken/evt-staking:latest

./ evtd init

./ evtd create -t staking --http-port=8888 --p2p-port=7888 --host= -- --http-validate-host=false --verbose-http-errors --plugin=evt::evt_link_plugin --delete-all-blocks

./ evtd start

Use ./ evtd logs to check logs of evtd container and it should be syncing blocks now. It's need to wait for syncing all the blocks before staking.

Use the latency to check if it catches the latest block (less than 500ms).

3. Setup evtwd container

./ evtwd init

./ evtwd create -t staking

./ evtwd start

And then create a new wallet

./ evtc wallet create

Be sure to remember the password returned and you cannot open the wallet without that password.

Now create you key pair:

./ evtc wallet create_key

And get the private key for that public key:

./ evtc wallet private_keys

4. Register validator

Before following steps, you need get some evt first:

./ evtc wallet import 5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3
./ evtc -u http://evtd:8888 fungible issue @1 "1000000.00000 S#1" -p @0

Not it's time to register a new validator! Use the following command to register a new validator called tv with the commission of 30%.

Be sure to check the node is catched up latest blocks, otherwise you cannot register validator.

./ evtc -u http://evtd:8888 validator create tv @1 @1 0.3 -p @1

@0 is a shorthand refers the first public key listed in ./ evtc wallet keys. Similar @1 refers the second one.

the first @1 in the command represent creator, the second is signer and third is payer.

BY default, the permission of withdraw and manage is both signer, and if you would like user-defined permission, your command is:

./ evtc -u http://evtd:8888 validator create tv @1 @1 0.3 [withdraw.json] [manage.json] -p @1

[withdraw.json] and [manage.json] represent two files's path.

You can also use ./ evtc validator create -h to see the detail of the that command

Use the following command to query your newly created validator.

./ evtc -u http://evtd:8888 get validator tv

Now you can invite other people to stake tokens into your validator. Or you can stake yourself.

./ evtc -u http://evtd:8888 assets stake @1 tv "100000.00000 S#1" active 0 -p @1

Above will stake 100 EVTs with active type into validator tv. And because the initial NAV(net asset value) of each validator is 1 EVT. So you will get 100 active shares of tv validator.

If you want to get an additional ROI for your staking you can choose to stake with fixed type. The following command is to stake 100 EVTs with 30 days locked.

./ evtc -u http://evtd:8888 assets stake @1 tv "100000.00000 S#1" fixed 30 -p @1

Then you use following command to query all the shares you've staked.

./ evtc -u http://evtd:8888 get shares @1

5. Get staking rewards

Once you've created a validator and has 100'000 shares you can start receiving staking rewards and it's very ease to do.

Stop evtd container first

./ evtd stop

And create another one with staking parameters

./ evtd create -t staking --http-port=8888 --p2p-port=7888 --host= -- --http-validate-host=false --verbose-http-errors --plugin=evt::evt_link_plugin --plugin=evt::staking_plugin --staking-validator=tv --staking-payer=[PUBKEY] --staking-signature-provider="[PUBKEY]=KEY:[PRIVKEY]"

Replace [PUBKEY] and [PRIVKEY] with your key pair created in step 3. And make sure --delete-all-blocks option is removed otherwise all the synced blocks will be deleted and need to resync again.

Then restart

./ evtd start

Congrats! Now you will receive staking rewards every 76.8 minutes.

After some stake and unstake in your validator, there woule be some profit in the validator's address, and you can withdraw it by:

./ evtc -u http://evtd:8888 validator withdraw tv @1 "1.00000 S#1" -p @1