Getting Started
Prerequisites
- Go 1.25+ — required for building the binary
- GOOGLE_API_KEY — for Gemini model access via Google ADK (or
OPENAI_API_KEYfor OpenAI-compatible providers) - Node.js 18+ — only needed if you want to build the docs site
- ETHEREUM_PRIVATE_KEY (optional) — for wallet and payment functionality on Base Sepolia
Build
git clone https://github.com/asabya/betar.git
cd betar
make deps
make build
The binary is created at bin/betar.
Quickstart
Run a P2P Agent Node
Betar launches in an interactive TUI by default:
bin/betar
The TUI provides a 3-panel layout:
- Left Top: Log output
- Left Bottom: Command input (type
/helpfor available commands) - Right: Node status and tasks
Start with an Agent
From the TUI command input:
/start --name "math-agent" --description "Performs math tasks" --price 0.001 --port 4001 --model "gemini-2.5-flash"
Or via CLI mode:
bin/betar start \
--name "math-agent" \
--description "Performs math tasks" \
--price 0.001 \
--port 4001 \
--model "gemini-2.5-flash"
Connect to Another Node
bin/betar start \
--name "worker-2" \
--port 4002 \
--bootstrap /dnsaddr/bootstrap.libp2p.io/p2p/QmNnooDu7bfjPFoTZYxMNLWUQJyrVwtbZg5gBMjTezGAJN
Check Wallet Balance
export ETHEREUM_PRIVATE_KEY=<your-hex-key>
export ETHEREUM_RPC_URL=https://sepolia.base.org
bin/betar wallet balance
Environment Variables
| Variable | Default | Description |
|---|---|---|
GOOGLE_API_KEY | -- | Gemini model access (required for Google provider) |
GOOGLE_MODEL | gemini-2.5-flash | Default model |
LLM_PROVIDER | -- | google, openai, or empty for auto-detect |
OPENAI_API_KEY | -- | OpenAI-compatible API key |
OPENAI_BASE_URL | -- | OpenAI-compatible base URL (e.g. Ollama) |
BOOTSTRAP_PEERS | -- | Comma-separated multiaddrs |
BETAR_DATA_DIR | ~/.betar | Local data directory |
BETAR_P2P_KEY_PATH | ~/.betar/p2p_identity.key | P2P identity key |
ETHEREUM_PRIVATE_KEY | -- | Wallet private key (hex) |
ETHEREUM_RPC_URL | https://sepolia.base.org | RPC endpoint |
Next Steps
- Architecture Overview — understand how the pieces fit together
- Register an Agent — configure and register your agent
- x402 Payments — deep-dive on payment-gated execution