Hi,
I’m Bruce and I am a NKN-holic. I’m not a developer, but I like to tinkle with the latest and greatest technology. Yesterday, NKN announced that v0.9 Beluga is released. Even though there is NO mining reward for v0.9 (the chain data can be reset to zero at any time), I decided to try it out just for fun. If you are like me, please read on.
I have about 10 nodes running v0.8.1-alpha on DigitalOcean. So I decided to migrate one of them for trying out v0.9. This particular node was created using ChrisT’s tutorial.
After SSH into my DO node as root, I first stop the nknd:
systemctl stop nkn.service
Then I switch to user nkn:
su - nkn
cd /home/nkn/go/src/github.com/nknorg/nkn/
I switch to v0.9 branch, and check to make sure:
git checkout v0.9
git branch
You should see something like this on display:
root@nkn-do-001:/home/nkn/go/src/github.com/nknorg/nkn# git branch
master
* v0.9
Before updating the software, it is important to back up your wallet.dat and config.json. Both will change between v0.8.x testnet and v0.9 mainnet:
mv wallet.dat wallet.dat.08
mv config.json config.json.08
Then you do the usual commands to upgrade the software to latest v0.9:
git pull
make deepclean
make vendor
make
The new config.testnet.json will provide the seed nodes for v0.9 testing:
cp config.testnet.json config.json
It will look like this:
{
"HttpWsPort": 30002,
"HttpJsonPort": 30003,
"SeedList": [
"http://devnet-seed-0001.nkn.org:30003",
"http://devnet-seed-0002.nkn.org:30003",
"http://devnet-seed-0003.nkn.org:30003",
"http://devnet-seed-0004.nkn.org:30003"
],
"GenesisBlockProposer": "040149c42944eea91f094c16538eff0449d4d1e236f31c8c706b2
e40e98402984c"
}
You will need to create a new wallet in v0.9:
nknc wallet -c
And you can see that the wallet address now starts with “NKN” instead of just “N”:
Address Public Key
------- ----------
NKNUL7aqaB7jfm53KqrauPgsHQtjZRnjSUpU 0441b73a9482282f552b264eb98e38b1bcaf88bbc876fe8f06666e31fac1c09577
Switch back to root user and restart the nknd:
exit
systemctl restart nkn.service
After the nknd is running again, you can again switch back to nkn user and check how it is running with nknc:
su - nkn
nknc info -s
You can check if your v0.9 node is running properly. You can see the below info. One thing is a little bit confusing: the version said v0.8.0-alpha-75-g4077, but trust me, it is indeed v0.9. NKN core dev team cannot tag it into v0.9 yet, because that will trigger a massive auto-update for all the 1-click nodes out there. Not yet.
nkn@nkn-do-001:~/go/src/github.com/nknorg/nkn$ ./nknc info -s
{
"id": "1",
"jsonrpc": "2.0",
"result": {
"addr": "tcp://68.183.184.227:30001",
"currTimeStamp": 1554159243,
"height": 18479,
"id": "19b282eaaed5894e25a41192162a397a34532e5598334f58e34c5a10f2ad8125",
"jsonRpcPort": 30003,
"proposalSubmitted": 0,
"protocolVersion": 1,
"publicKey": "0441b73a9482282f552b264eb98e38b1bcaf88bbc876fe8f06666e31fac1c09577",
"relayMessageCount": 0,
"syncState": "PersistFinished",
"uptime": 337,
"version": "v0.8.0-alpha-75-g4077",
"websocketPort": 30002
}
}
And check if you have mined anything on v0.9:
nknc wallet -l balance
And you should see something like this. No mining reward yet
{
"id": "1",
"jsonrpc": "2.0",
"result": {
"amount": "0"
}
}
Happy news is that you can even see your v0.9 node on https://nknx.org, under node manager. You can clearly see your node sw version and block height are totally different from the v0.8.x testnet nodes.
Have fun!