Bootstrap API
The bootstrap module handles the startup sequence for Gasclaw.
Functions
bootstrap(config, gt_root)
Run the full bootstrap sequence.
Parameters:
| Name | Type | Description |
|---|---|---|
config |
GasclawConfig |
Validated gasclaw configuration |
gt_root |
Path |
Where to install Gastown (default: /workspace/gt) |
Raises:
RuntimeError: If bootstrap fails, after attempting rollback
Bootstrap Sequence:
- Setup Kimi accounts for Gastown agents
- Write agent config
- Install Gastown
- Start Dolt
- Configure OpenClaw
- Install skills
- Run openclaw doctor
- Start OpenClaw gateway
- Start gt daemon
- Start mayor agent
- Send startup notification
Example:
from gasclaw.bootstrap import bootstrap
from gasclaw.config import load_config
config = load_config()
bootstrap(config)
monitor_loop(config, interval)
Foreground health monitor loop.
Parameters:
| Name | Type | Description |
|---|---|---|
config |
GasclawConfig |
Gasclaw configuration |
interval |
int \| None |
Seconds between checks (default from config) |
Behavior:
- Runs health checks at regular intervals
- Sends Telegram notifications for:
- Activity violations (no commits within deadline)
- Service failures (dolt, daemon, mayor down)
- Continues until interrupted (Ctrl+C)
Example: