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
| Method | Description |
|---|---|
daemon.status | Daemon runtime state |
daemon.shutdown | Initiate graceful shutdown |
daemon.logs | Tail recent logs by level and line count |
daemon.start/daemon.stop/daemon.restart/daemon.reloadare not RPCs. Daemon lifecycle is owned by the host (aleph-server daemon,aleph-server service, or a service manager likesystemd/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:
| Parameter | Type | Required | Description |
|---|---|---|---|
lines | number | No | Number of trailing lines to return (default 50) |
level | string | No | Filter by level: error / warn / info / debug / trace |
CLI Equivalents
| Purpose | CLI |
|---|---|
| Start the daemon | aleph-server start |
| Stop the daemon | aleph-server stop |
| Register as a system service (launchd / systemd-user / Task Scheduler) | aleph-server service install |
| Show version / platform | aleph-server version |
See Also
- Methods Reference -- All method namespaces
- logs.* --
logs.getDirectory/logs.getLevel/logs.setLevel