Aleph
Gateway RPCMethods Reference

daemon.*

Daemon control and lifecycle RPC methods

daemon.* exposes the control plane of the Aleph daemon (the aleph-server process that embeds the gateway). All handlers live in src/gateway/handlers/daemon_control.rs; daemon.logs is registered directly in HandlerRegistry::new() (no runtime state required), while daemon.status and daemon.shutdown are wired at gateway boot.

Methods

MethodDescription
daemon.statusDaemon runtime state
daemon.shutdownInitiate graceful shutdown
daemon.logsTail recent logs by level and line count

daemon.start / daemon.stop / daemon.restart / daemon.reload are not RPCs. Daemon lifecycle is owned by the host (aleph-server daemon, aleph-server service, or a service manager like systemd / launchd).

daemon.status

Read daemon runtime information (uptime, version, platform).

Request:

{ "jsonrpc": "2.0", "id": 1, "method": "daemon.status" }

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "running": true,
    "uptime_secs": 1800,
    "version": "<build-version>",
    "platform": "linux-x86_64"
  }
}

uptime_secs is measured from the Instant captured at process start; version is taken from the ALEPH_VERSION build-time env var.

daemon.shutdown

Trigger a graceful shutdown: send the response first, then a spawned task calls std::process::exit(0) 100 ms later. The exit code is honoured by aleph-server's SIGTERM handler.

Request:

{ "jsonrpc": "2.0", "id": 2, "method": "daemon.shutdown" }

Response:

{ "jsonrpc": "2.0", "id": 2, "result": { "status": "shutting_down" } }

daemon.logs

Tail the most recent log file (matched by aleph-*.log.* filename, picking the latest mtime). Optionally filter by level using whole-token matching on ERROR / [ERROR] style markers, so WARN is not falsely matched by an ERROR filter.

Request:

{
  "jsonrpc": "2.0",
  "id": 3,
  "method": "daemon.logs",
  "params": { "lines": 50, "level": "error" }
}

Response:

{
  "jsonrpc": "2.0",
  "id": 3,
  "result": {
    "logs": ["2026-03-15T10:30:00Z ERROR gateway: connection refused", "..."],
    "file": "/home/user/.aleph/logs/aleph-server.log.2026-03-15"
  }
}

When no aleph-*.log.* file exists in the directory, the handler returns { "logs": [], "file": null, "total_lines": 0 }.

Parameters:

ParameterTypeRequiredDescription
linesnumberNoNumber of trailing lines to return (default 50)
levelstringNoFilter by level: error / warn / info / debug / trace

CLI Equivalents

PurposeCLI
Start the daemonaleph-server start
Stop the daemonaleph-server stop
Register as a system service (launchd / systemd-user / Task Scheduler)aleph-server service install
Show version / platformaleph-server version

See Also

On this page