EventHorizon is a decentralized "If-This-Then-That" (IFTTT) platform that listens for specific events emitted by Stellar Soroban smart contracts and triggers real-world Web2 actions like webhooks, Discord notifications, or emails.
- If This: A Soroban smart contract emits an event (e.g.,
SwapExecuted,LiquidityAdded). - Then That: EventHorizon's worker detects the event and triggers a configured action (e.g., POST to a webhook).
/backend: Node.js/Express server and Soroban event poller worker./frontend: Vite/React dashboard for managing triggers./contracts/boilerplate: Boilerplate Soroban Rust contract for testing./contracts/token_vesting: Secure token vesting contract with linear release and cliff./contracts/staking: Reward-based staking contract with early unstake penalties.
- Node.js (v18+)
- MongoDB
- Redis (optional, for background job processing - see REDIS_OPTIONAL.md)
- Rust & Soroban CLI (for contracts)
- Copy
.env.exampleto.envin both root and subdirectories. - Update
SOROBAN_RPC_URL(e.g.,https://soroban-testnet.stellar.org). - Update
MONGO_URI.
# Install dependencies
npm run install:all
# Start backend
npm run dev:backend
# Start frontend
npm run dev:frontend- Interactive Swagger UI is available at
/api/docswhen the backend is running. - Raw OpenAPI JSON is available at
/api/docs/openapi.json.
EventHorizon uses BullMQ with Redis for reliable background processing of trigger actions:
- Guaranteed delivery with automatic retries
- Concurrency control for external API calls
- Job monitoring via
/api/queue/statsendpoint - Optional: Works without Redis (falls back to direct execution)
- See backend/QUEUE_SETUP.md for setup instructions
- See backend/REDIS_OPTIONAL.md for fallback behavior
- Deploy the contract in
/contracts. - Copy the Contract ID.
- Add a new trigger in the dashboard using the Contract ID and event name
test_event. - Invoke the
trigger_eventfunction on the contract. - Watch the backend logs/webhook for the triggered action!