algod.top

command module
v0.0.0-...-b973d07 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 20, 2026 License: MIT Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

algod.top

CI

algod.top monitors one or more Algorand nodes (algod). One binary holds three parts:

  • algod.top, a terminal view in the style of top.
  • algod.top daemon, which collects metrics, status and log events from each node and keeps them for as long as you choose.
  • A web UI, served by the daemon from files embedded in the binary.

Capturing data comes first. The daemon never drops or delays a sample to serve a viewer. The user documentation is at https://algod.top/docs/, and DESIGN.md explains every decision. The store format is in docs/format.md.

Install

go install algod.top@latest   # installs the algod.top command
go run algod.top@latest       # runs it without installing

The binary has no cgo and no runtime dependencies. It runs on Linux, macOS and Windows. Go 1.27 builds it. Signed binaries for every platform are on the latest release, with checksums.txt and its signature.

algod.top upgrade installs the newest release on this machine and on every agent the hub runs. Each one checks the release signature itself and restarts onto the new binary.

Quick start

algod.top                          # finds local nodes and shows them live
algod.top -d ~/.mainnet            # one data directory
algod.top -u http://host:8080      # a REST URL; tokens from $ALGOD_TOKEN and $ALGOD_ADMIN_TOKEN
algod.top -u ssh://relay1/~/.mainnet   # a remote node over SSH, nothing installed there

Without a daemon the terminal UI shows live values only. To keep history:

algod.top daemon --discover        # find local nodes, write ~/.config/algodtop/config.json, run
algod.top                          # now shows the daemon's data, with history

To start the daemon at login or boot instead, run algod.top service. It explains the service for your platform: a launchd agent on macOS, a systemd user unit on Linux, or a system service like algorand.service when algod runs as its own account. algod.top service install sets it up.

The web UI listens on http://127.0.0.1:8090 by default. Press ? in the terminal UI for its keys. algod.top -b prints the node table once, and -n N -i SECS --json suit scripts and cron.

Commands

Command Does
algod.top Terminal UI
algod.top daemon Collector, store, health, alerts, API and web UI
algod.top agent Collector and local buffer on a remote host
algod.top export Series, events or sessions as CSV or JSON
algod.top silence Add, list or end alert silences
algod.top stdio [--agent] Connects stdin and stdout to the local socket, for use over SSH
algod.top remote install|add|upgrade|sync|remove HOST Manage an agent over SSH
algod.top service [install|uninstall|status] Start the daemon at login or boot
algod.top reload Reload the config (the same as SIGHUP)
algod.top passwd [--read-only|--token] Set the web password or make a read-only token
algod.top check [--notify] Validate the config and alerts, reach each node, project disk use. --notify tests each channel

Config

The config is one JSON file, by default ~/.config/algodtop/config.json (%APPDATA%\algodtop\config.json on Windows). It holds tokens and the password hash, so keep it mode 0600. A minimal file:

{
  "nodes": [
    {"name": "mainnet", "datadir": "~/.mainnet", "accounts": ["ABC...XYZ"]},
    {"name": "relay2", "url": "ssh://algorand@relay2/var/lib/algorand"}
  ],
  "retention": {"raw": "30d", "1m": "1y", "10m": "5y", "1h": "forever"},
  "alerts": [{"name": "down", "expr": "down or stalled", "for": "1m", "channels": ["phone"]}],
  "channels": {"phone": {"type": "webhook", "url": "https://ntfy.sh/my-topic"}}
}

Alert expressions are fixed functions such as lag > 30s, peers_out < 1, health >= warn or rule:key_expiry. Channels are webhook, smtp and command. They live only in the config file: neither front end can create or change one.

Remote hosts

A hub reaches nodes on other hosts through the system ssh, which honours ~/.ssh/config, ProxyJump and ssh-agent. algod.top always uses BatchMode=yes, so run ssh HOST once to accept a new host key.

  • ssh://host/<datadir> needs nothing installed on the host. It records gaps while the hub is offline.
  • algod.top remote install HOST copies a signed release to ~/.local/bin/algodtop, writes an agent config from discovery, and installs a systemd user unit or a launchd agent. The agent buffers 7 days, so the hub catches up after an outage with no gap. When algod runs as another account, as package installs do, install the agent on the host as a system service with sudo algod.top service install --system --agent. Then point the hub at it with algod.top remote add HOST and algod.top reload.
  • algod.top -H ssh://host opens the terminal UI of the daemon on another host with no open ports.

