Skip to content

Local binary

Run Smart Router as a native binary on the host — no Docker. Best when you want the smallest footprint, are wiring it into your own process manager (systemd, supervisor), or are developing against the router.

Build & install

You need Go 1.26+. From a clone of the smart-router repo:

git clone https://github.com/Magma-Devs/smart-router.git
cd smart-router

make install   # go install -> $GOBIN (usually ~/go/bin)
# or
make build     # builds ./build/smartrouter without installing

make install produces a single smartrouter binary. The cache is the same binary's cache subcommand — there's nothing else to build.

Run the router

Point it at a config file and a spec source:

smartrouter config/smartrouter_examples/smartrouter_eth.yml \
  --use-static-spec specs/ \
  --metrics-listen-address :7779

# Smoke-test it
curl -X POST http://localhost:3360 \
     -H 'content-type: application/json' \
     -d '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":1}'

A non-error JSON-RPC result means the listener is live; the metrics server also answers :7779/metrics/overall-health. See Confirm it's healthy for the full set of checks.

  • The config file is positional — there's no --config flag.
  • --use-static-spec accepts a local directory (the bundled specs/) or a GitHub/GitLab URL to resolve chains that aren't bundled (e.g. LAV1). Repeatable.
  • See the CLI reference for every flag.

Don't have a config yet? The wizard writes one (and can run it for you).

Run the cache (optional)

The cache is a separate process. Start it, then point the router at it with cache-be: in the config (the cache section explains why it's a config key, not a flag):

# terminal 1 — cache server (address is positional)
smartrouter cache 127.0.0.1:20100 --metrics_address 127.0.0.1:5555

# terminal 2 — router, with cache-be: "127.0.0.1:20100" in the config
smartrouter config/smartrouter_examples/smartrouter_eth_cached.yml \
  --use-static-spec specs/

See the cache subcommand flags for TTL and sizing options.