Docker setup
This document describes how to run Lisk Core as a Docker image-based container.
Lisk Core version 4 does not have any external dependencies and hence does not require using docker-compose
.
Pre-installation
Hardware requirements
The following system requirements are recommended:
- Memory
-
-
Machines with a minimum of 4 GB RAM for the Mainnet.
-
Machines with a minimum of 2 GB RAM for the Testnet.
-
- Storage
-
-
Machines with a minimum of 40 GB HDD[1].
-
Create a new user
To run and manage a Lisk Core node in the future, please create a separate lisk
user as described below:
The |
sudo adduser lisk (1)
1 | Create a new user. |
It is not necessarily required to set up a lisk
user, especially when you are running a local instance for development purposes.
However, if it is required then it is recommended to create the user using the MacOS GUI.
Install Docker
To run Lisk Core in Docker, firstly it is necessary to install the Docker engine. Determine if your platform can run Docker as described below.
Please refer to the Docker installation page.
Please refer to the Docker installation for ubuntu.
Configure Docker, in order that it can be run without sudo rights: linux post install.
|
Install make
using your package manager.
For example, use apt-get
if running Ubuntu as shown below:
sudo apt-get install curl make
Please refer to Docker installation for Mac.
Install make
using XCode.
Please refer to Docker installation for Windows.
Lisk Core download
git clone https://github.com/LiskHQ/lisk-core.git (1)
cd lisk-core/docker (2)
git checkout v4.0.0 -b v4.0.0 (3)
1 | Clone the repository. |
2 | Navigate into the lisk-core root folder. |
3 | Check out the latest release tag. |
Please check for the latest release in the Lisk Core releases list. |
Run
Podman
It is also possible to use podman instead of docker by simply replacing the occurrences of docker with |
Create a "lisk-core" container:
docker run --volume lisk-data:/home/lisk/.lisk \
--publish 7887:7887 \
--name lisk-core \
lisk/core:4.0.0 \
start --network=mainnet
The default log levels for Mainnet are:
So if you start the node, it won’t show any logs in the console.
This is the recommended setting for reducing the number of logs for a running node.
However, to verify that the node started correctly, update the log levels in the config to Alternatively, start the node with the following flag:
|
docker run --volume lisk-data:/home/lisk/.lisk \
--publish 7887:7887 \
--name lisk-core \
lisk/core:4.0.0 \
start --network=testnet
docker run --volume lisk-data:/home/lisk/.lisk \
--publish 7887:7887 \
--name lisk-core \
lisk/core:4.0.0 \
start --network=devnet
The passphrase for the genesis account(s) can be found here in the Lisk Core GitHub repository under the following path: config/devnet/passphrase.json. |
Configuration
Further parameters can be passed after --network
, for example, as shown below:
docker run --volume lisk-data:/home/lisk/.lisk \
--publish 7667:7667 \
--publish 127.0.0.1:7887:7887 \
--name lisk-core \
lisk/core:4.0.0 \
start --network=testnet --api-ws --api-http --log=debug
Environment variables can be set with --env
:
docker run --volume lisk-data:/home/lisk/.lisk \
--publish 7667:7667 \
--env LISK_CONSOLE_LOG_LEVEL=debug \
--name lisk-core \
lisk/core:4.0.0 \
start --network=mainnet
Import blockchain snapshot
docker run --volume lisk-data:/home/lisk/.lisk -it --rm lisk/core:4.0.0 blockchain download --network=betanet --output=/home/lisk/.lisk/tmp/
docker run --volume lisk-data:/home/lisk/.lisk -it --rm lisk/core:4.0.0 blockchain import /home/lisk/.lisk/tmp/blockchain.db.tar.gz
docker run --volume lisk-data:/home/lisk/.lisk -it --rm --entrypoint rm lisk/core:4.0.0 -f /home/lisk/.lisk/tmp/blockchain.db.tar.gz
docker start lisk-core
docker logs -f lisk-core