Skip to content

Commit 6068cd8

Browse files
authored
build and document qclient for docker (#165)
* specify value of cpus and memory as string * build and document qclient * fix health check command
1 parent de115fb commit 6068cd8

File tree

3 files changed

+23
-6
lines changed

3 files changed

+23
-6
lines changed

DOCKER-README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ docker build --build-arg GIT_COMMIT=$(git log -1 --format=%h) -t quilibrium -t q
5454

5555
Use latest version instead of `1.4.2`.
5656

57+
> [!TIP]
58+
> You can use the `task build` command instead. See the [Task](#task) section below.
59+
5760
The image that is built is light and safe. It is based on Alpine Linux with the Quilibrium node binary, not the
5861
source code, nor the Go development environment. The image also has the `grpcurl` tool that can be used to
5962
query the gRPC interface.
@@ -105,6 +108,9 @@ Run Quilibrium in a container:
105108
docker compose up -d
106109
```
107110

111+
> [!TIP]
112+
> You can alternatively use the `task up` command. See the [Task](#task-1) section above.
113+
108114
A `.config/` subfolder will be created under the current folder, this is mapped inside the container.
109115
Make sure you backup `config.yml` and `keys.yml`.
110116

@@ -159,10 +165,10 @@ services:
159165
resources:
160166
limits:
161167
cpus: '4' # Maximum CPU count that the container can use
162-
memory: 16G # Maximum memory that the container can use
168+
memory: '16G' # Maximum memory that the container can use
163169
reservations:
164170
cpus: '2' # CPU count that the container initially requests
165-
memory: 8G # Memory that the container initially request
171+
memory: '8G' # Memory that the container initially request
166172
```
167173
168174
@@ -213,3 +219,9 @@ Run the DB console:
213219
docker compose exec node node -db-console
214220
```
215221

222+
Run the Quilibrium client:
223+
```shell
224+
docker compose exec node qclient help
225+
docker compose exec node qclient token help
226+
docker compose exec node qclient token balance
227+
```

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ WORKDIR /opt/ceremonyclient/node
1111
RUN go install ./...
1212
RUN go install github.com/fullstorydev/grpcurl/cmd/grpcurl@latest
1313

14+
WORKDIR /opt/ceremonyclient/client
15+
16+
RUN go build -o qclient ./main.go
17+
1418
FROM alpine:3.19
1519

1620
ARG NODE_VERSION
@@ -34,6 +38,7 @@ COPY --from=build /go/bin/node /usr/local/bin
3438
COPY --from=build /go/bin/grpcurl /usr/local/bin
3539
COPY --from=build /opt/ceremonyclient/node/ceremony.json /root
3640
COPY --from=build /opt/ceremonyclient/node/retroactive_peers.json /root
41+
COPY --from=build /opt/ceremonyclient/client/qclient /usr/local/bin
3742

3843
WORKDIR /root
3944

docker-compose.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ services:
1010
deploy:
1111
resources:
1212
limits:
13-
memory: 32G
13+
memory: '32G'
1414
reservations:
15-
cpus: 12
16-
memory: 16G
15+
cpus: '12'
16+
memory: '16G'
1717
environment:
1818
- DEFAULT_LISTEN_GRPC_MULTIADDR=/ip4/0.0.0.0/tcp/8337
1919
- DEFAULT_LISTEN_REST_MULTIADDR=/ip4/0.0.0.0/tcp/8338
@@ -23,7 +23,7 @@ services:
2323
- '127.0.0.1:${QUILIBRIUM_GRPC_PORT:-8337}:8337/tcp' # gRPC
2424
- '127.0.0.1:${QUILIBRIUM_REST_PORT:-8338}:8338/tcp' # REST
2525
healthcheck:
26-
test: ["CMD", "node", "--peer-id"]
26+
test: ["CMD", "grpcurl", "-plaintext", "localhost:8337", "list", "quilibrium.node.node.pb.NodeService"]
2727
interval: 30s
2828
timeout: 5s
2929
retries: 3

0 commit comments

Comments
 (0)