QUICK START
Quick Start
Get SentinelGuard monitoring your Solana DeFi protocol in under 5 minutes.
Prerequisites
Rust 1.75+
cargo installed
Bun 1.0+
or Node 18+
Anchor CLI 0.31
for program deploy
1. Clone and Install
terminalbash
# Clone the monorepo
git clone https://github.com/Rudraprajapati2612/sentinel-guard
cd sentinel-guard
# Install JS dependencies
bun install
# Build Rust workspace
cargo build --release2. Environment Setup
Copy the example env file and fill in your keys.
terminalbash
cp watcher/.env.example watcher/.env| Variable | Required | Description |
|---|---|---|
HELIUS_API_KEY | ā Yes | Helius RPC + Geyser access |
SENTINEL_PROGRAM_ID | ā Yes | Deployed program address |
DATABASE_URL | ā Yes | PostgreSQL connection string |
REDIS_URL | ā Yes | Redis for TVL state + cooldowns |
VAULT_ACCOUNTS | ā Yes | Comma-separated vault addresses |
DISCORD_WEBHOOK_URL | Optional | Alert notifications |
KAFKA_BROKERS | Optional | Durable alert logging |
MIN_SEVERITY_TO_PAUSE | Optional | Default: 60 |
3. Start the Watcher
terminalbash
# Start infrastructure
docker compose up -d
# Run database migrations
sqlx migrate run
# Start the watcher
cargo run --bin watcherIf setup is correct, you'll see:
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā ā SentinelGuard ā Monitoring Active ā ā Protocol: your_protocol_address ā ā Vault TVL: $1,200,000 USDC ā āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā Geyser connected. Watching 1 program.
4. Test with Attack Simulation
Run the included attack scenarios to verify detection is working.
terminalbash
bun run tests/attack_scenarios.tsScenario 13 is the recommended demo scenario ā it shows a drain attack being detected and the vault paused on-chain before the attacker can withdraw.