A Farcaster bot that tracks and broadcasts Stokefire game events in real-time. The bot monitors various in-game activities such as gathering resources, building huts, battles, and more, posting updates to Farcaster as they happen.
- Real-time monitoring of Stokefire game events
- Posts activity updates to Farcaster
- Supports multiple event types:
- Resource gathering (food, wood)
- Building construction
- Battle events
- Defense commitments
- Village raids
- Chronological event ordering
- Persistent event tracking with Redis
- Graceful error handling and shutdown
- Node.js >= 18.0.0
- Redis server (or connection URL)
- Neynar API key for Farcaster
- npm or yarn
- Clone the repository:
git clone https://github.com/yourusername/stokefire-bot.git
cd stokefire-bot
- Install dependencies:
npm install
- Create a
.env
file in the root directory:
# Required: Your Neynar API key for Farcaster
NEYNAR_API_KEY=your_neynar_api_key
# Optional: Redis configuration (defaults shown)
REDIS_URL=redis://red-csbuue08fa8c738qgh1g:6379
Run the bot in development mode with hot reloading:
npm run dev
Build and run the bot in production mode:
npm run build
npm start
npm run dev
- Run in development mode with hot reloadingnpm run build
- Build the TypeScript codenpm start
- Run the built code in productionnpm run lint
- Check for linting issuesnpm run lint:fix
- Fix linting issues automaticallynpm run format
- Format code with Prettiernpm run typecheck
- Run TypeScript type checkingnpm run clean
- Clean the build directory
The bot tracks and posts the following events:
-
Gather Food
- Format:
@username gathered X food with Y villagers
- Format:
-
Chop Wood
- Format:
@username gathered X wood with Y villagers
- Format:
-
Build Hut
- Format:
@username built X hut(s)
- Format:
-
Commit Defense
- Format:
@username committed their defense
- Format:
-
Attack Village
- Format:
@username raided @defender's village, tried to steal X resources
- Format:
-
Reveal Battle
- Format:
@username revealed battle. @winner won X resource
- Format:
Variable | Description |
---|---|
NEYNAR_API_KEY |
Neynar API key for Farcaster |
NEYNAR_SIGNER_UUID |
Neynar Signer key for the bot |
REDIS_URL |
Redis connection URL |
The bot processes events in batches. You can adjust the batch size by modifying the BATCH_SIZE
constant in src/index.ts
(default: 25).
- TypeScript-based Node.js application
- GraphQL for event data fetching
- Redis for event tracking
- Automated error handling and recovery
- Graceful shutdown handling
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Pull Request
MIT
- Stokefire game and API
- Neynar for Farcaster API access
- Contributors and maintainers