run

Start the agent and listen for AlgoChat messages.

can run [OPTIONS]

Description

Starts the agent message loop that:

  1. Polls for incoming AlgoChat messages on-chain
  2. Decrypts messages from known PSK contacts
  3. Forwards messages to the hub's A2A task endpoint (unless --no-hub)
  4. Polls the hub for responses
  5. Encrypts and sends replies back on-chain

Options

FlagDefaultDescription
--networklocalnetNetwork preset
--algod-urlfrom networkOverride algod URL
--algod-tokenfrom networkOverride algod token
--indexer-urlfrom networkOverride indexer URL
--indexer-tokenfrom networkOverride indexer token
--seedfrom keystoreAgent seed (hex)
--addressfrom keystoreAgent Algorand address
--passwordinteractiveKeystore password
--namecanAgent name for discovery
--hub-urlhttp://localhost:3578Hub URL
--poll-interval5Seconds between polls
--no-pluginsfalseDisable plugin host
--no-hubfalseP2P mode (no hub forwarding)

Examples

# Default: localnet, with hub
can run

# Testnet, custom hub
can run --network testnet --hub-url https://hub.example.com

# P2P mode (store messages locally only)
can run --no-hub

# Custom poll interval
can run --poll-interval 10

# With environment variables
CAN_NETWORK=testnet CAN_PASSWORD=mypass can run

Startup output

On startup, CAN displays a summary showing:

  • Agent name, network, address
  • Contact and group counts
  • Hub URL or P2P mode
  • Plugin status

Shutdown

Press Ctrl+C to gracefully shut down. The agent will stop the plugin host sidecar and exit cleanly.