
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
composer-events-subscriber
Advanced tools
Composer create for us a set of transactions to make CRUD operations on assets and participants. For now, it's not possible to listen for events from those transactions without using the native api. This module connects to an eventHub from your hyperledger fabric network, and listens for all transactions that are submitted. It dispatchs all events that you can listen to do what you need.
The class Subscriber extends the node js EventEmitter from events module
Using npm
npm install composer-events-subscriber --save
Or using yarn
yarn add composer-events-subscriber
import Subscriber from 'composer-events-subscriber'
//connect to the business network using the composer-client
businessNetwork.connect('cardName').then((invokedTx, historianTx) => {
const subscriber = new Subscriber(businessNetwork)
//subscribe to event hub
const unsubscribe = subscriber.subscribe()
//listen for all transaction
subscriber.on('tx', (tx, historianTx)=> {
console.log('All events')
}).on('error', e => {
console.log('ERROR')
})
//unsubscribe on process exit
process.on('exit', () => unsubscribe())
})
import Subscriber from 'composer-events-subscriber'
//connect to the business network using the composer-client
businessNetwork.connect('cardName').then(=> {
const subscriber = new Subscriber(businessNetwork)
//subscribe to event hub
const unsubscribe = subscriber.subscribe()
//listen for a named transaction
subscriber.on('tx:org.hyperledger.composer.system.UpdateParticipant', (tx, historianTx) => {
console.log('EVENT')
}).on('error', e => {
console.log('ERROR')
})
//unsubscribe on process exit
process.on('exit', () => unsubscribe())
})
FAQs
Subscribe to business network events
The npm package composer-events-subscriber receives a total of 0 weekly downloads. As such, composer-events-subscriber popularity was classified as not popular.
We found that composer-events-subscriber demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.