1
const DManage = new web3.eth.Contract(myABI, '0x9420D0904B2F696f8612239e5a507A86B5dA1b6a');
DManage.events.allEvents()
.on('data', (response) => {
    console.log(event);
})
.on('changed', (response) => {
    // remove event from local database
})
.on('error', console.error);

When I run this, the code executes without any errors. Why doesn't it go "daemon" mode? Shouldn't it listen to future events?

How can I get the web3 event listner (code above) run as a daemon? So that each time a event is emitted it will execute some code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.