JSON-RPC Daemon API

Reference guide for interfacing client applications with the local GhostMesh daemon.

1. Method: mesh_sendPacket

Exposed over a local HTTP JSON-RPC endpoint at `http://127.0.0.1:4819`. Encrypts and queues a new payload for delivery:

# Request Payload
{
  "jsonrpc": "2.0",
  "method": "mesh_sendPacket",
  "params": {
    "recipient_id": "0x5f9a88bc",
    "message_utf8": "Emergency coordinates set to Sect-4."
  },
  "id": 1
}

2. Method: mesh_getPeers

Returns a list of currently active adjacent nodes within BLE and Wi-Fi range:

# Response JSON
{
  "jsonrpc": "2.0",
  "result": {
    "active_peers": [
      { "peer_id": "0x992f", "rssi": -68, "link_type": "BLE" },
      { "peer_id": "0xac1e", "rssi": -45, "link_type": "Wi-Fi" }
    ]
  },
  "id": 1
}

3. Method: mesh_getStatus

Checks transmitter status, active packet queue load, and memory usage:

# Response JSON
{
  "jsonrpc": "2.0",
  "result": {
    "status": "ONLINE",
    "queue_count": 14,
    "transmitter_power": "HIGH"
  }
}