Chainhook is a blockchain indexing platform that enables developers to easily integrate Solana blockchain data into their PostgreSQL databases using Helius webhooks.
- Framework: SST (AWS CDK-based framework)
- Database: PostgreSQL with Drizzle ORM
- Authentication: OpenAuth.js
- Infrastructure: AWS (Lambda, Aurora, API Gateway)
- Webhook Provider: Helius
-
Database
- Aurora PostgreSQL instance
- Local development support (port 5433)
- Connection pooling configured
-
Authentication
- OpenAuth.js integration
- GitHub OAuth provider configured
- No custom auth tables needed
-
API Layer
- Lambda-based webhook endpoint
- API Gateway integration
- Helius webhook processing
- Users Table (Implemented)
users = pgTable("users", {
id: varchar("id").primaryKey().notNull(),
username: varchar("username").unique().notNull(),
email: varchar("email").unique().notNull(),
createdAt: timestamp("created_at").defaultNow().notNull(),
updatedAt: timestamp("updated_at"),
});-
User Connections
- Stores PostgreSQL connection details
- Encrypted credential storage
- Connection health monitoring
-
Index Types
- Predefined indexing categories
- Schema templates
- Example queries
-
Index Subscriptions
- User's active indexing choices
- Configuration and filtering
- Status tracking
-
Schema Templates
- Table creation templates
- Index definitions
- Sample queries
-
Webhook Events
- Event processing queue
- Error tracking
- Retry management
-
Event Types
- NFT Events (sales, bids, transfers)
- Token Events (swaps, transfers)
- Account Events (state changes)
-
Processing Flow Helius → API Gateway → Lambda → Event Processor → User Database Writers
-
Event Examples
- NFT Sales
- Token Swaps
- Account Updates
- Local PostgreSQL support
- Drizzle migrations
- SST development tunnel
- Database studio tools
/db
/schema/
users.ts
index.ts
[other schema files to be created]
/auth
auth.ts
/infra
database.ts
vpc.ts
- SST-managed infrastructure
- Environment-specific database configs
- Drizzle ORM setup
- SSL configuration (currently disabled for development)