Installation from source code
As an alternative to the Docker image setup, it is also possible to install Lisk Service from source code.
|Install from source code if you want to customize the codebase of Lisk Service, e.g. if you want to adjust the API to be fully compatible with your blockchain application.
This setup requires more steps than the Docker image installation, however this provides the developer with the possibility to customize the Lisk Service codebase.
Lisk Service is a web application middleware that allows interaction with various blockchain networks based on the Lisk protocol. It is recommended to set up a blockchain node first, before setting up Lisk Service.
The following dependencies are required to install and run Lisk Service from Source.
- Supported Platforms
Ubuntu 20.04 (LTS) x86_64
Ubuntu 22.04 (LTS) x86_64
The following system requirements are recommended:
Machines with a minimum of 16 GB RAM for the Mainnet.
Machines with a minimum of 16 GB RAM for the Testnet.
Machines with a minimum of 40 GB HDD.
Node.js serves as the underlying engine for code execution. There are several different methods and version managers used to install Node.js on your system. It is recommended to use one of the following two options:
It is recommended to use a Node version manager such as NVM. NVM is a bash script that enables the management of multiple active Node.js versions.
Install NVM by following the official instructions.
Install v18 of Node.js using NVM.
nvm install 18
If NVM or other package managers are not required, it is possible to install the Node package globally as shown in the following commands below:
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
For macOS, please execute the following command below:
brew install node@18
MySQL is used for storing persistent data.
Lisk Service, by default, expects a MySQL user
The MySQL user
You can choose to create a custom database with a different user and password. These values can be updated by setting the following environment variables (specific to each microservice):
sudo apt update
sudo apt install mysql-server=8.0*
brew tap homebrew/services
brew install email@example.com
brew services start firstname.lastname@example.org
If you encounter issues authenticating, and you received the following error:
caching_sha2_password' cannot be loaded: dlopen(/usr/local/lib/plugin/caching_sha2_password.so, 2): image not found
Try to perform the following: Change the
default_authentication_plugin using the
If you are unsure where to find your
my.cnf, run the following command:
mysql --verbose --help | grep my.cnf
Add the following at the end of the file:
Save and exit.
Next, login via the terminal:
Then run the following command to update the root password:
ALTER USER 'root'@'127.0.0.1' IDENTIFIED WITH mysql_native_password BY '';
Now you should be able to login to your MySQL 8 via your MySQL Client.
Redis is used for caching temporary data.
Follow the steps described in the Prerequisites > Docker section of the "Installation with Docker" page.
docker run --name redis_service --port 6379:6379 -d redis:7-alpine
docker run --name redis_service -v /path/to/custom_redis.conf:/usr/local/etc/redis/redis.conf --port 6379:6379 -d redis:7-alpine
Starting with the Lisk Service version
0.7.2, we strongly recommend using custom authentication in Redis.
To learn more about it, please check the Redis Authentication README in the Lisk Service repository.
The above commands should be enough to start Redis which is ready to use with Lisk Service.
To stop the Docker container again, execute the following commands below:
docker stop redis_service
PM2 helps manage the node processes for Lisk Service and also offers easy log rotation (Highly Recommended).
npm install -g pm2
If you have not already done so, clone the lisk-service GitHub repository and then navigate into the project folder and check out the latest release.
git clone https://github.com/LiskHQ/lisk-service.git
git checkout v0.7.0
git checkout development
Install all npm dependencies from the root directory.
Now it is possible to start Lisk Service.
yarn run start
The default configuration in
ecosystem.config.js should suffice in most of the cases. If necessary, please modify the file to configure the necessary environment variables for each microservice as per your requirements.
To change the default configuration, check out the page Configuration with PM2.
More commands about how to manage Lisk Service are described on the PM2 commands page.