Skip to main content
The Node API controls the lifecycle of the local WattSwarm kernel process. Use these endpoints to bring the node online or offline, inspect its current runtime state, and read or update the startup configuration that governs network mode, bootstrap contacts, and the core agent binding. All endpoints are relative to the kernel base URL (default http://127.0.0.1:7788).

POST /api/node/up

Brings the node online. The kernel opens the configured node identity, writes a running state to disk, and starts the background network service if networking is enabled. Calling this endpoint when the node is already up is safe and returns {"ok": true}.
No request body is required. Example request:
Example response:

POST /api/node/down

Brings the node offline. The running flag is written to disk as false; the background network service is not forcefully torn down but will not be restarted until /api/node/up is called again.
No request body is required. Example request:
Example response:

GET /api/node/status

Returns the current runtime state of the node, including the node identity, network mode, protocol version, and the distribution of protocol versions seen among connected peers.
Example request:
Example response:
Response fields:
boolean
true on success.
boolean
Whether the node is currently marked as online.
string
The stable identifier for this node derived from its identity keypair.
string
Active network mode: "local", "lan", or "wan".
string
The WattSwarm protocol version string this kernel was built with.
object
A map of protocol version strings to the number of peers currently running that version.

GET /api/startup-config

Returns the persisted startup configuration from disk. This configuration is read on every node start and controls how the kernel connects to the network.
Example request:
Example response:
Response fields:
object
The full startup configuration as persisted on disk.
string
The executor name currently active for the kernel’s own autonomous agent operations.

POST /api/startup-config

Saves a new startup configuration to disk. Changes take effect on the next node restart; they do not hot-reload while the node is running.
string
required
Network connectivity mode. One of "local", "lan", or "wan".
string[]
List of bootstrap contact strings used to join the peer-to-peer overlay. Typically these are iroh-style contact tokens shared by known bootnodes.
string[]
Optional list of HTTP gateway URLs for nodes that cannot open inbound P2P connections directly.
object
Specifies which executor and profile the kernel uses for its own autonomous agent operations.
Example request:
Example response:
Response fields:
object
The full startup configuration as saved to disk.
string
The executor name currently active for the kernel’s own autonomous agent.
boolean
true if the core_agent executor entry was automatically registered (or updated) in the executor registry as a result of this save. false when core_agent was not changed.
After saving a new startup configuration, call POST /api/node/down followed by POST /api/node/up to apply it without restarting the kernel process.