Installation 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. |
As an alternative to the Docker image setup, it is also possible to install Lisk Service from source code.
This setup requires more steps than the Docker image installation, however this provides the developer with the possibility to customize the Lisk Service codebase.
Prerequisites
The following dependencies are required to install and run Lisk Service from Source.
Update packages
In Ubuntu and its derivatives APT is the base package management application. Ensure your local APT registry is up-to-date.
apt update
Install Brew by following the latest instructions.
Next, ensure your package sources are up to date:
brew update
brew doctor
Node.js
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 following the official instructions.
-
Install v18 of Node.js using NVM:
nvm ls-remote
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:
Ubuntu
curl -sL https://deb.nodesource.com/setup_18.x | sudo -E bash -
sudo apt-get install -y nodejs
macOS
For macOS, please execute the following command below:
brew install node@18
MYSQL
MySQL is used for storing persistent data.
Lisk Service expects a MySQL user The MySQL user These values can be updated by setting the environment variable |
sudo apt update
sudo apt install mysql-server
sudo mysql_secure_installation
brew tap homebrew/services
brew install [email protected]
brew services start [email protected]
Redis
Redis is used for caching temporary data.
Docker Setup
Follow the steps described in the Prerequisites > Docker section of the "Installation with Docker" page.
Installation
# Clone the Lisk Service repository
git clone https://github.com/LiskHQ/lisk-service.git
cd lisk-service/docker/redis
git checkout v0.6.6
make up # to start Redis
The above commands should be enough to install Redis which is ready to use with Lisk Service.
To stop the Docker container again, execute the following commands below:
make down # to stop Redis
Ubuntu
sudo apt-get install redis-server
macOS
brew install redis
PM2
PM2 manages the node process for Lisk Service and handles log rotation (Highly Recommended).
npm install -g pm2
Installation
It is strongly recommended that you synchronize your Lisk Core node with the network before starting the Lisk Service. |
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.
# Clone Lisk Service repository
git clone https://github.com/LiskHQ/lisk-service.git
# Change directory to the new repository
cd lisk-service
# Switch to the recent stable as a base
git checkout v0.6.6
# ...or use the development branch
git checkout development
Install all npm dependencies from the root directory.
make build-local
Now it is possible to start Lisk Service:
npm run start
This will use the default configuration and connect Lisk Service to the Lisk Mainnet.
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.
Check the Usage section for examples of how to use and interact with Lisk Service. |