Use the Daemon as a Local Service

Run the Autonomi Daemon, antd, as a long-lived local service when you want one stable Autonomi gateway that multiple applications, scripts, or background processes can share.

Use this setup if you want:

  • A persistent local REST and gRPC endpoint

  • One daemon shared by more than one app or tool

  • Service-manager supervision instead of manually starting antd in a terminal

Prerequisites

  • antd built or installed on the target machine

  • A Linux host with systemd for the service example below

  • Optional wallet and EVM environment variables if the daemon will handle paid uploads

Steps

1. Create an environment file

Keep secrets and network settings outside the unit file.

Create /etc/antd.env:

AUTONOMI_WALLET_KEY=<hex_private_key>
EVM_RPC_URL=https://your-rpc-endpoint
EVM_PAYMENT_TOKEN_ADDRESS=0x...
EVM_PAYMENT_VAULT_ADDRESS=0x...

You only need the wallet and EVM settings if this daemon will perform paid writes. For external-signer uploads, omit AUTONOMI_WALLET_KEY but keep the EVM settings so the prepare/finalize endpoints can describe the payment work.

2. Create a systemd unit

Create /etc/systemd/system/antd.service:

This binds the daemon to localhost instead of exposing it on every interface.

3. Start and enable the service

4. Check health and logs

If you need more detail in the logs, change --log-level info to debug or trace and restart the service.

5. Use fixed or dynamic ports

For a stable local service, keep explicit addresses as shown above. If another supervisor needs OS-assigned ports, antd also supports:

In that mode, SDKs can discover the chosen ports from the daemon.port file written under the SDK data directory on startup.

Verify it worked

The daemon is healthy when /health returns status: ok and your application can connect to the configured REST or gRPC endpoint.

Common errors

Port already in use: Change --rest-addr, --grpc-addr, --rest-port, or --grpc-port.

503 on write endpoints: The daemon is running, but wallet or EVM payment configuration is missing.

Startup loop in systemd: Inspect journalctl -u antd -f for invalid addresses, missing binaries, or bad environment variables.

Next steps

Last updated