v.1.0
- Setup environment:
curl https://getsubstrate.io -sSf | bash -s -- --fast
source ~/.cargo/env
- Install screen and htop using
apt install - Download chainx: https://github.com/chainx-org/ChainX/releases
- You can use for instance
wget https://github.com/chainx-org/ChainX/releases/download/v2.0.8-1/chainx-v2.0.8-1-ubuntu-20.04-x86_64-unknown-linux-gnuremember, you should always download latest release.
- You can use for instance
- Add access rights to the downloaded chainx:
chmod +x chainx... - Copy downloaded ChianX with renaming to
chainx. - Prepare configuration file using the following template and name it
config:
{
"log-dir": "./log", // Log directory
"enable-console-log": false, // At the same time output the log to the console
"no-mdns": true,
"validator": true, // Must be true for validator node
"ws-external": false, // Recommended to close for validators
"rpc-external": false, // Recommended to close for validators
"log": "info,runtime=info",
"port": 20222, // Specify the tcp port of the p2p protocol
"ws-port": 8087, // Specify the RPC service port of websocket
"rpc-port": 8086, // Specify http RPC service port
"pruning": "archive", // It is strongly recommended to add this configuration and start in archive mode
"execution": "NativeElseWasm",
"db-cache": 2048, // Set the cache of the node database, the unit is MB, which is 2GB here
"state-cache-size": 2147483648, // Set the node state tree cache, unit B, which is 2GB here (2GB = 2 * 1024 * 1024)
"name": "your_node_name", // The node name displayed in the node browser Telemetry
"base-path": "your_database_path", // The database path, where the chain data will be stored
"bootnodes": []
}
Please remove comments from this template before use.
- Type
crontab -eand add a cron task to execute after the reboot:@reboot sleep 3; /usr/bin/screen -d -m -S chainx /<your_chainx_path>/chainx --chain=mainnet --config /<your_chainx_path>/config.- You can reattach to the screen session using
screen -r chainx.
- You can reattach to the screen session using
- Reboot your machine and check if the chainx node is working using
htop.
- Go to dapps.chainx.org
- Open
Stacking Overviewand clickRegister a nodeon the right top. - Setup name, initial mortgage e.g. 10 PCX only (the rest of the PCX you can delegate later using
Vote).. - Go to the server and type:
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://localhost:8086to generate a session key - Go to the ChainX Dapp, click on
Developertab, selectExtrinsics, selectsessionon the left and choosesetKeys.- Copy result from the json to
keysfield. - Type
0x00in theprooffield. 6.Submit transaction and confirm in the polka wallet.
- Copy result from the json to
- Add identity -
Developer -> Extrinsics, selectidentityand selectsetIdentity- Set fields:
display,emailas required, the rest can be optional.
- Set fields:
- Check if the node is visible in chainx dapp on the Stacking Overview tab.
- Delegate the rest of your PCX using
Voteon your node.
In case when you want to migrate your node from one server to another, you need to be very careful. There are penalty for node offline time, name change and more.
- Setup the new node on the new server
- Use the same node name as your old node
- Wait until your new node will be fully synchronized. You can check this in the ChainX Telemetry
- Generate new session key using:
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "author_rotateKeys", "params":[]}' http://localhost:8086 - Load new session key in the ChainX Dapp
- Disable old node.
- Check if you are getting the PCX reward in the Dapp.
- DApp: https://dapps.chainx.org/
- Documentation (use Google Translator to translate from Chinese)): https://chainx-org.github.io/documentation/zh/docs/
- Telemetry: https://telemetry.polkadot.io/#list/ChainX
by Hazo