File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -147,7 +147,8 @@ async function init(): Promise<void> {
147
147
} ) ;
148
148
149
149
const skipChainIdCheck = parseBoolean ( process . env [ 'SKIP_STACKS_CHAIN_ID_CHECK' ] ) ;
150
- if ( ! skipChainIdCheck ) {
150
+ const snpEnabled = parseBoolean ( process . env [ 'SNP_EVENT_STREAMING' ] ) ;
151
+ if ( ! skipChainIdCheck && ! snpEnabled ) {
151
152
const networkChainId = await getStacksNodeChainID ( ) ;
152
153
if ( networkChainId !== configuredChainID ) {
153
154
const chainIdConfig = numberToHex ( configuredChainID ) ;
@@ -159,18 +160,20 @@ async function init(): Promise<void> {
159
160
throw error ;
160
161
}
161
162
}
162
- monitorCoreRpcConnection ( ) . catch ( error => {
163
- logger . error ( error , 'Error monitoring RPC connection' ) ;
164
- } ) ;
163
+ if ( ! snpEnabled ) {
164
+ monitorCoreRpcConnection ( ) . catch ( error => {
165
+ logger . error ( error , 'Error monitoring RPC connection' ) ;
166
+ } ) ;
167
+ }
165
168
166
- const snpEnabled = parseBoolean ( process . env [ 'SNP_EVENT_STREAMING' ] ) ;
167
169
if ( snpEnabled ) {
168
170
const lastRedisMsgId = await dbWriteStore . getLastIngestedSnpRedisMsgId ( ) ;
169
171
const snpStream = new SnpEventStreamHandler ( {
170
172
lastMessageId : lastRedisMsgId ,
171
173
db : dbWriteStore ,
172
174
eventServer,
173
175
} ) ;
176
+ await snpStream . start ( ) ;
174
177
registerShutdownConfig ( {
175
178
name : 'SNP client stream' ,
176
179
handler : ( ) => snpStream . stop ( ) ,
You can’t perform that action at this time.
0 commit comments