From 0b3ead4b238c88fea234fcaf873194d3e94191b5 Mon Sep 17 00:00:00 2001 From: Nils Stinnesbeck Date: Thu, 19 Nov 2026 00:24:28 +0100 Subject: [PATCH] k8s: DIFFICULTY=24 in config.env, passed as --difficulty Co-Authored-By: Claude Sonnet 5.5 Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw --- k8s/README.md | 4 +++- k8s/base/config.env | 7 +++++++ k8s/base/statefulset.yaml | 1 + 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/k8s/README.md b/k8s/README.md index 9c009d3..89f7528 100644 --- a/k8s/README.md +++ b/k8s/README.md @@ -38,7 +38,9 @@ so: ``` 2. **Name.** Edit `base/config.env` (`PUBLIC_HOST`, and `PUBLIC_PORT` if the router cannot forward 4001 to 4001; `REGION` if the node should keep - listings for a region). + listings for a region). `DIFFICULTY` (24) is the network's proof-of-work and + must match every other node: at another value this node refuses their + listings and they refuse its. Moving from the old 16 needs the new image too. 3. **Apply.** ``` kubectl apply -k k8s/base # with a LoadBalancer (MetalLB, kube-vip, ...) diff --git a/k8s/base/config.env b/k8s/base/config.env index 8547e48..0f3868a 100644 --- a/k8s/base/config.env +++ b/k8s/base/config.env @@ -15,3 +15,10 @@ PUBLIC_PORT=4001 # this again). Changing this file restarts the pod, because the ConfigMap name # changes with its content. REGION= + +# The proof-of-work (leading zero bits) this node requires of listings, reports +# and revocations. It must equal the network's: a node refuses what carries +# less than its own value, so a node at 24 and one at 16 exchange no listings. +# The default of the binary is 24; it is written here so it is visible, and so +# a later change of the network's value is one edit in one place. +DIFFICULTY=24 diff --git a/k8s/base/statefulset.yaml b/k8s/base/statefulset.yaml index 1a3bd6a..94edf00 100644 --- a/k8s/base/statefulset.yaml +++ b/k8s/base/statefulset.yaml @@ -50,6 +50,7 @@ spec: --no-default-bootstrap \ --no-mdns \ --no-login-link \ + --difficulty "${DIFFICULTY:-24}" \ --http 0.0.0.0:8080 \ --listen /ip4/0.0.0.0/tcp/4001 \ --listen /ip4/0.0.0.0/udp/4001/quic-v1 \