Security

The unix socket is mode 0600 and needs no password. The TCP listener binds to localhost. A non-loopback address needs a password (algod.top passwd), and every state-changing request over TCP needs a CSRF token. algod tokens never reach a client, and the algod client sends only GET requests to a fixed allowlist.

Development

go test ./...                     # unit and end-to-end tests
go test -race ./...               # what CI runs
go test ./internal/tui -update    # rewrite terminal UI golden files
test/remote/run.sh                # SSH integration test in Docker (real sshd)
ALGODTOP_FOOTPRINT=1h go test ./internal/daemon -run TestFootprint -v   # resource budget
go run ./internal/tools/algodtop-gen -dir /tmp/s -nodes 5 -days 30      # synthetic history and query timings

The web smoke test in internal/web runs when Chrome or Chromium is installed. ALGODTOP_SMOKE_SHOT=DIR saves a screenshot of each page. ALGODTOP_CPUPROFILE=path,seconds and ALGODTOP_MEMPROFILE=path make a running daemon write CPU and allocation profiles.

site/ is the https://algod.top website. .github/workflows/pages.yml publishes it to GitHub Pages on every push to main that changes it. Its pages carry the go-import tags that let go install algod.top/algodtop@latest find this repo.

internal/fakealgod is an algod stand-in that serves a Mainnet-shaped /metrics fixture, produces rounds, churns peers, writes node.log and can restart, stall and rotate logs. go run ./internal/fakealgod/cmd/fakealgod -d /some/dir runs it alone.

Every merge to main publishes a signed GitHub release from the release job in .github/workflows/ci.yml. DESIGN.md section 16 describes it and the release key. internal/release/cmd/algodtop-sign makes the key and signs and verifies a release directory:

go run ./internal/release/cmd/algodtop-sign keygen release.key        # prints the public key
go run ./internal/release/cmd/algodtop-sign sign release.key dist algodtop_linux_amd64 ...
go run ./internal/release/cmd/algodtop-sign verify dist algodtop_linux_amd64 ...

The open decisions in DESIGN.md section 22 are still open, among them the approval of golang.org/x/sys/windows/svc for the Windows service handler.

License

algod.top is a txn.group project under the MIT license. See LICENSE, and CONTRIBUTING.md and SECURITY.md before you send a change or a report.

Documentation

Overview

Command algod.top is the short install path for algodtop. It runs the same code as algod.top/algodtop.

Directories

