Skip to content

Commit

Permalink
fix: max start block height for signer predicate messages (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
zone117x authored Nov 1, 2024
1 parent 092806b commit 6d16ff2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/chainhook/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ export async function startChainhookServer(args: { db: PgStore }): Promise<Chain
const blockHeight = await args.db.getChainTipBlockHeight();
logger.info(`ChainhookServer is at block ${blockHeight}`);

const startHeight = ENV.NETWORK === 'mainnet' ? 171800 : 1;
const startBlock = Math.max(startHeight, blockHeight);

const predicates: EventObserverPredicate[] = [];
if (ENV.CHAINHOOK_AUTO_PREDICATE_REGISTRATION) {
predicates.push({
Expand All @@ -22,17 +25,14 @@ export async function startChainhookServer(args: { db: PgStore }): Promise<Chain
chain: 'stacks',
networks: {
[ENV.NETWORK]: {
startBlock: blockHeight,
start_block: startBlock,
if_this: {
scope: 'signer_message',
after_timestamp: 1,
},
},
},
});

const startHeight = ENV.NETWORK === 'mainnet' ? 171800 : 1;
const startBlock = Math.max(startHeight, blockHeight);
predicates.push({
name: 'signer-metrics-api-blocks',
version: 1,
Expand Down

0 comments on commit 6d16ff2

Please sign in to comment.