ZeroCopyZeroCopy
SWQoSLocal agent

Install and run

Prepare a Linux host, install the licensed agent and run it as a service

The ZeroCopy Agent runs beside your application and accepts signed transactions and bundles over local HTTP, QUIC or shared memory IPC. It selects a metro automatically and reconnects when a connection fails. Your application still owns confirmation and retries.

Protect local access

The listeners do not authenticate callers. Anyone who can reach them can submit transactions and incur charges on your account. Keep HTTP and QUIC on loopback and restrict access to the IPC socket.

Prepare the host

Platform

Use Linux on x86_64 with glibc 2.39 or newer and the standard loader at /lib64/ld-linux-x86-64.so.2. Ubuntu 24.04, Debian 13 and RHEL 10 have it. Run --check on each host before relying on it.

License

The executable contains your organization's license. Do not put an API key in the configuration. Keep the executable private. If the associated API key changes or is revoked, request a replacement through Requests in the console.

Network

The agent uses IPv4 and needs no public inbound port. Allow these outbound connections:

ProtocolDestinationPurpose
DNSYour resolverResolve metro hostnames
QUIC on UDP 443Metro hosts under sol.zerocopy.shConnect to SWQoS
QUIC on UDPValidator TPU addresses on varying portsSend transactions directly from your host

Validator destinations change. If your firewall allows only metro hosts, the agent can still send through an edge but cannot send directly to validators. Keep the system clock correct for TLS checks. An HTTP proxy cannot carry the agent's UDP connections.

Host resources

Use a dedicated account with a writable executable directory and, for IPC, a writable socket directory. These instructions use the user and group zerocopy.

IPC busy polling uses one CPU core while any client is connected. Set ipc_busy_poll = false for lower idle CPU use; see busy polling.

Obtain the executable

Use Requests in the console to ask for your organization's licensed zerocopy-agent executable and SHA-256 checksum.

Create the user and directories

Create the agent user and directories
sudo useradd --system --user-group --no-create-home --home-dir /opt/zerocopy --shell /usr/sbin/nologin zerocopy
sudo install -d -o zerocopy -g zerocopy -m 0700 /opt/zerocopy
sudo install -d -m 0755 /etc/zerocopy

Install the executable

Set delivered to the path of the file you received:

Install the delivered executable
delivered=/path/to/zerocopy-agent
sudo install -o zerocopy -g zerocopy -m 0700 "$delivered" /opt/zerocopy/zerocopy-agent

Verify the checksum

Set expected to the SHA-256 value ZeroCopy provided, then check the installed file:

Check the installed executable
expected=PASTE_DELIVERED_SHA256
printf '%s  %s\n' "$expected" /opt/zerocopy/zerocopy-agent | sudo sha256sum --check

Continue only if the command prints /opt/zerocopy/zerocopy-agent: OK. Otherwise, contact support before running the file.

Keep the executable directory writable

The zerocopy account must be able to write /opt/zerocopy for automatic updates, including under service sandboxing. If you launch through a symbolic link, the target file's directory must be writable. Updates retain owner access and remove group and other permissions from the executable.

Create the configuration

Create /etc/zerocopy/agent.toml as root and make it readable by zerocopy. This example keeps network listeners on loopback and uses an explicit IPC path. See Configuration for all options.

/etc/zerocopy/agent.toml
[listen]
http = "127.0.0.1:8080"
quic = "127.0.0.1:4433"
ipc = "/run/zerocopy/agent.sock"
ipc_busy_poll = true

Give IPC clients access

The agent creates its IPC socket with mode 0660, owned by zerocopy. Add each application account to the group, then restart the application so its processes pick up the change:

Allow an application account to use IPC
sudo usermod --append --groups zerocopy app-user

Replace app-user with your application account. HTTP and QUIC clients need no group membership.

Check startup and connectivity

Command arguments

Always pass --config <path>. Add --check to load the configuration and license, check that an edge answers, print the release number and exit:

Check the agent before starting
sudo -u zerocopy /opt/zerocopy/zerocopy-agent --config /etc/zerocopy/agent.toml --check

Success exits with status 0 and prints:

Passing check
check passed: release <number>

If no edge answers in time, the command exits with status 1. See check failures. It opens no local listener, so you can run it while the service is running.

Run in the foreground

The agent does not create its IPC socket directory. Create it before a terminal run:

