New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@wavesenterprise/waves-node-listener-service

Package Overview
Dependencies
Maintainers
7
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wavesenterprise/waves-node-listener-service

Waves Node blockchain events listener and parser

latest
npmnpm
Version
1.2.2
Version published
Maintainers
7
Created
Source

Waves blockchain node listener

Install

$ npm i @wavesenterprise/waves-node-listener-service

or

$ yarn add @wavesenterprise/waves-node-listener-service

Use

// app.module.ts
import { WavesNodeListenerModule } from '@wavesenterprise/we-node-grpc-api-nest'
import { AppService } from './app.service'

@Module({
  imports: [
    WavesNodeListenerModule.forRoot({
      blockchainStreamAddress: 'nodes-testnet.wavesnodes.com:6881',
      reconnectDelay: 5000,
      reconnectOnClose: true,
      reconnectOnError: false,
      // Dead connection checks time since last received message
      deadConnectionCheckInterval: 5000,
      deadConnectionTimeout: 60000,
      reconnectOnDeadConnection: true,
    })
  ],
  providers: [AppService],
})
export class AppModule {
}
// app.service.ts
import { WavesNodeListenerService } from '@wavesenterprise/waves-node-listener-service'
import { Injectable, OnApplicationBootstrap } from '@nestjs/common'

@Injectable()
export class AppService implements OnApplicationBootstrap {

  constructor(
    private readonly nodeListenerService: WavesNodeListenerService,
  ) {
  }

  async onApplicationBootstrap() {
    this.nodeListenerService.on('block', (data) => {
      this.nodeListenerService.setLastProcessedBlock(data.height)
    })
    this.nodeListenerService.on('microblock', (data) => {
      // process microblock (optional)
    })
    this.nodeListenerService.on('rollbackCompleted', (data) => {
      // delete rollbacked data 
    })
    await this.nodeListenerService.connect()
  }
}

Notes

Also emits raw stream events:
close
error
pause
resume
data

If deadConnectionTimeout and deadConnectionCheckInterval props are set, emits dead event

Keywords

grpc

FAQs

Package last updated on 28 Jul 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts