Evaluate Chainhook
Test chainhooks against specific past blocks
Test your chainhook configuration against specific past blocks for testing, debugging, and historical indexing.
evaluateChainhook
Evaluation Methods
| Method | Parameter | Example |
|---|---|---|
By height | block_height | { block_height: 100000 } |
By hash | index_block_hash | { index_block_hash: '0xa204...' } |
Example
import { ChainhooksClient, CHAINHOOKS_BASE_URL } from '@hirosystems/chainhooks-client';const client = new ChainhooksClient({baseUrl: CHAINHOOKS_BASE_URL.testnet,apiKey: process.env.HIRO_API_KEY!,});await client.evaluateChainhook('chainhook-uuid', {block_height: 100000,});
Returns HTTP 204 No Content. If filters match, webhook payload is sent to your action.url.
cURL
curl -X POST \"https://api.testnet.hiro.so/chainhooks/me/chainhook-uuid/evaluate" \-H "x-api-key: $HIRO_API_KEY" \-H "content-type: application/json" \-d '{ "block_height": 100000 }'
Use Cases
| Use Case | Description | Example |
|---|---|---|
Debug | Investigate missed events | Evaluate specific block that should have triggered |
Backfill | Index historical data | Process past blocks after creating chainhook |
Re-process | Fix webhook handler issues | Re-evaluate after fixing bugs |
Best Practices
| Practice | Example |
|---|---|
Rate limiting | Add 100ms delay between requests |
Test first | Evaluate 2-3 sample blocks before bulk processing |
Use height | Easier to iterate than block hashes |