Preconditions
- Have a account that has some NMT token (You need some NMT to apply validator on-chain)
- One Linux server with 2 core 4 GB memory and 100GB hard disk
- A browser with Polkadot{.js} extension, such as Chrome,Firefox
For the different environment, we prepare the docker image for our validators. The NFTMart node update and distribute by docker image.
So we need to install docker and docker-compose first.
Ubuntu / Debian:
sudo apt update
sudo apt install docker.io docker-compose
Cent OS:
sudo yum update
sudo yum install docker docker-compose
With this CMD
systemctl status docker
If docker status is active (running),its means that docker server is runing。Some docker edition will not run docker server automaticly, so we need to do it in manual:
sudo systemctl start docker
sudo systemctl enable docker
Add current use into docker group , when your user is not root user:
sudo usermod -aG docker $USER
newgrp docker
Then run CMD:
docker version
Should show Client and Server infomations:
If you only got client infomation , maybe you need to check the cmd above.
If we have successful runing docker, we can deploy our nodes
We provide nftmart-validator repo with main branch ,use docker-compose.yml
to start nftmart/node:mainnet image.
You need to clone the repo into your sever,and change the branch with nftmrat-validator
git clone -b main https://github.com/NFTT-studio/nftmart-validator
cd nftmart-validator
Every validator will sync his infomation to Polkadot Telemetry server
We can get more infomations of current network, such as blockheight, average block time, version and other's node name.
We need use example.env
file as a template to create .env
file
cp example.env .env
Change .env
content,set our node name.
If you want name your node as victor-hugo-1482
,Please change NAME=
value in .env
file.
NAME=victor-hugo-1482
Then we can run the node and sync the blocks.
Use cmd to start your node:(If you want your node runing in background, please see the content below )
docker-compose up nftmart
The sync progress depend on the network blockheight and your bandwith, please be patient and waiting.
If you want your node runing in background, you can stop the node with Ctrl-C
first, and use the cmd below:
docker-compose up -d nftmart
Then ,your node will running in background, and you can use cmd to check the node's log:
docker-compose logs -f
We can see the progress in Polkadot Telemetry page:
When the sync process done ,you can see your node block height as same as other nodes. then you can config node validator .
Validator need broadcast his Session Key when he want to join the network. Session key not control asset, and validator can change his session when he need.
Open another terminal to run generate the key:
docker-compose exec nftmart rotate-key
Save that session Key and we will use it in next step.
Open https://polkadot.js.org/apps/?rpc=wss://mainnet.nftmart.io/rpc/ws#/accounts to create two account,and send some NMT Token to them.
Stash account use to keep token, Controller account to manage stash account.
You can also use same account as Stash and Controller account.
Open https://polkadot.js.org/apps/?rpc=wss://mainnet.nftmart.io/rpc/ws#/staking/actions
Click "⊕ Validator" Button
Select your Stash and Controller account that you created before.
And fill your Session Key.
Confirm transaction.
After a while, you can see your account in wating list.
Before the era close,validator will be re election,If your validator has a symbol in left icon,thats mean your node will be the validator in thenext era.
As your can see ,our example node victor-hugo-1482
already produce two blocks.
The node update will delivery by docker image,you need to get the latest version of validator in nftmart-validator repo's main branch:
git pull
Then pull the docker image:
docker-compose pull
restart the node:
docker-compose down nftmart
docker-compose up -d nftmart
Then the update will done.
If you want migration your node to an other server, you shouild repeat the steps above, then update your new session key in account setting page.
After that, you can stop your old node with this cmd:
docker-compose down nftmart
Please read these doc:
- https://wiki.polkadot.network/docs/learn-keys/#controller-and-stash-keys
- https://wiki.polkadot.network/docs/learn-keys/#session-keys
It maybe the network connect fail and node can not sync blocks. Maybe the server hardware is not support the node server or the disk drive is full.
Recommend to use Digital Ocean, Vultr, Scaleway, AWS, Google Cloud, etc.
Restart your node ,and generate a new session key, and follow the steps above to create a new validator . If your node offline too offten, it maybe slash by the network, and lose the token.