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

MethodParameterExample
By heightblock_height{ block_height: 100000 }
By hashindex_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 CaseDescriptionExample
DebugInvestigate missed eventsEvaluate specific block that should have triggered
BackfillIndex historical dataProcess past blocks after creating chainhook
Re-processFix webhook handler issuesRe-evaluate after fixing bugs

Best Practices

PracticeExample
Rate limitingAdd 100ms delay between requests
Test firstEvaluate 2-3 sample blocks before bulk processing
Use heightEasier to iterate than block hashes

How is this guide?