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.
The following dependencies are required to install and run Lisk Service from Source.
In Ubuntu and its derivatives APT is the base package management application. Ensure your local APT registry is up-to-date.
Install Brew by following the latest instructions.
Next, ensure your package sources are up to date:
brew update brew doctor
Tool chain components
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 v16 of Node.js using NVM:
nvm install 16.15.0
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_16.x | sudo -E bash - sudo apt-get install -y nodejs
For macOS, please execute the following command below:
brew install node@12
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
Redis is used for caching temporary data.
Follow the steps described in the Prerequisites > Docker section of the "Installation with Docker" page.
# Clone the Lisk Service repository git clone https://github.com/LiskHQ/lisk-service.git cd lisk-service/docker/redis git checkout v0.6.4 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
sudo apt-get install redis-server
brew install redis
PM2 manages the node process for Lisk Service and handles log rotation (Highly Recommended).
npm install -g pm2
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.4 # ...or use the development branch git checkout development
Install all npm dependencies from the root directory.
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.|