@@ -16,14 +16,14 @@ slug: "/run_katzenpost_mixnode_docker/"
1616
1717* Access to the ` namenlos ` git repo
1818
19- ## Preparing host filesystem
19+ ## Preparing the host filesystem
2020
21- mkdir katzenpost-server
22- cd katzenpost-server
21+ mkdir katzenpost-mix
22+ cd katzenpost-mix
2323 mkdir {conf,data}
2424 chmod 700 data
2525
26- All further actions are performed from the ` katzenpost-server ` directory.
26+ All further actions are performed from the ` katzenpost-mix ` directory.
2727
2828## Building the Docker image
2929
@@ -64,23 +64,44 @@ All further actions are performed from the `katzenpost-server` directory.
6464* Build Docker image:
6565
6666 ```
67- docker build -t katzenpost/server --build-arg uid=$(id -u) --build-arg gid=$(id -g) .
67+ docker build -t katzenpost/mix --build-arg uid=$(id -u) --build-arg gid=$(id -g) .
6868 ```
6969
70- * Create `run .sh` to run the server (adjust to your port) and make it executable :
70+ * Create `service .sh` (modify to match your port) to manage the server :
7171
7272 ```
7373 #!/bin/bash
7474
75- docker run -d --restart=always \
76- --name katzenpost-server -h kp-server \
75+ CMD=${1:-start}
76+ case ${CMD} in
77+ genkeys)
78+ MODE="-ti --rm"
79+ EXEC="/usr/bin/server -g"
80+ ;;
81+ start)
82+ MODE="-d --restart=unless-stopped"
83+ EXEC=""
84+ ;;
85+ stop)
86+ docker stop katzenpost-mix
87+ docker rm katzenpost-mix
88+ exit
89+ ;;
90+ *)
91+ echo "unknown command"
92+ exit 1
93+ ;;
94+ esac
95+
96+ docker run ${MODE} \
97+ --name katzenpost-mix -h katzenpost-mix \
7798 -p 0.0.0.0:<port>:8181 \
7899 -v $(pwd)/conf:/conf \
79- -v $(pwd)/data:/var/lib/pq- katzenpost-mixserver \
80- katzenpost/server
100+ -v $(pwd)/data:/var/lib/katzenpost \
101+ katzenpost/mix ${EXEC}
81102 ```
82103
83- Always run this script while in the `katzenpost-server ` directory.
104+ Always run this script while in the `katzenpost-mix ` directory.
84105
85106## Creating a configuration file
86107
@@ -91,9 +112,9 @@ All further actions are performed from the `katzenpost-server` directory.
91112 Identifier = "<yourname>"
92113 PKISignatureScheme = "Ed25519 Sphincs+"
93114 WireKEM = "KYBER768-X25519"
94- Addresses = [ "tcp://<public-ipv4>:<port>", "tcp://<public-ipv6>:<port>" ]
95- BindAddresses = [ "tcp://127 .0.0.1:8181", "tcp://[::1] :8181" ]
96- DataDir = "/var/lib/pq- katzenpost-mixserver "
115+ Addresses = [ "tcp://<public-ipv4>:<port>" ]
116+ BindAddresses = [ "tcp://0 .0.0.0 :8181" ]
117+ DataDir = "/var/lib/katzenpost"
97118 IsGatewayNode = false
98119 IsServiceNode = false
99120
@@ -104,30 +125,23 @@ All further actions are performed from the `katzenpost-server` directory.
104125
105126 ```
106127
107- * Assemble the configuration file `conf/katzenpost.toml`:
128+ * Build the configuration file `conf/katzenpost.toml`:
129+
130+ 1. In the `namenlos` repo, change into the `configs` directory and run `make`.
131+
132+ 2. Copy the generated configuration file:
108133
109134 ```
110- cat \
111- <namelos.repo>/configs/SSOT/mixes/<yourname>-pq-mixserver.toml \ <namelos.repo>/configs/pki.toml \
112- <namelos.repo>/configs/SSOT/mixserver.toml \
113- <namelos.repo>/configs/SSOT/sphinx.toml \
114- > conf/katzenpost.toml
135+ cp <namelos.repo>/configs/<yourname>-pq-mixserver.toml conf/katzenpost.toml
115136 ```
116137
117138## Generating and extracting keys
118139
119- * Run the server for the first time :
140+ * Run the server to generate the keys :
120141
121142 ```
122- ./run .sh
143+ ./service .sh genkeys
123144 ```
124- * Monitor execution:
125-
126- ```
127- docker logs -f katzenpost-server
128- ```
129-
130- Once the server has started sucessfully, the Docker container can be stopped and removed.
131145
132146* Check that keys (`*.pem`) have been created in the `data/` directory and copy the public identity key to the `namenlos` repo:
133147
@@ -144,7 +158,8 @@ All further actions are performed from the `katzenpost-server` directory.
144158 git push
145159 ```
146160
147- ## Running the server
161+ ## Starting/stopping the server
162+
163+ cd katzenpost-mix
164+ ./service.sh [start|stop]
148165
149- cd katzenpost-server
150- ./run.sh
0 commit comments