File tree Expand file tree Collapse file tree 4 files changed +26
-5
lines changed Expand file tree Collapse file tree 4 files changed +26
-5
lines changed Original file line number Diff line number Diff line change 58
58
"@fastify/type-provider-typebox" : " ^3.2.0" ,
59
59
"@google-cloud/storage" : " ^7.12.1" ,
60
60
"@hirosystems/api-toolkit" : " ^1.7.1" ,
61
- "@hirosystems/chainhook-client" : " ^2.0 .0" ,
61
+ "@hirosystems/chainhook-client" : " ^2.4 .0" ,
62
62
"@sinclair/typebox" : " ^0.28.17" ,
63
63
"@stacks/transactions" : " ^6.1.0" ,
64
64
"@types/node" : " ^20.16.1" ,
Original file line number Diff line number Diff line change 4
4
EventObserverOptions ,
5
5
EventObserverPredicate ,
6
6
Payload ,
7
+ Predicate ,
7
8
StacksPayload ,
8
9
} from '@hirosystems/chainhook-client' ;
9
10
import { PgStore } from '../pg/pg-store' ;
@@ -66,6 +67,18 @@ export async function startChainhookServer(args: { db: PgStore }): Promise<Chain
66
67
predicate_disk_file_path : ENV . CHAINHOOK_PREDICATE_PATH ,
67
68
predicate_health_check_interval_ms : 300_000 ,
68
69
node_type : 'chainhook' ,
70
+ predicate_re_register_callback : async predicate => {
71
+ const blockHeight = await args . db . getChainTipBlockHeight ( ) ;
72
+ switch ( ENV . NETWORK ) {
73
+ case 'mainnet' :
74
+ if ( predicate . networks . mainnet ) predicate . networks . mainnet . start_block = blockHeight ;
75
+ break ;
76
+ case 'testnet' :
77
+ if ( predicate . networks . testnet ) predicate . networks . testnet . start_block = blockHeight ;
78
+ break ;
79
+ }
80
+ return predicate as Predicate ;
81
+ } ,
69
82
} ;
70
83
const chainhook : ChainhookNodeOptions = {
71
84
base_url : `http://${ ENV . CHAINHOOK_NODE_RPC_HOST } :${ ENV . CHAINHOOK_NODE_RPC_PORT } ` ,
Original file line number Diff line number Diff line change @@ -1290,6 +1290,7 @@ export class TestChainhookPayloadBuilder {
1290
1290
} ,
1291
1291
is_streaming_blocks : true ,
1292
1292
} ,
1293
+ events : [ ] ,
1293
1294
} ;
1294
1295
private action : 'apply' | 'rollback' = 'apply' ;
1295
1296
private get lastBlock ( ) : StacksEvent {
@@ -1330,6 +1331,13 @@ export class TestChainhookPayloadBuilder {
1330
1331
pox_cycle_length : 2100 ,
1331
1332
pox_cycle_position : 1722 ,
1332
1333
stacks_block_hash : '0xbccf63ec2438cf497786ce617ec7e64e2b27ee023a28a0927ee36b81870115d2' ,
1334
+ tenure_height : null ,
1335
+ block_time : null ,
1336
+ signer_bitvec : null ,
1337
+ signer_signature : null ,
1338
+ signer_public_keys : null ,
1339
+ cycle_number : null ,
1340
+ reward_set : null ,
1333
1341
} ,
1334
1342
parent_block_identifier : {
1335
1343
hash : '0xca71af03f9a3012491af2f59f3244ecb241551803d641f8c8306ffa1187938b4' ,
You can’t perform that action at this time.
0 commit comments