Path Synopsis
Command algodtop monitors one or more algod nodes.
Command algodtop monitors one or more algod nodes.
internal
alert
Package alert evaluates alert rules over the derived values that health uses, with fixed functions and no general query language.
Package alert evaluates alert rules over the derived values that health uses, with fixed functions and no general query language.
algod
Package algod reads algod data directories and talks to algod's REST API.
Package algod reads algod data directories and talks to algod's REST API.
api
Package api is the JSON-over-HTTP API that both front ends use.
Package api is the JSON-over-HTTP API that both front ends use.
cli
Package cli is the entry point shared by both main packages: algodtop and algod.top run the same code.
Package cli is the entry point shared by both main packages: algodtop and algod.top run the same code.
collector
Package collector polls algod nodes: /metrics, the round watcher, REST status, peers, participation, process and host stats, and the log tailer.
Package collector polls algod nodes: /metrics, the round watcher, REST status, peers, participation, process and host stats, and the log tailer.
config
Package config loads, validates and writes algodtop's JSON config file and resolves the per-platform default paths.
Package config loads, validates and writes algodtop's JSON config file and resolves the per-platform default paths.
daemon
Package daemon runs the collectors, the storage writer, health, alerts and the API.
Package daemon runs the collectors, the storage writer, health, alerts and the API.
disk
Package disk reports free space on the volume that holds a path.
Package disk reports free space on the volume that holds a path.
enc
Package enc holds the column encodings used by the chunk store: a bit stream, Gorilla XOR float compression, delta-of-delta timestamps and run-length presence bitmaps.
Package enc holds the column encodings used by the chunk store: a bit stream, Gorilla XOR float compression, delta-of-delta timestamps and run-length presence bitmaps.
fakealgod
Package fakealgod is an algod stand-in for tests, benchmarks and the Docker remote tests.
Package fakealgod is an algod stand-in for tests, benchmarks and the Docker remote tests.
fakealgod/cmd/fakealgod command
Command fakealgod runs an algod stand-in for the Docker remote tests and for trying algodtop without a real node.
Command fakealgod runs an algod stand-in for the Docker remote tests and for trying algodtop without a real node.
fsx
Package fsx holds small file helpers shared across packages: atomic writes, directory fsync and shared-delete opens on Windows.
Package fsx holds small file helpers shared across packages: atomic writes, directory fsync and shared-delete opens on Windows.
health
Package health turns a node's live state into OK, Warn or Critical with the reasons in words.
Package health turns a node's live state into OK, Warn or Critical with the reasons in words.
logparse
Package logparse turns algod node.log lines into counts, templates and events.
Package logparse turns algod node.log lines into counts, templates and events.
model
Package model holds the types shared by collectors, the store, the API and both front ends.
Package model holds the types shared by collectors, the store, the API and both front ends.
promparse
Package promparse parses the Prometheus text exposition format that algod serves on /metrics, and classifies each series as a gauge, counter or histogram part.
Package promparse parses the Prometheus text exposition format that algod serves on /metrics, and classifies each series as a gauge, counter or histogram part.
query
Package query plans and runs series queries: it picks a tier per part of the range, stitches tiers together, and aggregates to exactly the number of buckets the client can draw.
Package query plans and runs series queries: it picks a tier per part of the range, stitches tiers together, and aggregates to exactly the number of buckets the client can draw.
release
Package release fetches and verifies algodtop release binaries.
Package release fetches and verifies algodtop release binaries.
release/cmd/algodtop-sign command
Command algodtop-sign creates a release signing key, signs a release directory's checksums and verifies them.
Command algodtop-sign creates a release signing key, signs a release directory's checksums and verifies them.
remote
Package remote reaches nodes on other hosts through the system ssh binary: SSH without install (ssh cat plus ssh -W to algod), the SSH agent (ssh host algodtop stdio --agent), and agent installation.
Package remote reaches nodes on other hosts through the system ssh binary: SSH without install (ssh cat plus ssh -W to algod), the SSH agent (ssh host algodtop stdio --agent), and agent installation.
store
Package store is algodtop's chunk store: a WAL, per-node in-memory heads, immutable 2 h raw blocks, partial rollups at 1m, 10m and 1h, compaction, retention by guaranteed window, and append-only event and session logs.
Package store is algodtop's chunk store: a WAL, per-node in-memory heads, immutable 2 h raw blocks, partial rollups at 1m, 10m and 1h, compaction, retention by guaranteed window, and append-only event and session logs.
svc
Package svc renders systemd units and launchd plists for the daemon and the agent.
Package svc renders systemd units and launchd plists for the daemon and the agent.
sysstat
Package sysstat collects process and host stats behind one interface with an implementation per platform.
Package sysstat collects process and host stats behind one interface with an implementation per platform.
tools/algodtop-gen command
Command algodtop-gen writes synthetic history into a store directory, for benchmarks of rollup, query and render times.
Command algodtop-gen writes synthetic history into a store directory, for benchmarks of rollup, query and render times.
tui
Package tui is algodtop's terminal UI in the style of top, plus batch mode.
Package tui is algodtop's terminal UI in the style of top, plus batch mode.
version
Package version describes the build.
Package version describes the build.
web
Package web embeds the web UI: plain ES modules, CSS and one HTML page, with no build step.
Package web embeds the web UI: plain ES modules, CSS and one HTML page, with no build step.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL