File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " @kryptokrauts/event-processor-node-lib" ,
3- "version" : " 1.0.11 " ,
3+ "version" : " 1.0.12 " ,
44 "description" : " Wrapper for ease listening on antelope blockchain based on @blockmatic/antelope-ship-reader" ,
55 "main" : " dist/index.js" ,
66 "types" : " dist/index.d.ts" ,
Original file line number Diff line number Diff line change @@ -44,6 +44,7 @@ export interface ShipReaderWrapperConfig {
4444 table_rows_whitelist : ( ) => EosioReaderTableRowFilter [ ] ;
4545 actions_whitelist : ( ) => EosioReaderActionFilter [ ] ;
4646 only_irreversible_blocks : boolean ;
47+ emit_current_blocknum : boolean ;
4748}
4849
4950export interface ActionData {
Original file line number Diff line number Diff line change @@ -155,7 +155,16 @@ export class ShipReaderWrapper {
155155 // subscribe to incoming blocks event
156156 this . subscriptions . push (
157157 blocks$ . pipe < EosioReaderBlock > ( takeWhile ( ( ) => ! this . forked ) ) . subscribe ( async block => {
158- logger . trace ( `Current block ${ this . current_block } ` ) ;
158+ logger . trace ( `Current block ${ block . block_num } ` ) ;
159+
160+ if ( this . config . emit_current_blocknum ) {
161+ await this . kafka_wrapper . sendEvent (
162+ JSON . stringify ( {
163+ blocknum : block . block_num ,
164+ } ) ,
165+ 'current_block' ,
166+ ) ;
167+ }
159168
160169 // since replaying blocks is much faster, check within greater block-span
161170 let syncStateCheckInterval : number = 10 * sync_message_block_interval ;
You can’t perform that action at this time.
0 commit comments