Docker commands
Start
make up
This will start Lisk Service with the default configuration, which in turn will connect to a Lisk Core Mainnet node.
In case a different node or network shall be used, configure Lisk Service accordingly.
Reset the Lisk Service database
To reset the database of Lisk Service, drop the respective MySQL and Redis databases.
Before resetting the database, stop Lisk Service:
make stop
Now connect to the Docker container in which you wish to reset the database. If you are not sure what to choose here, check the available containers via Show the status of Docker containers.
To connect to the interactive shell of the MySQL Docker container in which you wish to reset the MySQL database, execute the following command:
docker exec -it lisk-service-mysql-primary-1 bash
Drop Database
-
Login to MySQL with the
lisk
user.mysql -ulisk -ppassword
On successful login, you enter the MYSQL command-line client:
Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 2044 Server version: 8.0.27 MySQL Community Server - GPL Copyright (c) 2000, 2021, Oracle and/or its affiliates. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
-
Drop the
lisk
database.mysql> drop database lisk;
-
Create a fresh database
lisk
.mysql> create database lisk;
-
Log out from MySQL by typing
quit;
mysql> quit;
Log out of the docker container by pressing CRTL + D.
MariaDB also uses the same SQL commands for querying and manipulating the relevant data, including data storage, client libraries, and replication.
-
Login to MariaDB with the
lisk
user.docker exec -it lisk_mariadb mysql -uroot -p
On successful login, you enter the MariaDB command-line client:
Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 9 Server version: 10.7.8-MariaDB-1:10.7.8+maria~ubu2004 mariadb.org binary distribution Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
-
Drop the
lisk
database.MariaDB [(none)]> drop database lisk;
ResultQuery OK, 0 rows affected (0.009 sec)
-
Create a fresh database
lisk
MariaDB [(none)]> create database lisk;
ResultQuery OK, 1 row affected (0.001 sec)
-
Log out by typing
quit;
.MariaDB [(none)]> exit;
Log out of the docker container by pressing CRTL + D.
Flush Redis DB
Reset the databases for Redis after dropping the MySQL database:
sudo docker exec -it lisk-service_redis_core_persistent_1 /bin/sh
redis-cli flushall
Log out of the docker container again by pressing CRTL + D. |
The
For more information, check the Redis documentation: FLUSHALL. To flush only a particular DB in Redis, execute the following command instead:
|
Logging
To check the logs for the different microservices of Lisk Service, use the command docker container logs CONTAINER
, where CONTAINER
is the respective Docker container that holds the logs you wish to view.
For example, to see the logs for the Gateway microservice, execute the following command:
docker container logs lisk-service_gateway_1