This directory contains TypeScript examples for interacting with wIndexer and Solana.
- Node.js (v16 or later)
- npm or bun
- Local Solana validator running with Geyser plugin
- wIndexer node running
-
Install dependencies:
npm installor with bun:
bun install -
Make sure your services are running:
# Terminal 1: Run Solana validator with Geyser plugin cd /home/vivek/projects/aletheia/windexer/windexer make run-validator-with-geyser # Terminal 2: Run wIndexer node cd /home/vivek/projects/aletheia/windexer/windexer make run-node-0
The simplest way to generate test transactions:
npm run simple-tx
This script sends simple transactions without requiring WebSocket confirmation.
npm run query-solana
This script queries basic information from your local Solana validator.
npm run websocket
This script subscribes to Solana events via WebSockets.
npm run query-windexer
This script queries the wIndexer API for indexed transactions and accounts.
If you encounter WebSocket errors with generate-data.ts, try using the simpler
simple-tx.ts script which doesn't rely on WebSockets for confirmation:
npm run simple-tx
If automatic airdrops fail, you can use the Solana CLI to request an airdrop:
solana airdrop 2 YOUR_WALLET_ADDRESS --url http://localhost:8999
Run npm install to ensure all dependencies are installed correctly.