Run in a terminal
sudo install -d -o zerocopy -g zerocopy -m 0750 /run/zerocopy
sudo -u zerocopy /opt/zerocopy/zerocopy-agent --config /etc/zerocopy/agent.toml

Logs go to standard output. Wait for the listeners to open before connecting a local client. Stop the process with Ctrl-C.

Run as a systemd service

This unit runs as zerocopy, creates the IPC directory and keeps the executable directory writable for updates. Its sandbox options require systemd 248 or later.

/etc/systemd/system/zerocopy-agent.service
[Unit]
Description=ZeroCopy Agent
Wants=network-online.target
After=network-online.target

[Service]
Type=simple
User=zerocopy
Group=zerocopy
ExecStart=/opt/zerocopy/zerocopy-agent --config /etc/zerocopy/agent.toml
Restart=on-failure
RestartSec=5
RuntimeDirectory=zerocopy
RuntimeDirectoryMode=0750
UMask=0077

# Automatic updates write the executable's directory.
ProtectSystem=strict
ReadWritePaths=/opt/zerocopy
ProtectHome=yes
PrivateTmp=yes
PrivateDevices=yes
PrivateIPC=yes
PrivateUsers=yes
ProtectProc=invisible
ProcSubset=pid
ProtectKernelTunables=yes
ProtectKernelModules=yes
ProtectKernelLogs=yes
ProtectControlGroups=yes
ProtectClock=yes
ProtectHostname=yes

NoNewPrivileges=yes
CapabilityBoundingSet=
RestrictSUIDSGID=yes
RestrictNamespaces=yes
RestrictRealtime=yes
LockPersonality=yes
MemoryDenyWriteExecute=yes
RemoveIPC=yes
KeyringMode=private

RestrictAddressFamilies=AF_INET AF_UNIX

SystemCallArchitectures=native
SystemCallFilter=@system-service
SystemCallFilter=~@privileged @resources
SystemCallErrorNumber=EPERM

[Install]
WantedBy=multi-user.target

Keep listen.ipc under /run/zerocopy. The service has a private /tmp, so clients cannot reach a socket there. The sandbox allows IPv4 and Unix sockets, not IPv6, and has no capabilities for listening on ports below 1024.

Enable and start the service
sudo systemctl daemon-reload
sudo systemctl enable --now zerocopy-agent
systemctl status zerocopy-agent
journalctl -u zerocopy-agent -f

Once listeners open, check local health. Rust and Go use the example project; TypeScript uses fetch. No API key is needed.

src/bin/check_agent_health.rs
use swqos_examples::swqos::Result;

#[tokio::main]
async fn main() -> Result<()> {
    let response = reqwest::get("http://127.0.0.1:8080/health").await?;
    let status = response.status();
    let body = response.text().await?;
    if !status.is_success() {
        return Err(format!("HTTP {status}: {}", body.trim()).into());
    }
    println!("HTTP {status}: {}", body.trim());
    Ok(())
}

HTTP status 200 with ok means the agent has an edge connection or current routing information. Status 503 with unhealthy means it is not ready. Health does not confirm a transaction's outcome.

Restrict listening ports

On systemd 256 or later, when systemctl --version lists +BPF_FRAMEWORK, add this drop in file:

/etc/systemd/system/zerocopy-agent.service.d/ports.conf
[Service]
# Match listen.http and listen.quic. Port 0 is for outgoing QUIC sockets.
SocketBindAllow=ipv4:tcp:8080
SocketBindAllow=ipv4:udp:4433
SocketBindAllow=ipv4:udp:0
SocketBindDeny=any
Apply the port restrictions
sudo systemctl daemon-reload
sudo systemctl restart zerocopy-agent

If you change listen.http or listen.quic, change the matching line. Otherwise startup fails with bind <address>: Operation not permitted. Keep the UDP port 0 rule for outgoing QUIC sockets.

Stop and restart

Use systemctl stop zerocopy-agent to stop the service or systemctl restart zerocopy-agent to apply configuration changes.

A stop or automatic update closes local connections. HTTP and QUIC clients must reconnect. IPC clients must open a new session and repeat the handshake.

Diagnose a failed start

A failed start prints error: <reason> to standard error, sometimes followed by caused by: <reason>, and exits with status 1. Read the service log with journalctl -u zerocopy-agent and follow startup troubleshooting.

When the agent is running, connect your application through local interfaces.