______  _   _  _   _  _   ________  _____  _____  _   __
    | ___ \| | | || \ | || | / /| ___ \|  _  |/  __ \| | / /
    | |_/ /| | | ||  \| || |/ / | |_/ /| | | || /  \/| |/ / 
    |  __/ | | | || . ` ||    \ |    / | | | || |    |    \ 
    | |    | |_| || |\  || |\  \| |\ \ \ \_/ /| \__/\| |\  \
    \_|     \___/ \_| \_/\_| \_/\_| \_| \___/  \____/\_| \_/
---------------------------------------------------------------------------
Home | Lisk
---------------------------------------------------------------------------

 

 

Lisk Betanet v5 on VPS with Ubuntu 20.04

Summary

1. Create lisk user, install needed stuff
2. Create your account
3. Create a random 12-word passphrase and encrypt your account-passphrase
4. Register your delegate and vote for yourself
5. Start Lisk (if not running) and activate forging
6. How to update to a new version



STEP 1 - Create lisk user, install needed stuff

~# adduser lisk
~# gpasswd -a lisk sudo
~# su - lisk

~$ sudo apt-get -y update && sudo apt-get -y upgrade && sudo apt-get -y dist-upgrade && sudo apt-get -y install wget tar zip unzip ufw htop nano npm git curl bash jq screen
~$ sudo apt install -y build-essential
~$ wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash

Now disconnect from your server (close your sesssion) and start a new session.

~$ nvm install 12.20.1
~$ npm install --global --production lisk-core
~$ curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
~$ sudo apt-get install -y nodejs

Now start Lisk for the first time. This will create the folders ~/.lisk/lisk-core
~$ screen -d -m -S lisk lisk-core start -n betanet

STEP 2 - Create your account

~$ lisk-core account:create

[ { "passphrase": "monkey ... ... ... ... ... ... ... ... ... ... image", "privateKey": "fc7d6bdf...4e51155a", "publicKey": "c50da2f4e489d33d22ffd26192eddff5ed9e6aa08c4d5a4794c62b034e51155a", "binaryAddress": "cf05384d5707179ea691731726313e83a00dc6f4", "address": "lskajvtut6wzj5ah4ky7o5roo4fu7uzsywkawa94w" } ]

Store the output and don't lose it.
You can now use the Faucet for Betanet (if not working try this link) to get some betaLSK (enter your address, not to the binaryAddress).

 

STEP 3 - Create a random 12-word passphrase and encrypt your account-passphrase

~$ lisk-core account:create

You just need the 12 words. Don't lose them!

pitch ... ... ... ... ... ... ... ... ... ... unusual

~$ lisk-core passphrase:encrypt

Please enter passphrase: monkey ... ... ... ... ... ... ... ... ... ... image
Please re-enter passphrase: monkey ... ... ... ... ... ... ... ... ... ... image
Please enter password: pitch ... ... ... ... ... ... ... ... ... ... unusual
Please re-enter password: pitch ... ... ... ... ... ... ... ... ... ... unusual


Copy and paste the output into a txt-file. You'll need parts of it for your config.json:

{"encryptedPassphrase":"iterations=100.......version=1"}

 

Now you create the onion hashes file:

~$ cd ~ && lisk-core hash-onion -o hash_onion.json


Now you create a bash file:

~$ cd ~ && nano create_config.sh

 

Paste the following into the file and do NOT close it. You will replace the highlighted parts:

cd ~ && > ~/.lisk/lisk-core/config.json
ONION=$(cat ~/hash_onion.json)
cat > ~/.lisk/lisk-core/config.json << EOF_betanet_config
{
"logger": {
"fileLogLevel": "info"
},
"plugins": {
"httpApi": {
"whiteList": [
"127.0.0.1"
]
}
},
"forging": {
"delegates": [
{
"address": "binaryAddress",
"encryptedPassphrase": "iterations=100............version=1",
"hashOnion": $ONION
}
]
}
}
EOF_betanet_config


Now remove the highlighted parts for address and encryptedPassphrase and replace them with the parts from the outputs you have generated above.

Save and exit the create_config.sh file.

Now you need to set the permissions to the file and execute it. This step will copy and paste the onion hashes into your config.json:

~$ chmod +x create_config.sh

~$ ./create_config.sh


Now you check if the config.json is working correct. I am using screen, to keep it as simple as possible.
If you want to use PM2 instead of screen to manage your node, you can check out the PM2-guide by lemii

~$ pkill screen

~$ screen -d -m -S lisk lisk-core start -n betanet -c ~/.lisk/lisk-core/config.json

~$ screen -r

20:01:03 INFO lisk-framework: Starting the app - lisk-core (module=lisk:app)
20:01:03 INFO lisk-framework: If you experience any type of error, please open an issue on Lisk GitHub: https://github.com/LiskHQ/lisk-sdk/issues (module=lisk:app)
20:01:03 INFO lisk-framework: Contribution guidelines can be found at Lisk-sdk: https://github.com/LiskHQ/lisk-sdk/blob/development/docs/CONTRIBUTING.md (module=lisk:app)
20:01:03 INFO lisk-framework: Booting the application with Lisk Framework(3.0.0-beta.2.8362aa8) (module=lisk:app)
20:01:03 INFO lisk-framework: Initializing controller (module=lisk:app)
20:01:03 INFO lisk-framework: Loading controller (module=lisk:app)
20:01:03 INFO lisk-framework: Event * was subscribed but not registered to the bus yet. (module=lisk:app)
20:01:04 INFO lisk-framework: New block added to the chain (module=lisk:app)
{
"id": "5a92c178ca2125f358f61d2174fc5c5500f94ebf76da22165751cf3923003789",
"height": 0,
"numberOfTransactions": 0
}
20:01:04 INFO lisk-framework: Blockchain ready (module=lisk:app)
20:01:04 INFO lisk-framework: Node ready and launched (module=lisk:app)
20:01:07 INFO lisk-framework: Starting synchronizer (module=lisk:app)


If the output is like the one above, your config.json seems correct.
If not, you have made mistakes when replacing the parts. Check again.
To detach from screen session correctly press CTRL+a+d

 

STEP 4 - Register your delegate and vote for yourself

Explainations (All Lisk Module and Asset ID's)

~$ lisk-core transaction:create 5 0 1100000000

? Please enter: username: Choose your username
? Please enter passphrase: monkey ... ... ... ... ... ... ... ... ... ... image

? Please re-enter passphrase: monkey ... ... ... ... ... ... ... ... ... ... image

{"transaction":"080510001800201...........3052578d1f88c3b38eaac1e48df2f3d67bb108"}

Copy the output of the signed transaction and broadcast it:

~$ lisk-core transaction:send 080510001800201...........3052578d1f88c3b38eaac1e48df2f3d67bb108

Transaction with id: '2cdcf658350427e8509385235f5ac429c01dbf77cda07bcb01f5504007e9ee3f' received by node

If it got accepted, your delegate name is registered.

 

Now check your account balance and vote for yourself:

~$ lisk-core account:get BinaryAddress

{"address":"cf05384d5707179ea691731726313e83a00dc6f4","token":{"balance":"1008999800000"},"sequence":{"nonce":"1"},"keys":{"numberOfSignatures":0,"mandatoryKeys":[],"optionalKeys":[]},"dpos":{"delegate":{"username":"punkrock","pomHeights":[],"consecutiveMissedBlocks":0,"lastForgedHeight":19128,"isBanned":false,"totalVotesReceived":"0"},"sentVotes":[],"unlocking":[]}}

The part "balance":"1008999800000 means you have 10089.998 LSK or 1008999800000 Beddows.
Now vote for yourself with a big part of the balance. I will use 10060 LSK here:

IMPORTANT: You can only use an amount in 10-LSK-steps! 10066 LSK not allowed. Only 10060 or 10070 for example.
And the amounts for fees and voting weight have to be entered in Beddows. 10060 LSK = 10060000000 Beddows


Explainations

~$ lisk-core transaction:create 5 1 100000000

? Please enter: votes(delegateAddress, amount): BinaryAddress, 1006000000000
? Want to enter another votes(delegateAddress, amount) No
? Please enter passphrase: [hidden]
? Please re-enter passphrase: [hidden]
{"transaction":"0805100118022080c2.......73fac59318c51140dda8fcb9c6f26a913f05"}

Now copy the output of the signed message and broadcast it:

~$ lisk-core transaction:send 0805100118022080c2.......73fac59318c51140dda8fcb9c6f26a913f05

Transaction with id: '620518d6a7a8545b760da9ea44a8ac08b40929a8ca372074d774b787ac2bee9c' received by node.

 

STEP 5 - Start Lisk (if not running) and activate forging

Check if Lisk is running. If screen -r doesn't show Lisk logs, it's obviously not running and you need to start it again with the following command:

~$ screen -d -m -S lisk lisk-core start -n betanet -c ~/.lisk/lisk-core/config.json

Detach from the screen session with CTRL+a+d

~$ cd ~

~$ curl https://raw.githubusercontent.com/punkrock/LiskBeta/main/SH/lisk-enable-forging.sh -o ~/lisk-forge-enable.sh

~$ chmod 700 ~/lisk-forge-enable.sh

~$ ./lisk-forge-enable.sh

? Enter password to decrypt the encrypted passphrase: *******************************************
Forging status:
{"address":"BinaryAddress","forging":true}

If the output says "forging":true, congratulations. You should forge on Betanet.

To confirm you can always use lisk-core account:get BinaryAddress to see if your balanace is increasing. Or you check logs for forged blocks with cat ~/.lisk/lisk-core/logs/lisk.log | grep "Forged new block" or wait for forged blocks with tail -f ~/.lisk/lisk-core/logs/lisk.log | grep "Forged new block".

How to update to a new version

The stuff in this gray box is needed to update your betanet nodes:

Stop your node:

~$ screen -r (CTRL+c)

~$ npm update -g lisk-core

If you get warnings about npm and/or nvm, try this:

~$ nvm install 12.20.1

~$ npm install -g npm


Now restart your node:

~$ screen -d -m -S lisk lisk-core start -n betanet -c ~/.lisk/lisk-core/config.json


If your machine doesn't find the command lisk-core, then do the following command and try again to start your node:

~$ export PATH="$PATH:$HOME/.lisk/lisk-core/bin"


Now enable forging

~$ cd ~

~$ curl https://raw.githubusercontent.com/punkrock/LiskBeta/main/SH/lisk-enable-forging.sh -o ~/lisk-forge-enable.sh

~$ chmod 700 ~/lisk-forge-enable.sh

~$ ./lisk-forge-enable.sh

? Enter password to decrypt the encrypted passphrase: *******************************************
Forging status:
{"address":"BinaryAddress","forging":true}


Ressources

Lisk Betanet v5 Explorer (by Korben3)
Lisk Betanet v5 Explorer (by moosty)


Thanks to shuse2 and przemer for helping and gr33ndrag0n for the bash scripts.
Happy forging!

punkrock