600 /api/ requests a minute per client address (--requests-per-minute), 429 with Retry-After; static UI files and the node's own machine are exempt. The real client behind a reverse proxy is read from X-Forwarded-For only when the connection comes from a --trusted-proxy, taking the last entry that is not itself a trusted proxy. k8s: TRUSTED_PROXY in config.env (the private ranges) is passed as --trusted-proxy.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
A peer may hold 4 sync streams and open 1500 a minute; banned peers get none and cannot redial. A node keeps at most 100 unexpired listings per author (--max-per-author); updates, renewals and deletions of held ones still work. At most 16 inbound connections per public IP or IPv6 /64 (--max-conns-per-ip); local and private addresses are exempt.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
Per relaying peer and minute: over 1200 messages are dropped unread (no penalty); 20 invalid ones (bad signature, too little work, garbage) ban the peer for an hour, closing the connection and blacklisting it in gossip. Ignored messages (clock trouble, unknown listing) never count. In the simulator the attacker is cut off from every node it reached and honest listings still arrive 50 of 50; the message-flood scenario now uses a second attacker.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
About 4 s to mine one listing on 8 cores now that the miner is fast. Nodes of the old default refuse nothing from new ones, but a node at 24 refuses listings mined for 16, so the bootstrap node needs the new image to exchange listings with updated nodes.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
pow.Mine finds the smallest nonce, exactly what trying 0, 1, 2, ... finds, so every signed record and golden fixture stays the same. It saves the SHA-256 state after the whole blocks before the nonce, hashes only the number and what follows per attempt, and uses every core but one from difficulty 14 up. Listing, report, revocation and message mining use it; each re-checks the result before signing. One listing at difficulty 16 takes about 19 ms instead of about 2 s. docs/PROTOCOL.md says what proof-of-work can and cannot do against fast hardware.
allmende-load fills a data directory with signed invented listings for capacity tests and measures mining time (-mine-only).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
A sync with a peer logs one info line when it brought something new (new and updated counts, per region). Listings that arrive by gossip are summed up once a minute. At debug level every stored listing gets a line with its id, region, outcome and the peer it came from. A duplicate is not news and logs nothing. --log-level takes debug, info, warn or error.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
REGION (place names or geohashes, comma separated) is passed to the node by the StatefulSet script, which now builds its arguments with set -- so a region is optional and PUBLIC_HOST must be set. The warning for a --public node without a public address now says which case it is (no --announce, or one that is not reachable) and the flag that fixes it.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
Within the last 30 days the owner page offers it. The node signs a new certificate for the same device key (peer ID and listings stay), saves it, and signs again own listings that would outlive the old certificate. The phrase is used for one request and not kept; another identity's phrase and no-phrase identities are refused. Device.Current gives the certificate to sign with while a renewal happens.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
The simulator showed libp2p's default cap (about 190 on 16 GB) stranding newcomers
on a bootstrap node: 12 of 200 and 212 of 400 nodes never found a peer. As
shipped, the same networks now form and deliver 100% up to 600 nodes.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
Findings: default libp2p connection limits strand nodes on a bootstrap node beyond ~190 peers, there is no peer scoring, and newcomers cannot find their region without DHT servers when their remembered peers are elsewhere. Documented in docs/PROTOCOL.md and SPECS.md.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
A listing page says when the node hides the listing and who flagged it. A
visitor can tip off the operator (proof-of-work, nothing is hidden by it); the
signed-in operator can sign or withdraw a report from the page and works
through the tips at #/mine/reports. e2e covers the real binaries.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
A report is signed by a node operator (device key and certificate) and
gossiped on one global topic. Each node decides whose reports count: the
operator's own report hides a listing on that node, one trusted report of
illegal content hides it, and --hide-after trusted scam reports hide it
(--trust-reporter names others). Hidden listings stay stored and reachable.
Visitors can tip the node's operator off with a proof-of-work request that
hides nothing.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
Flooding a listing's inbox now gets dearer with every envelope. Relays ask
more proof-of-work from half full on, the node tells browsers the current
price, and the browser mines to it (or says the listing is too busy).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
SIGINT, SIGTERM and SIGHUP all shut the node down in order (SIGTERM is what a
Kubernetes pod termination sends). A second signal, or 20 seconds (below the
30 s Kubernetes grants), stops the process at once, so a stuck shutdown cannot
hang.
The binary knows its version (allmende version, and the 'node running' log
line); the image is built with the commit as version and 'make image' pushes it
tagged with that commit, refusing a dirty tree.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
For bootstrap nodes and other unattended setups: nothing is shown or logged,
and the data directory is marked so later messages do not point to
'allmende recover', which cannot work. The identity lasts the certificate
lifetime (a year) and then has to be replaced; the node says so.
The Kubernetes StatefulSet now initialises itself on first start with it,
so no manual exec step is left.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
The link holds the admin token. Where the terminal is a log (containers) it
would end up in log storage; the notice then only says where the token file
is. The Kubernetes manifest uses it.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
k8s/base (kustomize): StatefulSet with a volume, p2p LoadBalancer for 4001
TCP+UDP, ClusterIP for the UI, optional ingress; k8s/overlays/nodeport for
clusters without a load balancer. The pod waits for 'allmende init' so the
recovery phrase never goes to a log.
--announce makes a node that sits behind a router or in a container announce
the address others can dial (e.g. /dns4/name/tcp/4001), so a bootstrap node
behind a port forward works, and the DNS records it prints name the host.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
Opt-in, as one line of words. Uses wl-copy, xclip, xsel, pbcopy or clip.exe,
and falls back to asking the terminal (OSC 52), which works over SSH. The
output says how it was copied and to clear the clipboard afterwards.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
--region takes a place name as well as a code ("Bonn", "Köln", "cologne",
"name:dub" to force a name that looks like a code). The node uses the same
GeoNames list as the browser (internal/places), follows the place's cell plus
any cell within 40 km, and prints what each name became.
The node reminds the owner on its terminal, once a day per listing, about
every listing with 5 days or less left (the UI marks the same range). The
sign-in token is never in the line.
scripts/e2e/ui.ts drives the real bundle in jsdom against real nodes: a buyer
writes from a listing page, the owner reads and answers in their own page and
the buyer's page shows the verified answer; a node with no region gets its
first one by place name in the browser and keeps it over a restart. e2e.sh
also checks --region by name and the reminder, and keeps its scratch files in
the checkout's .tmp.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
A node now starts without any region (it only helps others connect, and
prints a hint). The owner's sign-in link leads straight to the Regions page
when none is followed, visitors get a notice instead of an empty search, and
status always lists regions as an array.
The Docker image no longer pins Bonn, the NixOS module no longer requires
regions, and the VM test now starts without any, chooses the first region
over the API and checks it survives a restart. README and the init hint
follow.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
The p2p node can now add and drop regions while running (SetRegions):
topics, validators, subscriptions and per-region peer discovery start and
stop with them, and a newly followed region catches up by sync.
PUT /api/v1/regions (owner token) applies a change and the node saves it in
regions.json, which wins over --region from then on. The owner's browser
gets a "Regions" page: search a place by name (GeoNames cities, offline,
CC BY 4.0), follow its cell plus any cell within about 40 km.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
- Bootstrap: built-in /dnsaddr/allmende.stinnesbeck.com (TXT records at
_dnsaddr.<name>), resolved at every redial with the last good answer kept;
--bootstrap takes /p2p/ or /dnsaddr/ entries, --no-default-bootstrap drops
the built-in one. Stopping never waits for a stuck resolver.
- Remembered peers in peers.json (saved every 5 min and on shutdown, redialled
at the next start)
- Private Kademlia DHT (/allmende prefix), advertised and looked up per region
with quick first attempts and a backoff; --no-dht turns it off
- NAT traversal: port mapping, hole punching, AutoRelay through bootstrap nodes
- --public: DHT server and relay for a bootstrap node; prints the TXT records
- Docker, NixOS module (public, defaultBootstrap, QUIC/UDP) and docs updated
- e2e: bootstrap node scenario, seed cache restart, and polling that really polls
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The node now checks for new messages every 10 s in the background (before,
only when the web UI asked), and Inbox.Collect reports newly filed visible
messages through OnArrivals. The CLI logs one line per conversation with the
listing title and a link to it, never the buyer's text. Hidden messages are not
announced, a backlog is capped at 5 lines, and a lock stops a background check
and a UI request from filing the same message twice.
The e2e checks that node A announces the message before its API is called.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- scripts/e2e.sh (+ scripts/e2e/*.ts): the two-node end-to-end test, now
self-contained and cleaning up after itself; `make e2e`, part of `make check`
- Dockerfile/.dockerignore: static Go build in a non-root alpine image, data in
/data, defaults to region u1j; `make docker`
- flake.nix, nix/: package (buildGoModule), dev shell, NixOS module
services.allmende (hardened systemd unit that waits for `allmende-admin init`),
and a NixOS VM test run by `nix flake check`
- README: running a node with Docker and NixOS
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Conversations and the owner screen refreshed every 20 s and 30 s. A shared
keepFresh helper now checks every 8 s while the tab is visible, pauses when
it is hidden, catches up at once when it returns, never overlaps runs, and
stops when the screen is gone or the owner token is. The latter also stops
the sign-in form being redrawn under someone typing.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Ctrl+Enter (Cmd+Enter on a Mac) submits the buyer's and the owner's message
boxes through the normal form, so the usual checks apply. Plain Enter still
adds a line. The empty box hints at the shortcut. Not added to the publish
description or the address-release note, where it could submit by accident.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>