@@ -223,6 +223,118 @@ Common issues and solutions:
223223 - Check if specific senders are having aggregation issues
224224 - Monitor the Grafana dashboard for aggregation patterns
225225
226+ ## Horizon (TAP V2 ) Migration
227+
228+ Horizon is the next - generation Graph protocol with updated smart contracts and a new receipt format (V2 ). This section covers how to enable Horizon support in your indexer stack .
229+
230+ ### Critical : Both Services Must Be Configured
231+
232+ > ** Warning ** : ` indexer-service-rs ` and ` indexer-tap-agent ` have ** separate configurations ** and ** both must have Horizon enabled ** for V2 receipts to be processed correctly .
233+ >
234+ > A common misconfiguration is enabling Horizon only on ` indexer-service ` while leaving ` tap-agent ` in legacy mode . This results in :
235+ >
236+ > - ` indexer-service ` accepting V2 receipts and storing them in the database
237+ > - ` tap-agent ` ignoring all Horizon allocations (showing 0 allocations tracked )
238+ > - ** No RAVs created , no redemptions possible **
239+
240+ ### Horizon Configuration Checklist
241+
242+ #### Step 1 : Obtain Horizon Contract Addresses
243+
244+ You need two new addresses for Horizon (check [The Graph documentation ](https :// thegraph.com/docs/en/tap/#blockchain-addresses) for current values):
245+
246+ | Contract | Purpose |
247+ | ------------------------------ | ---------------------------------------------------- - |
248+ | ` receipts_verifier_address_v2 ` | TAP Verifier V2 contract for Horizon receipts |
249+ | ` subgraph_service_address ` | Subgraph Service contract for allocation verification |
250+
251+ #### Step 2 : Update Configuration File
252+
253+ Add the Horizon settings to your shared TOML configuration :
254+
255+ ` ` ` toml
256+ [blockchain]
257+ chain_id = 42161
258+ # Legacy V1 verifier (keep for existing receipts)
259+ receipts_verifier_address = "0x33f9E93266ce0E108fc85DdE2f71dab555A0F05a"
260+ # Horizon V2 addresses
261+ receipts_verifier_address_v2 = "0x..." # Get from The Graph docs
262+ subgraph_service_address = "0x..." # Get from The Graph docs
263+
264+ [horizon]
265+ enabled = true
266+ ` ` `
267+
268+ #### Step 3 : Configure Environment Variables (if not using config file )
269+
270+ If you use environment variables , you must set them for ** both services ** :
271+
272+ ` ` ` bash
273+ # For indexer-service
274+ export INDEXER_SERVICE__HORIZON__ENABLED=true
275+ export INDEXER_SERVICE__BLOCKCHAIN__RECEIPTS_VERIFIER_ADDRESS_V2="0x..."
276+ export INDEXER_SERVICE__BLOCKCHAIN__SUBGRAPH_SERVICE_ADDRESS="0x..."
277+
278+ # For tap-agent (REQUIRED - don't forget this!)
279+ export TAP_AGENT__HORIZON__ENABLED=true
280+ export TAP_AGENT__BLOCKCHAIN__RECEIPTS_VERIFIER_ADDRESS_V2="0x..."
281+ export TAP_AGENT__BLOCKCHAIN__SUBGRAPH_SERVICE_ADDRESS="0x..."
282+ ` ` `
283+
284+ #### Step 4 : Verify Configuration
285+
286+ After restarting both services , check the logs to confirm Horizon is active :
287+
288+ ** indexer - service logs (expected ):**
289+
290+ ` ` `
291+ INFO indexer_service_rs::service: Horizon mode configured - checking if Horizon contracts are active
292+ INFO indexer_service_rs::service: Horizon contracts detected - using Horizon migration mode
293+ ` ` `
294+
295+ ** tap - agent logs (expected ):**
296+
297+ ` ` `
298+ INFO indexer_tap_agent::agent: Horizon mode configured - checking if Horizon contracts are active
299+ INFO indexer_tap_agent::agent::sender_accounts_manager: horizon_active: true
300+ ` ` `
301+
302+ ** tap - agent logs (PROBLEM - Horizon not enabled ):**
303+
304+ ` ` `
305+ INFO indexer_tap_agent::agent: Horizon not configured - using pure legacy mode
306+ INFO indexer_tap_agent::agent::sender_accounts_manager: horizon_active: false
307+ ` ` `
308+
309+ If you see " pure legacy mode" in tap - agent but have Horizon allocations , your receipts will not be processed !
310+
311+ ### Horizon Migration Modes
312+
313+ When Horizon is enabled and contracts are detected :
314+
315+ - ** Hybrid Migration Mode ** : The system accepts new V2 receipts while continuing to process existing V1 receipts
316+ - ** V2 Receipts Only ** : New queries generate V2 receipts (stored in ` scalar_tap_receipts_v2 ` table )
317+ - ** Legacy Processing ** : Existing V1 receipts continue to be aggregated until allocations close
318+
319+ ### Troubleshooting Horizon
320+
321+ 1. ** TAP agent shows 0 allocations but you have Horizon allocations ** :
322+ - Check that ` TAP_AGENT__HORIZON__ENABLED=true ` is set
323+ - Verify ` subgraph_service_address ` is configured for tap - agent
324+ - Look for " pure legacy mode" in tap - agent logs
325+
326+ 2. ** " mismatched" allocations in tap - agent logs ** :
327+
328+ ` ` `
329+ total: 788, legacy: 0, horizon: 788, mismatched: 788, normalized: 0
330+ ` ` `
331+
332+ This indicates tap - agent is in legacy mode but all your allocations are Horizon . Enable Horizon on tap - agent .
333+
334+ 3. ** Receipts stored but not aggregated ** :
335+ - Confirm both services have matching ` receipts_verifier_address_v2 ` values
336+ - Check that ` subgraph_service_address ` matches between services
337+
226338## Deployment Options
227339
228340### Docker Compose
0 commit comments