Binary setup
The binary installation offers an easy and automated approach to setting up Lisk Core.
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:
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:
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.
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.
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:
export PATH="$PATH:$HOME/lisk-core/bin"
See https://opensource.com/article/17/6/set-path-linux for more information.
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"
See https://linuxhint.com/add-a-directory-to-path-in-zsh/ for more information.
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:
lisk-core start --network mainnet
The default log levels for Mainnet are:
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: Alternatively, start the node with the following flag:
|
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.
"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:
lisk-core start --api-ipc