Skip to content

Commit 13bac91

Browse files
CassOnMarsAvAcalhorak160xlukmscurtescu
authored
v1.4.18-patch-1 (#216)
* experiment: verify in channel (#215) * Change volume mapping so .config folder is created inside node folder and not on root (#214) * Update main.go to fix Q logo (#213) Q logo is not appearing correctly on the terminal while running node. Added a new line character after "Signature check passed" to fix it * switched get node info response to use masterClock frame for maxFrame field (#212) * fix: keys file remains null (#217) * Revert "Change volume mapping so .config folder is created inside node folder…" (#218) This reverts commit 27f50a9. * Docker split take 2 (#219) * split runtime docker files into a docker subfolder * split DOCKER-README.md * updated docker instructions * add restore command * add image update related tasks * add command to test if P2P port is visible * Remove bootstrap peer (#189) * Change bootstrap servers to DHT-only peers (#187) * support voucher file-based claims (#183) * Change bootstrap servers to DHT-only peers Changing my bootstrap servers to DHT-only peers with somewhat lower specs. One of the new ones is in the US and the other one is in Switzerland. Both use reliable providers and have 10Gbps network interfaces. --------- Co-authored-by: Cassandra Heart <7929478+CassOnMars@users.noreply.github.com> * Don't run self-test in DHT-only mode (#186) * support voucher file-based claims (#183) * Don't run self-test in DHT-only mode The node tries to create a self-test when ran with the `-dht-only` flag, but it doesn't load the KZG ceremony data in DHT-only mode which leads to a crash. Don't run self-test when the `-dht-only` flag is set. I tested by starting a node locally with and without existing self-test and with the `-dht-only` flag. --------- Co-authored-by: Cassandra Heart <7929478+CassOnMars@users.noreply.github.com> * Embed json files in binary (#182) * Embed ceremony.json in binary * Embed retroactive_peers.json in binary * Signers build and verification tasks (#181) * add signers specific Taskfile * add verify tasks * move signer task under signer folder * create docker image specific for signers * map current user into docker image and container * ignore node-tmp-* * add verify:build:internal * prevent tasks with docker commands from being run inside a container * rename *:internal to *:container * add README.md * add pem files to git * Updating Q Guide link (#173) * Update README.md Updated link to Quilibrium guide to new website * Update README.md --------- Co-authored-by: littleblackcloud <163544315+littleblackcloud@users.noreply.github.com> Co-authored-by: Agost Biro <5764438+agostbiro@users.noreply.github.com> Co-authored-by: Cassandra Heart <7929478+CassOnMars@users.noreply.github.com> Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com> * Signer related fixes (#220) * add pems 16 and 17 * remove .bin extension from generated binaries * no more json files to copy to docker image * feat: recalibrate self-test on the fly (#221) * fix: switch RPC for peer and node info (#222) * replace binaries with patch build * add digests * Signatory #13 added * Signatory #4 added (#223) * Signatory #14 added * Signatory #17 added * Signatory #12 added * Signatory #3 added * Signatory #2 added * Signatory #16 added * Signatory #1 added * Signatory #8 added * remove binaries, release ready --------- Co-authored-by: AvAcalho <158583728+AvAcalho@users.noreply.github.com> Co-authored-by: Ravish Ahmad <ravishahmad16@gmail.com> Co-authored-by: luk <luk@luktech.dev> Co-authored-by: Marius Scurtescu <marius.scurtescu@gmail.com> Co-authored-by: littleblackcloud <163544315+littleblackcloud@users.noreply.github.com> Co-authored-by: Agost Biro <5764438+agostbiro@users.noreply.github.com> Co-authored-by: Demipoet <161999657+demipoet@users.noreply.github.com> Co-authored-by: 0xOzgur <29779769+0xOzgur@users.noreply.github.com>
1 parent 2bbd1e0 commit 13bac91

File tree

58 files changed

+575
-348
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+575
-348
lines changed

.env.example

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,3 @@
11
# Use a custom docker image name
22
# Default: quilibrium
33
QUILIBRIUM_IMAGE_NAME=
4-
5-
# Use a custom P2P port.
6-
# Default: 8336
7-
QUILIBRIUM_P2P_PORT=
8-
9-
# Use a custom gRPC port.
10-
# Default: 8337
11-
QUILIBRIUM_GRPC_PORT=
12-
13-
# Use a custom REST port.
14-
# Default: 8338
15-
QUILIBRIUM_REST_PORT=

DOCKER-README.md

Lines changed: 12 additions & 186 deletions
Original file line numberDiff line numberDiff line change
@@ -1,81 +1,37 @@
11
# Quilibrium Docker Instructions
22

3-
## WARNING
4-
5-
> [!WARNING]
6-
> The Quilibrium docker container requires host configuration changes.
7-
8-
There are extreme buffering requirements, especially during sync, and these in turn require `sysctl`
9-
configuration changes that unfortunately are not supported by Docker. But if these changes are made on
10-
the host machine, then luckily containers seem to automatically have the larger buffers.
11-
12-
The buffer related `sysctl` settings are `net.core.rmem_max` and `net.core.wmem_max` and they both
13-
should be set to `600,000,000` bytes. This value allows pre-buffering of the entire maximum payload
14-
for sync.
15-
16-
You can tell that the buffer size is not large enough by noticing this log entry at beginning when
17-
Quilibrium starts, a few lines below the large logo:
18-
> failed to sufficiently increase receive buffer size (was: 208 kiB, wanted: 2048 kiB, got: 416 kiB).
19-
> See https://github.com/quic-go/quic-go/wiki/UDP-Buffer-Sizes for details.
20-
21-
To read the currently set values:
22-
```shell
23-
sysctl -n net.core.rmem_max
24-
sysctl -n net.core.wmem_max
25-
```
26-
27-
To set new values, this is not a persistent change:
28-
```shell
29-
sudo sysctl -w net.core.rmem_max=600000000
30-
sudo sysctl -w net.core.wmem_max=600000000
31-
```
32-
33-
To persistently set the new values add a configuration file named `20-quilibrium.conf` to
34-
`/etc/sysctl.d/`. The file content should be:
35-
```
36-
# Quilibrium buffering requirements, especially during sync.
37-
# The value could be as low as 26214400, but everything would be slower.
38-
39-
net.core.rmem_max = 600000000
40-
net.core.wmem_max = 600000000
41-
```
42-
43-
443
## Build
454

46-
The only requirements are `git` (to checkout the repository) and docker (to build the image and run the container).
5+
The only requirements are `git` (to checkout the repository) and docker (to build the image).
476
Golang does not have to be installed, the docker image build process uses a build stage that provides the
487
correct Go environment and compiles the node down to one command.
498

509
In the repository root folder, where the [Dockerfile](Dockerfile) file is, build the docker image:
5110
```shell
52-
docker build --build-arg GIT_COMMIT=$(git log -1 --format=%h) -t quilibrium -t quilibrium:1.4.2 .
11+
docker build --build-arg GIT_COMMIT=$(git log -1 --format=%h) -t quilibrium -t quilibrium:1.4.16 .
5312
```
5413

55-
Use latest version instead of `1.4.2`.
56-
57-
> [!TIP]
58-
> You can use the `task build` command instead. See the [Task](#task) section below.
14+
Use latest version instead of `1.4.16`.
5915

60-
The image that is built is light and safe. It is based on Alpine Linux with the Quilibrium node binary, not the
16+
The image that is built is light and safe. It is based on Alpine Linux with the Quilibrium node binary, no
6117
source code, nor the Go development environment. The image also has the `grpcurl` tool that can be used to
6218
query the gRPC interface.
6319

6420
### Task
6521

66-
You can also use the [Task](https://taskfile.dev/) tool, it a simple build tool that takes care of extracting
67-
parameters, building the image and running the container. The tasks are all defined in [Taskfile.yaml](Taskfile.yaml).
22+
You can also use the [Task](https://taskfile.dev/) tool, it is a simple build tool that takes care of extracting
23+
parameters and building the image. The tasks are all defined in [Taskfile.yaml](Taskfile.yaml).
6824

6925
You can optionally create an `.env` file, in the same repository root folder to override specific parameters. Right now
7026
only one optional env var is supported and that is `QUILIBRIUM_IMAGE_NAME`, if you want to change the default
71-
image name from `quilibrium` to something else. If you are pushing your images to Github then you have to follow the
72-
Github naming convention and use a name like `ghcr.io/mscurtescu/ceremonyclient`.
27+
image name from `quilibrium` to something else. If you are pushing your images to GitHub then you have to follow the
28+
GitHub naming convention and use a name like `ghcr.io/mscurtescu/ceremonyclient`.
7329

74-
Bellow there are example interaction with `Task`.
30+
Bellow there are example interactions with `Task`.
7531

7632
The node version is extracted from [node/main.go](node/main.go). This version string is used to tag the image. The git
77-
repo, branch and commit are read throught the `git` command and depend on the current state of your working
78-
directory (one what branch and at what commit you are). These last three values are used to label the image.
33+
repo, branch and commit are read through the `git` command and depend on the current state of your working
34+
directory (on what branch and at what commit you are). These last three values are used to label the image.
7935

8036
List tasks:
8137
```shell
@@ -94,134 +50,4 @@ task build
9450

9551
## Run
9652

97-
You can run Quilibrium on the same machine where you built the image, from the same repository root
98-
folder where [docker-compose.yml](docker-compose.yml) is.
99-
100-
You can also copy `docker-compose.yml` to a new folder on a server and run it there. In this case you
101-
have to have a way to push your image to a Docker image repo and then pull that image on the server.
102-
Github offers such an image repo and a way to push and pull images using special authentication
103-
tokens. See
104-
[Working with the Container registry](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-container-registry).
105-
106-
Run Quilibrium in a container:
107-
```shell
108-
docker compose up -d
109-
```
110-
111-
> [!TIP]
112-
> You can alternatively use the `task up` command. See the [Task](#task-1) section above.
113-
114-
A `.config/` subfolder will be created under the current folder, this is mapped inside the container.
115-
Make sure you backup `config.yml` and `keys.yml`.
116-
117-
### Task
118-
119-
Similarly to building the image you can also use `Task`.
120-
121-
Start the container through docker compose:
122-
```shell
123-
task up
124-
```
125-
126-
Show the logs through docker compose:
127-
```shell
128-
task logs
129-
```
130-
131-
Drop into a shell inside the running container:
132-
```shell
133-
task shell
134-
```
135-
136-
Stop the running container(s):
137-
```shell
138-
task down
139-
```
140-
141-
Backup the critical configuration:
142-
```shell
143-
task backup
144-
```
145-
146-
The above command will create a `backup.tar.gz` archive in the current folder, you still have to copy this
147-
file from the server into a safe location. The command adds the `config.yml` and `keys.yml` files from
148-
the `.config/` subfolder to the archive, with the ownership of the current user.
149-
150-
### Resource management
151-
To ensure that your client performs optimally within a specific resource configuration, you can specify
152-
resource limits and reservations in the node configuration as illustrated below.
153-
154-
This configuration helps in deploying the client with controlled resource usage, such as CPU and memory,
155-
to avoid overconsumption of resources in your environment.
156-
157-
The [docker-compose.yml](docker-compose.yml) file already specifies resources following the currently
158-
recommended hardware requirements.
159-
160-
```yaml
161-
services:
162-
node:
163-
# Some other configuration sections here
164-
deploy:
165-
resources:
166-
limits:
167-
cpus: '4' # Maximum CPU count that the container can use
168-
memory: '16G' # Maximum memory that the container can use
169-
reservations:
170-
cpus: '2' # CPU count that the container initially requests
171-
memory: '8G' # Memory that the container initially request
172-
```
173-
174-
175-
### Customizing docker-compose.yml
176-
177-
If you want to change certain parameters in [docker-compose.yml](docker-compose.yml) it is better not
178-
to edit the file directly as new versions pushed through git would overwrite your changes. A more
179-
flexible solution is to create another file called `docker-compose.override.yml` right next to it
180-
and specifying the necessary overriding changes there.
181-
182-
For example:
183-
```yaml
184-
services:
185-
node:
186-
image: ghcr.io/mscurtescu/ceremonyclient
187-
restart: on-failure:7
188-
```
189-
190-
The above will override the image name and also the restart policy.
191-
192-
To check if your overrides are being picked up run the following command:
193-
```shell
194-
docker compose config
195-
```
196-
197-
This will output the merged and canonical compose file that will be used to run the container(s).
198-
199-
200-
## Interact with a running container
201-
202-
Drop into a shell inside a running container:
203-
```shell
204-
docker compose exec -it node sh
205-
```
206-
207-
Watch the logs:
208-
```shell
209-
docker compose logs -f
210-
```
211-
212-
Get the node related info (peer id, version, max frame and balance):
213-
```shell
214-
docker compose exec node node -node-info
215-
```
216-
217-
Run the DB console:
218-
```shell
219-
docker compose exec node node -db-console
220-
```
221-
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-
```
53+
In order to run a Quilibrium node using the docker image follow the instructions in the [docker](docker) subfolder.

Dockerfile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ LABEL org.opencontainers.image.revision=$GIT_COMMIT
3636

3737
COPY --from=build /go/bin/node /usr/local/bin
3838
COPY --from=build /go/bin/grpcurl /usr/local/bin
39-
COPY --from=build /opt/ceremonyclient/node/ceremony.json /root
40-
COPY --from=build /opt/ceremonyclient/node/retroactive_peers.json /root
4139
COPY --from=build /opt/ceremonyclient/client/qclient /usr/local/bin
4240

4341
WORKDIR /root

Taskfile.yaml

Lines changed: 0 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@ dotenv:
88
vars:
99
VERSION:
1010
sh: cat node/config/version.go | grep -A 1 "func GetVersion() \[\]byte {" | grep -Eo '0x[0-9a-fA-F]+' | xargs printf "%d.%d.%d"
11-
PROJECT_NAME: quilibrium
12-
SERVICE_NAME: node
1311
GIT_REPO:
1412
sh: git config --get remote.origin.url | sed 's/\.git$//'
1513
GIT_BRANCH:
@@ -46,54 +44,6 @@ tasks:
4644
${QUILIBRIUM_IMAGE_NAME:-quilibrium}:{{.VERSION}} \
4745
>/dev/null 2>/dev/null
4846
49-
up:
50-
desc: Run a new Quilibrium container, through docker compose.
51-
cmds:
52-
- docker compose up -d
53-
54-
down:
55-
desc: Take down the Quilibrium container, through docker compose.
56-
cmds:
57-
- docker compose down
58-
59-
shell:
60-
desc: Drop into a shell inside the running container.
61-
cmds:
62-
- docker compose exec -it {{.SERVICE_NAME}} sh
63-
64-
logs:
65-
desc: Print the logs of the running Quilibrium container.
66-
cmds:
67-
- docker compose logs -f
68-
69-
logs-folder:
70-
desc: Show where Docker stores the logs for the Quilibrium node. You need root permissions to access the folder.
71-
cmds:
72-
- "docker container inspect {{.PROJECT_NAME}}-{{.SERVICE_NAME}}-1 | grep LogPath | cut -d : -f 2 | cut -d '\"' -f 2 | xargs dirname"
73-
74-
backup:
75-
desc: Create a backup file with the critical configuration files.
76-
prompt: You will be prompted for root access. Make sure you verify the generated backup file. Continue?
77-
sources:
78-
- '.config/config.yml'
79-
- '.config/keys.yml'
80-
outputs:
81-
- 'backup.tar.gz'
82-
cmds:
83-
- |
84-
export TMP_DIR=$(mktemp -d)
85-
export TASK_DIR=$(pwd)
86-
sudo cp .config/config.yml $TMP_DIR
87-
sudo cp .config/keys.yml $TMP_DIR
88-
sudo chown $(whoami):$(id -gn) $TMP_DIR/*
89-
cd $TMP_DIR
90-
tar -czf $TASK_DIR/backup.tar.gz *
91-
cd $TASK_DIR
92-
sudo rm -rf $TMP_DIR
93-
echo "Backup saved to: backup.tar.gz"
94-
echo "Do not assume you have a backup unless you verify it!!!"
95-
silent: true
96-
9747
github:login:
9848
desc: Login to GitHub container registry.
9949
cmds:

docker/.env.example

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Use a custom docker image name
2+
# Default: quilibrium
3+
QUILIBRIUM_IMAGE_NAME=
4+
5+
# Use a custom P2P port.
6+
# Default: 8336
7+
QUILIBRIUM_P2P_PORT=
8+
9+
# Use a custom gRPC port.
10+
# Default: 8337
11+
QUILIBRIUM_GRPC_PORT=
12+
13+
# Use a custom REST port.
14+
# Default: 8338
15+
QUILIBRIUM_REST_PORT=
16+
17+
# The public DNS name or IP address for this Quilibrium node.
18+
NODE_PUBLIC_NAME=

0 commit comments

Comments
 (0)