Skip to content

Network Commands

The rotifer network commands run an experimental peer-to-peer gene network. As of v0.9.0 the published CLI ships a real libp2p node that runs as a background daemon: nodes on the same LAN connect via a manually supplied --bootstrap address and propagate gene announcements over GossipSub.

Show the P2P daemon status.

Terminal window
rotifer network status

Example (daemon running):

Terminal window
$ rotifer network status
── P2P Network Status ──
Status: Running
PeerId: 12D3KooWA1b2c3d4e5f6...
Listening: /ip4/192.168.0.103/tcp/9878/p2p/12D3KooWA1b2c3d4e5f6...
Discovered peers: 2

When the daemon is not running, the command shows the configured listen port and bootstrap-peer count, and hints to start it.


Start the P2P node as a background daemon. Requires the native libp2p addon.

Terminal window
rotifer network start [--port <port>] [--host <addr>] [--bootstrap <addr...>]

Flags:

FlagDefaultDescription
-p, --port <port>9878Listen port
-H, --host <addr>127.0.0.1Listen interface — 127.0.0.1 (loopback only) or 0.0.0.0 (reachable from other machines)
-b, --bootstrap <addr...>from configBootstrap peer multiaddr(s) to dial on start; overrides the config file

Example:

Terminal window
$ rotifer network start --host 0.0.0.0 --port 9878
── Starting P2P Daemon ──
PeerId: 12D3KooWA1b2c3d4e5f6...
Listen host: 0.0.0.0
PID: 48213
Bootstrap peers: 0
P2P daemon running in the background.
'rotifer network status' shows the reachable multiaddr give it to other nodes as --bootstrap

The daemon runs in the background; use rotifer network status to inspect it and rotifer network stop to shut it down. Configuration is saved to ~/.rotifer/network.json.


Stop the running P2P daemon.

Terminal window
rotifer network stop

List the peers the running daemon has discovered. Requires the daemon to be running.

Terminal window
rotifer network peers

Example:

Terminal window
$ rotifer network peers
── Discovered Peers ──
#1 /ip4/192.168.0.107/tcp/9878/p2p/12D3KooWB7c8d9...
1 peer(s) discovered

If no peers have connected yet, the command reports No peers discovered yet. In v0.9.0 peers join via manual --bootstrap; automatic discovery is a v0.9.1 milestone.


Show gene announcements this node has received from connected peers. Requires the daemon to be running.

Terminal window
rotifer network received

Example:

Terminal window
$ rotifer network received
── Received Gene Announcements ──
grammar-checker@1.0.0 writing.grammar · Native · from 12D3KooWB7c8d9…
1 announcement(s) received

A peer must announce a gene while this node is connected and subscribed for it to appear here.


Announce a local gene’s metadata through the running daemon. Reads genes/<gene-name>/phenotype.json from the current project. Requires the daemon to be running.

Terminal window
rotifer network announce <gene-name>

Example:

Terminal window
$ rotifer network announce grammar-checker
── Gene Announcement ──
Announced 'grammar-checker' to the network

Connected peers that are subscribed will list the announcement under rotifer network received.


Terminal window
rotifer network search <query>

P2P metadata search over the DHT is not yet available — it is part of the v0.9.1 milestone. The command points you to Cloud-based discovery:

Terminal window
$ rotifer network search "code formatter"
── P2P Gene Search ──
Preparing P2P search for: "code formatter"
P2P metadata search (DHT) is not yet available.
Use 'rotifer search' for Cloud-based gene discovery.

To watch a gene propagate across machines on the same network:

  1. On the seed machine, bind a reachable interface: rotifer network start --host 0.0.0.0. Note the multiaddr from rotifer network status.
  2. On each other machine, join the seed: rotifer network start --bootstrap /ip4/<seed-ip>/tcp/9878/p2p/<seed-PeerId>.
  3. Announce a gene on any machine: rotifer network announce <gene-name>.
  4. On the other machines, rotifer network received lists it.

LAN reachability relies on manual --bootstrap. Automatic discovery (mDNS) and reaching nodes across the public internet (NAT traversal, relays) are later milestones.


Network configuration is stored in ~/.rotifer/network.json:

{
"node_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"listen_port": 9878,
"bootstrap_peers": [
"/dns4/bootstrap.rotifer.dev/tcp/9878"
],
"enabled": false
}

node_id is a local config identifier; the libp2p PeerId shown by status / start is derived at runtime and is what other nodes use in a --bootstrap multiaddr.


CapabilityStatus
Automatic peer discovery (mDNS, LAN)v0.9.1
Wide-area discovery + search via Kademlia DHTv0.9.1
Reaching nodes across the public internet (NAT traversal, relays)v0.9.1

Until then, gene discovery and sharing run through the Cloud Registry (rotifer search, rotifer publish).