We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The chainhook client healthcheck code detects inactive predicates, and re-registers using the same predicate from when the app was started.
This causes chainhook to re-send old events starting at the block_height that the client specified on startup.
async function startChainhookServer() { const blockHeight = await db.getChainTipBlockHeight(); const predicate = { name: 'metadata-api-blocks', version: 1, chain: 'stacks', networks: { mainnet: { start_block: blockHeight, // <-- predicate re-registration uses whatever this value was on app start include_contract_abi: true, if_this: { scope: 'block_height', higher_than: 1, }, }, }, }; const observer: EventObserverOptions = { predicate_health_check_interval_ms: 300_000, // ... }; const server = new ChainhookEventObserver(observer, { ... }); await server.start([predicate], payload => db.processPayload(payload)); }
This could be solved with something like a callback where the client can provide an updated predicate for re-registration. E.g.:
const observer: EventObserverOptions = { predicate_health_check_interval_ms: 300_000, predicate_reregister_callback: async (predicate) => { predicate.networks.mainnet.start_block = await db.getChainTipBlockHeight(); return predicate; }, };
The text was updated successfully, but these errors were encountered:
rafaelcr
No branches or pull requests
The chainhook client healthcheck code detects inactive predicates, and re-registers using the same predicate from when the app was started.
This causes chainhook to re-send old events starting at the block_height that the client specified on startup.
This could be solved with something like a callback where the client can provide an updated predicate for re-registration. E.g.:
The text was updated successfully, but these errors were encountered: