diff --git a/docs/antora/modules/ROOT/pages/management/docker.adoc b/docs/antora/modules/ROOT/pages/management/docker.adoc index 3d62940df9..6f2b9aefff 100644 --- a/docs/antora/modules/ROOT/pages/management/docker.adoc +++ b/docs/antora/modules/ROOT/pages/management/docker.adoc @@ -11,11 +11,24 @@ Mona Bärenfänger :url_FLUSHALL: https://redis.io/commands/FLUSHALL :url_snapshot_config: configuration/index.adoc :url_backups: management/snapshots.adoc +:url_rel_notes: https://github.com/LiskHQ/lisk-service/releases +:url_tags: https://github.com/LiskHQ/lisk-service/tags + +== Build Docker image + +.Inside the lisk-service root folder +---- +make build +---- +This creates the necessary Docker images to start Lisk Service in the containers. == Start .Inside the lisk-service root folder ---- +cp ./docker/example.env .env +---- +---- make up ---- @@ -204,10 +217,147 @@ If you wish to take a snapshot of your Docker installation, the details can be f == 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. +The possibility exists here to either use the `docker` commands or the `make` commands to check the logs, and both options are listed here below. + +For `docker`, 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 ---- + +To check the logs for different microservices using the `make` commands, the following commands listed below can be used: + +.Displays the logs for all the microservices that have been logged so far, and that are currently existing +---- +make logs +---- + +.Displays the latest logs for all the microservices +---- +make logs-live +---- + +.Displays the logs for the specified microservice. +---- +make logs-blockchain-connector +---- +In the above example, it will display logs only for the `blockchain-connector` microservice. + +.Displays the latest logs for the specified microservice. +---- +make logs-live-blockchain-connector +---- +In the above example, it will display the latest logs only for the `blockchain-connector` microservice. + + +Replace the `blockchain-connector` with the specific service name required. + + +== Upgrade Lisk Service + +To upgrade the Docker container to a desired version, please follow one of the two options below. To find all the tagged versions for Lisk Service, please check the {url_tags}[available tags] on GitHub. + +[tabs] +==== +Option A - Download pre-built images from DockerHub:: ++ +-- +. Stop Lisk Service ++ +---- +make stop +---- +NOTE: In case the database needs to be flushed please execute the `make down` command instead. Please check the {url_rel_notes}[release notes] for the relevant version to see if the existing databases need to be flushed. + +. Checkout the version with *`git checkout `* ++ +---- +git checkout v0.7.0 +---- + +. Update `docker-compose.yml` to download the specific image versions from the DockerHub as shown below. +Update specified images with the desired version, for example `0.7.0`. ++ +.docker-compose.yml +[source,yaml] +---- +blockchain-app-registry: + image: lisk/service_blockchain_app_registry:0.7.0 + ... + + blockchain-connector: + image: lisk/service_blockchain_connector:0.7.0 + ... + + blockchain-indexer: + image: lisk/service_blockchain_indexer:0.7.0 + ... + + blockchain-coordinator: + image: lisk/service_blockchain_coordinator:0.7.0 + ... + + transaction-statistics: + image: lisk/service_transaction_statistics:0.7.0 + ... + + fee-estimator: + image: lisk/service_fee_estimator:0.7.0 + ... + + gateway: + image: lisk/service_gateway:0.7.0 + ... + + market: + image: lisk/service_market:0.7.0 + ... + + export: + image: lisk/service_export:0.7.0 + +---- + +. Start Lisk Service in the containers. ++ +---- +make up +---- +-- +Option B - Build images locally :: ++ +-- +Build the images locally using the following steps. +Navigate inside the lisk-service root folder, and execute the following commands. + +. Stop Lisk Service ++ +---- +make stop +---- +NOTE: In case the database needs to be flushed please execute the `make down` command instead. Please check the {url_rel_notes}[release notes] for the relevant version to see if the existing databases need to be flushed. + +. Checkout the version with *`git checkout `* ++ +---- +git checkout v0.7.0 +---- + +. Build the required updated Docker images ++ +---- +make build +---- + +. Start Lisk Service in the containers ++ +---- +make up +---- +-- + +==== + +To verify the microservice logs, please refer to the <> section. diff --git a/docs/antora/modules/ROOT/pages/management/source.adoc b/docs/antora/modules/ROOT/pages/management/source.adoc index c2f88a09d3..7d858d9cd7 100644 --- a/docs/antora/modules/ROOT/pages/management/source.adoc +++ b/docs/antora/modules/ROOT/pages/management/source.adoc @@ -10,7 +10,11 @@ Mona Bärenfänger Muhammad Talha > command. To learn more about PM2 log management please refer the {url_pm2_management}[PM2 logs documentation]. + + == Various PM2 commands === Start @@ -103,6 +110,7 @@ Alternatively, it is also possible to check the logs for a specific PM2 process For example, `pm2 logs 0` can be used to check the Lisk Service Gateway logs. TIP: The process ID of each PM2-managed process can be seen by executing the <> command. +To learn more about PM2 log management please refer the {url_pm2_management}[PM2 logs documentation]. For example, to see the logs for the Gateway microservice, execute the following command: @@ -367,3 +375,104 @@ redis-cli -n flushdb ==== You can start Lisk Service again with the <> command. + + +== Upgrade Lisk Service + +To upgrade Lisk Service to a desired version, please follow the steps listed below. To find all the tagged versions for Lisk Service, please check the {url_tags}[available tags] on GitHub. + +. Stop the existing running version of Lisk Service. ++ +---- +pm2 stop ecosystem.config.js +---- ++ +.Response +[%collapsible] +==== +.Example output +[source,bash] +---- +[PM2] [lisk-service-blockchain-app-registry](1) ✓ +[PM2] [lisk-service-gateway](0) ✓ +[PM2] [lisk-service-blockchain-indexer](3) ✓ +[PM2] [lisk-service-blockchain-connector](2) ✓ +[PM2] [lisk-service-blockchain-coordinator](4) ✓ +[PM2] [lisk-service-fee-estimator](5) ✓ +[PM2] [lisk-service-transaction-statistics](6) ✓ +[PM2] [lisk-service-market](7) ✓ +[PM2] [lisk-service-export](8) ✓ +┌------------------------------------------------------------------------------------------------------------------------------------------------------------------------┐ +│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │ +├------------------------------------------------------------------------------------------------------------------------------------------------------------------------┤ +│ 1 │ lisk-service-blockchain-app-registry │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 32 │ stopped │ 0% │ 0b │ XYZ │ disabled │ +│ 2 │ lisk-service-blockchain-connector │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 0 │ stopped │ 0% │ 0b │ XYZ │ disabled │ +│ 4 │ lisk-service-blockchain-coordinator │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 0 │ stopped │ 0% │ 0b │ XYZ │ disabled │ +│ 3 │ lisk-service-blockchain-indexer │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 32 │ stopped │ 0% │ 0b │ XYZ │ disabled │ +│ 8 │ lisk-service-export │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 30 │ stopped │ 0% │ 0b │ XYZ │ disabled │ +│ 5 │ lisk-service-fee-estimator │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 30 │ stopped │ 0% │ 0b │ XYZ │ disabled │ +│ 0 │ lisk-service-gateway │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 30 │ stopped │ 0% │ 0b │ XYZ │ disabled │ +│ 7 │ lisk-service-market │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 30 │ stopped │ 0% │ 0b │ XYZ │ disabled │ +│ 6 │ lisk-service-transaction-statistics │ default │ 0.7.0-… │ fork │ 0 │ 0 │ 30 │ stopped │ 0% │ 0b │ XYZ │ disabled │ +└------------------------------------------------------------------------------------------------------------------------------------------------------------------------┘ +---- +==== + +. Checkout the version with *`git checkout `*. ++ +---- +git checkout v0.7.0 +---- + +. Update the npm dependencies by executing the following command. ++ +---- +make build-local +---- + +. Restart Lisk Service with the following command. ++ +---- +pm2 start ecosystem.config.js +---- ++ +.Response +[%collapsible] +==== +.Example output +---- +[PM2] Applying action restartProcessId on app [lisk-service-gateway](ids: [ 0 ]) +[PM2] Applying action restartProcessId on app [lisk-service-blockchain-app-registry](ids: [ 1 ]) +[PM2] [lisk-service-gateway](0) ✓ +[PM2] [lisk-service-blockchain-app-registry](1) ✓ +[PM2] Applying action restartProcessId on app [lisk-service-blockchain-connector](ids: [ 2 ]) +[PM2] [lisk-service-blockchain-connector](2) ✓ +[PM2] Applying action restartProcessId on app [lisk-service-blockchain-indexer](ids: [ 3 ]) +[PM2] [lisk-service-blockchain-indexer](3) ✓ +[PM2] Applying action restartProcessId on app [lisk-service-blockchain-coordinator](ids: [ 4 ]) +[PM2] [lisk-service-blockchain-coordinator](4) ✓ +[PM2] Applying action restartProcessId on app [lisk-service-fee-estimator](ids: [ 5 ]) +[PM2] [lisk-service-fee-estimator](5) ✓ +[PM2] Applying action restartProcessId on app [lisk-service-transaction-statistics](ids: [ 6 ]) +[PM2] [lisk-service-transaction-statistics](6) ✓ +[PM2] Applying action restartProcessId on app [lisk-service-market](ids: [ 7 ]) +[PM2] [lisk-service-market](7) ✓ +[PM2] Applying action restartProcessId on app [lisk-service-export](ids: [ 8 ]) +[PM2] [lisk-service-export](8) ✓ +┌----------------------------------------------------------------------------------------------------------------------------------------------------------------------------┐ +│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │ +├----------------------------------------------------------------------------------------------------------------------------------------------------------------------------┤ +│ 1 │ lisk-service-blockchain-app-registry │ default │ 0.7.0-… │ fork │ 33328 │ 0s │ 16 │ online │ 0% │ 65.5mb │ XYZ │ disabled │ +│ 2 │ lisk-service-blockchain-connector │ default │ 0.7.0-… │ fork │ 33331 │ 0s │ 0 │ online │ 0% │ 63.8mb │ XYZ │ disabled │ +│ 4 │ lisk-service-blockchain-coordinator │ default │ 0.7.0-… │ fork │ 33341 │ 0s │ 0 │ online │ 0% │ 54.1mb │ XYZ │ disabled │ +│ 3 │ lisk-service-blockchain-indexer │ default │ 0.7.0-… │ fork │ 33338 │ 0s │ 16 │ online │ 0% │ 54.3mb │ XYZ │ disabled │ +│ 8 │ lisk-service-export │ default │ 0.7.0-… │ fork │ 33355 │ 0s │ 15 │ online │ 0% │ 14.1mb │ XYZ │ disabled │ +│ 5 │ lisk-service-fee-estimator │ default │ 0.7.0-… │ fork │ 33346 │ 0s │ 15 │ online │ 0% │ 46.9mb │ XYZ │ disabled │ +│ 0 │ lisk-service-gateway │ default │ 0.7.0-… │ fork │ 33326 │ 0s │ 15 │ online │ 0% │ 65.6mb │ XYZ │ disabled │ +│ 7 │ lisk-service-market │ default │ 0.7.0-… │ fork │ 33351 │ 0s │ 15 │ online │ 0% │ 36.9mb │ XYZ │ disabled │ +│ 6 │ lisk-service-transaction-statistics │ default │ 0.7.0-… │ fork │ 33348 │ 0s │ 15 │ online │ 0% │ 43.5mb │ XYZ │ disabled │ +└----------------------------------------------------------------------------------------------------------------------------------------------------------------------------┘ +---- +==== + +NOTE: Please check the {url_rel_notes}[GitHub release notes] for the relevant version to verify if the existing databases need to be flushed.