Binary setup

1. Pre-installation

1.1. Supported platforms

  • Ubuntu 18.04 (LTS) x86_64

  • Ubuntu 20.04 (LTS) x86_64

  • MacOS x86_64

  • MacOS ARM (Apple Silicon)

2. Installation

This section details how to install Lisk Core using pre-built application packages. Once completed, you will have a functioning node on the Lisk Network.

When using a MAC powered by Apple Silicon, please adhere to the following setup instructions:

2.1. Environment setup requirements

As a first step, please ensure to clean the old Node.js installations (with arm64 binaries).

rm -rf ~/.nvm

2.1.1. Install Rosetta (Intel x86 emulation layer)

Please execute the following command:

softwareupdate --install-rosetta

Add a new session and set the iTerm to open in the Intel mode. Now set a shortcut key (quick access), for opening the iTerm in the aforementioned mode. Following that, open a terminal in Intel mode. Optionally, to verify that the terminal is now running in Intel mode, execute the following command:

$ arch
i386

2.1.2. Install Homebrew

Homebrew can be installed for either the ARM or Intel compatible binaries as mentioned below:

  • ARM compatible binaries

  • Intel compatible binaries

arch -arm64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Add Homebrew to your ~/.zshrc or .zsh_profile

if [[ $(arch) = arm64 ]];
then
    echo 'Detected Apple Silicon, ARM Homebrew has precedence'
    export PATH="/opt/homebrew/bin:/usr/local/bin:$PATH"
else
    echo 'Detected Intel CPU architecture, Intel Homebrew has precedence'
    export PATH="/usr/local/bin:/opt/homebrew/bin:$PATH"

2.1.3. Install nvm

Node Version Manager can be installed for either the ARM or Intel compatible binaries as mentioned below:

  • ARM compatible binaries

  • Intel compatible binaries

arch -arm64 /bin/bash -c "wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash"
arch -x86_64 /bin/bash -c "wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash"

2.1.4. Install Node.js

To install Node.js execute the following command:

arch -x86_64 nvm install 16

2.1.5. Install Python (For Macs running on Apple Silicon)

To install Python on a Mac powered by Apple Silicon, execute the following commands:

brew install pyenv
pyenv install 2.7.18
export PATH="$(pyenv root)/shims:${PATH}"
echo 'PATH=$(pyenv root)/shims:$PATH' >> ~/.zshrc
pyenv global 2.7.18

Please note, that some minimal housekeeping is required to ensure the right paths are included in the profile.

  • Apple Silicon (ARM) brew writes binaries to the following: /opt/homebrew/bin

  • Intel brew binaries are stored (as usual), in the following location: /usr/local/Homebrew/bin

  • Preference should be given to Apple Silicon binaries over Intel where possible.

Remember to export the nvm path, (this should be performed automatically by the script).

2.2. Download and execute the installation script

Download Lisk Core.

  • Mainnet

  • Testnet

Linux:

curl -o lisk-core.tar.gz https://downloads.lisk.com/lisk/mainnet/4.0.0/lisk-core-v4.0.0-linux-x64.tar.gz

MacOS:

curl -o lisk-core.tar.gz https://downloads.lisk.com/lisk/mainnet/4.0.0/lisk-core-v4.0.0-darwin-x64.tar.gz

Linux:

curl -o lisk-core.tar.gz https://downloads.lisk.com/lisk/testnet/4.0.0/lisk-core-v4.0.0-linux-x64.tar.gz

MacOS:

curl -o lisk-core.tar.gz https://downloads.lisk.com/lisk/testnet/4.0.0/lisk-core-v4.0.0-darwin-x64.tar.gz

Unpack it and add it to the system path, in order to use it in the terminal:

tar -xf ./lisk-core.tar.gz
cd lisk-core
./bin/lisk-core

You can make the lisk-core command available in the PATH, e.g. by executing the following:

  • bash

  • zshrc

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

To make lisk-core permanently available in the CLI, add the above snippet to ~/.bashrc.

To reload .bashrc, run the following command:

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

To make lisk-core permanently available in the CLI, add the above snippet to ~/.zshrc.

To reload .zshrc, run the following command:

source ~/.zshrc

3. Verify successful installation

To verify that your Lisk node is up and running, execute the following command:

  • Mainnet

  • Testnet

lisk-core start --network mainnet

The default log levels for Mainnet are:

"system": {
    "logLevel": "info",
},

When the node is started, the logs will be visible in the console. You can adjust the level of logging as per your preference. Supported log levels are: trace, debug, info, warn, error, and fatal. To reduce the number of logs, it is recommended to set the log levels to warn or higher.

Alternatively, start the node with the following flag:

lisk-core start --network mainnet --log=info
lisk-core start --network testnet

4. Post-installation (optional)

4.1. Use pm2 to run Lisk Core in the background

It is recommended to use a process manager such as PM2 to run Lisk Core in the background.

4.2. Enable IPC & WS in the config

To make use of all the Lisk Core commands, enable IPC in the config.

Example: Enable IPC & WS via config.json
"rpc": {
    // Enable RPC communication over 'ipc' or 'ws'
    "modes": ["ipc", "ws"]

    // In case `modes` include `ws` then, the following port is used
    "port": 7887,

    // Change to 0.0.0.0 to connect from a remote server
    "host": "127.0.0.1"
},

Alternatively, start Lisk Core with the flag --api-ipc to enable IPC:

Example: Enable IPC via flag
lisk-core start --api-ipc

4.3. Log rotation

It is recommended to set up a log rotation, as the log of the Lisk Core files can grow very large over time.