From 6e572945709b18dbe11101fb34e63678a4acc504 Mon Sep 17 00:00:00 2001 From: Gabriel Garrido Calvo <2728080+ggarri@users.noreply.github.com> Date: Tue, 14 Sep 2021 10:33:11 +0200 Subject: [PATCH] update how to run QKM (#312) * update how to run QKM * update readme and how to run --- CHANGELOG.md | 9 +++++ README.md | 25 ++++++++------ docker-compose.latest.yml | 72 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 95 insertions(+), 11 deletions(-) create mode 100644 docker-compose.latest.yml diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fca0ba1e..043815eb4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Quorum Key Manager Release Notes +## v21.7.0-alpha.3 (2021-09-13) +### 🆕 Features +* Support pagination for listing endpoints +* Idempotent behaviour for update endpoints + +### 🛠 Bug fixes +* EEA transaction signing using empty privateFor +* Invalid successful readiness response if PG is not reachable + ## v21.7.0-alpha.2 (2021-08-26) ### 🆕 Features * Support for authorization using OIDC, TLS and API-KEY diff --git a/README.md b/README.md index cf2393e69..632bc1d43 100644 --- a/README.md +++ b/README.md @@ -14,18 +14,22 @@ In addition, using QKM, you can connect to your Ethereum nodes to sign your tran ## Run QKM -Available docker images can be found at `docker.consensys.net/pub/quorum-key-manager`. +First, define your Quorum Key Manager environment setup using manifest files. +Examples can be found at [`./deps/config/manifests`](./deps/config/manifests). +More information about how to setup service can be found in [documentation](#documentation). -To run the Quorum Key Manager service using docker you can execute the following command: +Once you manifests are written, specify where `quorum-key-manager` can find them on your filesystem +with the following environment variable: +```bash +export HOST_MANIFEST_PATH={your_manifests_folder} ``` -docker run -it \ ---name quorum-key-manager \ ---mount type=bind,source="$(pwd)"/deps/config,target=/manifests \ -docker.consensys.net/pub/quorum-key-manager:stable run --manifest-path=/manifests -``` + +Now launch Quorum Key Manager service using docker-compose with the following command: -You can find more information about the expected content of the `/manifest` folder in the project [documentation](#documentation) +```bash +docker-compose -f docker-compose.latest.yml up key-manager +``` ## Build from source @@ -33,8 +37,8 @@ To build binary locally requires Go (version 1.15 or later) and C compiler. After installing project vendors (ie `go mod vendor`) you can run following command to compile the binary -``` -make gobuild +```bash +go build -o ./build/bin/key-manager ``` Binary will be located in `./build/bin/key-manager` @@ -42,7 +46,6 @@ Binary will be located in `./build/bin/key-manager` ## Documentation Quorum Key Manager documentation website [https://docs.quorum-key-manager.consensys.net/](https://docs.quorum-key-manager.consensys.net/) - ## License diff --git a/docker-compose.latest.yml b/docker-compose.latest.yml new file mode 100644 index 000000000..48998bc5d --- /dev/null +++ b/docker-compose.latest.yml @@ -0,0 +1,72 @@ +version: "3.7" + +x-default-variables: &default-variables + LOG_LEVEL: ${LOG_LEVEL-INFO} + LOG_FORMAT: ${LOG_FORMAT-text} + HTTP_PORT: ${HTTP_PORT-8080} + HTTP_HOST: ${HTTP_HOST-0.0.0.0} + HEALTH_PORT: ${HEALTH_PORT-8081} + DB_TLS_SSLMODE: ${DB_TLS_SSLMODE-disable} + DB_TLS_CERT: ${DB_TLS_CERT-} + DB_TLS_KEY: ${DB_TLS_KEY-} + DB_TLS_CA: ${DB_TLS_CA-} + DB_HOST: ${DB_HOST-postgres} + DB_PORT: ${DB_PORT-} + DB_DATABASE: ${DB_DATABASE-} + DB_POOLSIZE: ${DB_POOLSIZE-} + DB_POOL_TIMEOUT: ${DB_POOL_TIMEOUT-} + MANIFEST_PATH: "/manifests" + +x-container-common: &container-common + image: docker.consensys.net/pub/quorum-key-manager:latest + restart: ${CONTAINER_RESTART-on-failure} + tty: true + +x-postgres-common: &postgres-common + environment: + POSTGRES_PASSWORD: postgres + +x-qkm-common: &qkm-common + DB_HOST: postgres + +services: + postgres: + <<: *container-common + <<: *postgres-common + image: postgres:13.3-alpine + volumes: + - db-data-api:/var/lib/postgresql/data + ports: + - 5432 + + migration: + <<: *container-common + environment: + <<: *default-variables + <<: *qkm-common + restart: "no" + command: migrate up + depends_on: + - postgres + volumes: + - ./deps/migrations:/migrations:ro + + key-manager: + <<: *container-common + environment: + <<: *default-variables + <<: *qkm-common + ports: + - 8080:8080 + - 8081:8081 + restart: "no" + depends_on: + - migration + command: run + volumes: + - ${HOST_MANIFEST_PATH-./deps/config/manifests}:/manifests:ro + +volumes: + db-data-api: + driver: local +