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 --release

2. Environment Setup

Copy the example env file and fill in your keys.

terminalbash
cp watcher/.env.example watcher/.env
VariableRequiredDescription
HELIUS_API_KEYāœ… YesHelius RPC + Geyser access
SENTINEL_PROGRAM_IDāœ… YesDeployed program address
DATABASE_URLāœ… YesPostgreSQL connection string
REDIS_URLāœ… YesRedis for TVL state + cooldowns
VAULT_ACCOUNTSāœ… YesComma-separated vault addresses
DISCORD_WEBHOOK_URLOptionalAlert notifications
KAFKA_BROKERSOptionalDurable alert logging
MIN_SEVERITY_TO_PAUSEOptionalDefault: 60

3. Start the Watcher

terminalbash
# Start infrastructure
docker compose up -d

# Run database migrations
sqlx migrate run

# Start the watcher
cargo run --bin watcher

If 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.ts

Scenario 13 is the recommended demo scenario — it shows a drain attack being detected and the vault paused on-chain before the attacker can withdraw.

Next Steps

Was this page helpful?