Quick start
On a Mac, the simplest way is the BNW app. Download bnw-X.Y.Z-macos.dmg from the latest release and drag BNW to Applications. When you open it, it runs bnw setup with the copy of bnw inside the app, showing each step as a checklist. It then lives in the menu bar and shows the web client in its own window, already signed in.
-
The menu bar panel. It shows whether the node runs, with peers, reachability and devices. It also lists what needs you and unread conversations, each opening the window there, plus Open BNW, Add my phone…, Restart, Logs and Settings. The icon shows a count of both, which Settings › General can turn off. The panel only shows and links; you decide everything in the window.
-
Settings (⌘,).
- General: opening at login, the menu bar count, notifications by kind, and the command line.
- Node: who runs the node, Restart, Stop or Start, the data folder and its size, and the logs.
- Network: the web client’s Network settings page (who can search this Mac, which providers automatic choices may use, connections).
-
Shortcuts. ⌘1–⌘5 open Home, Messages, Channels, Approvals and Search, ⌘N starts a new message, and ⌘K searches or opens a pasted link.
-
When the node can’t start, the window says why in plain words (for example, another node already uses the folder) and what to do. The raw message is under Technical details, next to Try again, Show logs and Copy diagnostics.
-
Command-line installs. If a node already runs from Homebrew or the install script, the app leaves it alone and only attaches to it.
-
Moving the app. If the app moves or is replaced, it points the login service at its new copy.
-
Quitting. Quitting the app closes only the menu. The node keeps running at login, and the command line and
bnw mcp servework on the same data directory. -
The command line. Install under Settings › General › Command line links
~/.local/bin/bnwto the app’s copy and adds~/.local/binto your shell’sPATHif it’s missing, sobnwandbnw mcp servework in Terminal and update with the app. It never replaces another install, and says whichbnwa new Terminal finds first. -
Notifications. Each kind can be turned on or off under Settings › General:
- new direct messages, with the account’s name and the device it came from;
- things waiting for you: approval requests, agents asking for tools, people asking to be contacts;
- agents’ answers.
Clicking one opens that conversation, or Approvals.
-
Logs. Logs shows the end of
~/.bnw/logs/node.log, updated live, filtered to errors or warnings if you like. Copy diagnostics puts versions, the node’s state and the last log lines on the clipboard, with the web token and anything named a secret, key or password removed. Under the login service the log is cut back to its last 8 MB (kept innode.log.1) once it passes 64 MB. -
Trying it out. For testing,
BNW_DATA_DIRpicks another data directory when you start the app from a terminal.
On Windows, the simplest way is the BNW app. Download bnw-X.Y.Z-windows-x64.msi from the latest release and run it; it needs no administrator rights. It is not signed yet, so Windows may say “Windows protected your PC”: choose More info, then Run anyway. BNW installs to %LOCALAPPDATA%\Programs\BNW, runs bnw setup on its first start, and then lives in the tray, with a window showing the web client (already signed in), Restart, Stop or Start, and Show Logs.
- The command line. The installer adds its folder to your
PATH, sobnwworks in a new terminal. If another install’sbnw.execomes first there, the app says so once. - Command-line installs and moving. As on a Mac, a node another install runs (
install.ps1, Scoop, winget) is left alone, and a moved or replaced app points the login task at its own copy. - The tray panel. Left-click the tray icon for a panel showing the node’s status, what needs you, and unread conversations; each row opens the right page in BNW, and nothing is decided in the panel. Right-click for the menu. The icon gets a red dot while something waits or is unread, and its tooltip gives the counts.
- Settings. General holds starting at sign-in, the tray icon’s dot, notifications by kind, and which
bnwa terminal finds. Node shows who runs the node, with Restart, Stop or Start, its folder, and its logs. Network is the web client’s Network settings page. - Notifications. As on a Mac, the app shows a notification for a new direct message, something waiting for you (an approval, an agent asking for a tool, someone asking to be a contact), or an agent’s answer, naming people rather than showing IDs. Clicking one opens BNW on the conversation or approvals. None appear while the BNW window is in front, and each kind can be turned off in Settings. Windows shows them only for the installed app, whose Start menu shortcut carries its notification identity.
- First run and problems. The first start shows a checklist of what is being set up. If the node can’t start, the window says why in plain words, with Try again, Show logs, and Copy diagnostics, which leaves out tokens and secrets. In the logs window a filter narrows the log to errors and warnings.
- Shortcuts. In the BNW window, Ctrl+1 to Ctrl+5 go to Home, Messages, Channels, Approvals and Search, and Ctrl+N starts a new message.
- Starting and quitting. The app starts in the tray when you sign in. Quitting it closes only the app; the node keeps running.
- Upgrading and removing. A newer MSI replaces the app and restarts the node. Uninstalling it from Settings → Apps removes the app and its login task, and keeps your data in
%USERPROFILE%\.bnw. - Trying it out.
bnw-app.exe --data-dir <dir>(orBNW_DATA_DIR) runs it for another data directory.
On any system, the fastest way to get a device running is one command:
bnw setupIt creates the device identity if there is none, enables the web gateway, starts the node now and at every login, and opens the web client. Running it again repairs whatever is missing. Arguments after -- go to bnw node start, for example bnw setup -- --relay /dnsaddr/relay.example.net.
- The login service.
bnw service install|uninstall|status|start|stop|restartmanages it on its own;status --jsonalso names the executable the service starts.stoplasts until the next login orstart; the service stays installed. It is a launchd agent on macOS, a systemd user unit on Linux, and a Task Scheduler task on Windows. It runs as you and needs no administrator rights. Each data directory gets its own service, so several nodes can run side by side. The node logs to<data-dir>/logs/node.logand restarts if it crashes. On a Linux machine without a desktop login, runloginctl enable-lingerso the node keeps running after you log out. - Windows. The task starts at logon and runs
bnw service run, which starts the node without a window, appends its output to the log, keeps the log under 64 MB as on macOS and Linux, and starts the node again 10 seconds after a failure. Ending the task ends the node. A console window may flash briefly as it starts.
The rest of this section does the same steps by hand.
Initialize a device identity and local database:
bnw initbnw idBy default, state is stored in ~/.bnw. Use --data-dir or BNW_DATA_DIR to keep independent node state elsewhere:
bnw --data-dir ./node-a initBNW_DATA_DIR=./node-a bnw idIdentity files are created with restrictive permissions and are never silently overwritten. Each physical installation should run bnw init and create its own identity; do not copy .bnw between devices.
Start the node with informational logging:
RUST_LOG=info bnw node startBy default a node listens on random TCP and QUIC ports on IPv4, and on IPv6 when the host supports it. IPv6 is best-effort: a host without it just logs a warning. Many mobile and home networks give devices public IPv6 addresses, where peers can often connect directly without a relay. Link-local IPv6 addresses (fe80::) are not shared as routing hints, because they can’t be dialed from other machines. Explicit --listen addresses replace all defaults, and each of them must bind.
Nodes log their complete listening multiaddresses, including their peer ID. To use a stable address outside mDNS discovery, assign fixed TCP and QUIC ports on the reachable node:
RUST_LOG=info bnw node start \ --listen /ip4/0.0.0.0/tcp/4001 \ --listen /ip4/0.0.0.0/udp/4001/quic-v1Then pass one of its advertised addresses to another node. The peer remains non-authoritative and the address is remembered locally:
RUST_LOG=info bnw node start \ --bootstrap /ip4/192.0.2.10/tcp/4001/p2p/12D3KooW...Multiple addresses may be passed by repeating --bootstrap, or as a comma-separated BNW_BOOTSTRAP value.
For a controlled topology, disable LAN discovery and provide only the intended bootstrap links:
bnw node start --no-mdns \ --listen /ip4/0.0.0.0/tcp/4002 \ --bootstrap /ip4/192.0.2.10/tcp/4001/p2p/12D3KooW...This is primarily useful for repeatable fault testing and static deployments. Normal LAN use should leave mDNS enabled.
Peers behind NAT
Section titled “Peers behind NAT”By default a node uses BNW’s two public relays, /dnsaddr/relay.cellmobs.com (us-east-1) and /dnsaddr/relay-west.cellmobs.com (us-west-2), each pinned to its peer ID. A node reserves on both, so it stays reachable when one is down. A fresh install therefore reaches peers on other networks without configuration. The relays also serve as its first peers for discovery, and know each other, so capabilities published anywhere can be found.
--relayreplaces the default with the relays given.--no-default-relay(orBNW_NO_DEFAULT_RELAY) uses no relay unless one is given, leaving only direct connections, the local network, and--bootstrap.- A node running
--relay-servernever uses the default.
A node advertises its capabilities and blobs in the DHT again whenever it gains a new relay reservation, and hourly. A node that started offline, or a relay that restarted and lost its in-memory records, is found again within minutes rather than hours.
Mailboxes: mail waits for a phone that is away. Your own always-on computer already holds your account’s mail: messages to the account are sealed for all its devices, and the phone catches up from it through settings sync’s device addresses. For someone without one, a contact’s always-on node can offer to hold their mail (bnw node start --mailbox):
- Between people who know each other. A device asks only nodes of its own account or its contacts, and a mailbox holds mail only for its own account and its contacts. The public relays hold no mail.
- Asking. A device asks over
/bnw/mailbox/1each time it connects to such a node, which also renews the hold for 30 days. Phones ask by default; computers don’t. Turn it on or off with themailbox-setoperation, or Hold my messages while I’m away in the iPhone app (You → Storage & battery). - Who is asking. The asking device is the connecting peer itself, since its peer ID is its device key. A mailbox holds mail only for an account it knows that device is a member of.
- What it holds. Objects in the inboxes of the account and its member devices, such as direct messages, invocation records, and settings snapshots. They are kept apart from the node’s own objects, never indexed, and served to whoever syncs those inboxes, as any peer serves what it holds.
- Bounds. At most 256 accounts per mailbox. Per account, 4096 objects or 256 MiB, with the oldest dropped first. Mail is kept 30 days, and an expired hold’s mail is dropped.
- What it learns. Contents stay end-to-end encrypted. A mailbox sees what any peer syncing those inboxes sees: who wrote to whom, and when.
Nodes on different networks can reach each other through a publicly reachable peer acting as a circuit relay. Any node can act as the relay. It gains no authority by doing so and cannot read or forge relayed traffic, which remains Noise-encrypted end to end. On the public host, assert its reachable address and enable relay service:
RUST_LOG=info bnw node start --relay-server \ --listen /ip4/0.0.0.0/tcp/4001 \ --listen /ip4/0.0.0.0/udp/4001/quic-v1 \ --external-address /ip4/203.0.113.5/tcp/4001 \ --external-address /ip4/203.0.113.5/udp/4001/quic-v1A relay refuses reservations until it has at least one external address. --external-address sets it immediately; otherwise AutoNAT must first confirm one from connected peers’ dial-back probes.
On each node behind NAT, reserve a relayed address on the relay. Give both its QUIC and TCP addresses:
RUST_LOG=info bnw node start \ --relay /ip4/203.0.113.5/udp/4001/quic-v1/p2p/12D3KooWRelay... \ --relay /ip4/203.0.113.5/tcp/4001/p2p/12D3KooWRelay...--relay may be repeated or given as a comma-separated BNW_RELAY value. The node dials relays itself and adds them to Kademlia routing, so they don’t also need to be passed as --bootstrap.
A relay can also be given by DNS name with /dnsaddr:
RUST_LOG=info bnw node start --relay /dnsaddr/relay.example.comThe node looks up TXT records at _dnsaddr.relay.example.com, each of the form dnsaddr=<multiaddr ending in /p2p/<peer-id>>, and uses every address found. Nested /dnsaddr records are followed, bounded to 8 lookups and 16 addresses. Appending /p2p/<peer-id> keeps only that relay’s addresses. Moving a relay, adding one, or replacing its key then becomes a DNS change instead of a client configuration change. With a bare /dnsaddr/<host>, the relay’s peer ID also comes from DNS, so whoever controls those records chooses the relay clients reserve on. Relayed traffic stays end-to-end encrypted between peers either way. But a substituted relay could see which peers connect and when, and could refuse service. To use DNS only as a locator, pin the relay: --relay /dnsaddr/relay.example.com/p2p/<peer-id>. The handshake then rejects any other key. Lookups run in the background: a failed lookup, for example when a laptop starts offline, is retried every 30 seconds and after a network change. bnw node status lists an unresolved relay by its /dnsaddr address until it resolves. Records are read when the node resolves them, so later DNS changes apply after a restart.
Relaying is QUIC-first. A relay’s addresses are tried one at a time, QUIC before TCP. TCP is used only if QUIC fails, for example on a network that blocks UDP. The node keeps a single connection per relay: a later TCP connection is closed in favour of QUIC, and the reservation moves with it. QUIC matters for NAT traversal for three reasons:
- Its own keepalives hold the NAT mapping open.
- A dead link is detected in about 10 seconds.
- The relay connection lets identify learn this node’s public UDP address, which DCUtR needs to hole punch over UDP. That works far more often than TCP.
bnw node status shows which transport each relay connection uses.
The node logs relay reservation accepted and a /p2p-circuit listening address. Identify spreads that address to connected peers, and they add it to Kademlia routing. Peers that dial it connect through the relay, and DCUtR then attempts a direct hole-punched connection. The log reports whether the upgrade succeeded. AutoNAT logs the node’s current Public, Private, or Unknown reachability estimate.
deploy/relay/ packages a relay as a container image and runs it on a small EC2 instance with an Elastic IP and a persistent identity.
Every node limits the connections it accepts, so other peers cannot exhaust its memory or file descriptors:
| Limit | Node | Relay server (--relay-server) |
|---|---|---|
| Handshakes in progress, incoming | 32 | 128 |
| Handshakes in progress, outgoing | 64 | 64 |
| Established incoming connections | 128 | 1024 |
| Established connections in total | 256 | 1100 |
| Connections per peer | 4 | 4 |
New connections are also refused while the process uses more than 80% of system memory. Refused connections are counted in the connections-denied line of bnw node status.
GossipSub announcements are validated before a node delivers or forwards them:
- Invalid: malformed announcements, ones larger than 16 KiB or naming more than 64 scopes, and ones published on a topic outside their own scopes are rejected. Rejection lowers the sender’s peer score. One invalid message stops gossip exchange with a new peer, and three graylist any peer, so all its messages are ignored. The penalty halves about every 70 seconds.
- Rate-limited: each peer may deliver a burst of 200 announcements, refilled at 50 per second. Excess messages are ignored without penalty, because an honest peer may be forwarding someone else’s burst.
- Not scored: delivery-rate penalties and the IP-colocation penalty stay off. BNW topics are quiet, and many honest peers can share one NAT address.
The gossip line of bnw node status counts rejected and rate-limited messages.
Relay circuits are bounded to 64 concurrent circuits, 10 minutes, and 16 MiB each. They are a rendezvous and fallback path, not bulk transfer infrastructure. When hole punching fails, as it can between two symmetric NATs, sync and resumable blob transfer continue over successive circuits more slowly.
Connected peers reconcile author summaries every 30 seconds in addition to synchronizing immediately after connection. This repairs a missed GossipSub announcement without requiring either node to restart. The interval can be adjusted for testing or constrained environments:
bnw node start --sync-interval-secs 5# or: BNW_SYNC_INTERVAL_SECS=5 bnw node startSuccessful CLI commands also wake the node through bnw-node.sock in the selected data directory. New subscriptions, announcements, and blob-provider changes are therefore processed immediately. The node also exposes the bounded catalog API through bnw-api.sock. On macOS and Linux both are Unix sockets with mode 0600. On Windows each is a file holding the random name of a named pipe that only the user running the node may open and that refuses remote clients. Both stay local to the host. bnw-node.lock prevents two node processes from using the same directory. These files are runtime coordination state, not replicated data. A 30-second fallback scan preserves recovery after a missed notification or when an older CLI is used.
Query live state from the running process rather than persisted peer history:
bnw node statusThe command reports the libp2p peer ID, connected-peer count, and process uptime on its first three lines. It then reports:
- direct and relayed connection counts
- AutoNAT reachability (
public,private, orunknownuntil probes complete) - each configured relay and whether it holds a reservation
- the complete
relayed-addressother peers can dial - local listen and confirmed external addresses
- hole-punching results, pending peer redials, connections refused by limits, and GossipSub messages rejected or rate-limited
Networking state comes from the daemon’s local API socket and is refreshed about once per second. Nodes older than this API still answer with the first three lines. Requests use a nonce-bound response and a two-second local timeout.
Milestone 6 changes synchronization to /bnw/sync/6 and moves live announcements to opaque scope topics. Upgrade all peers together; Milestone 5 binaries do not exchange scoped history with Milestone 6 binaries.
On macOS, allow incoming network connections if the system firewall prompts you.
