solidity – How to Listen to Smart Contract Events from a NodeJS-ExpressJS Server

eventsexpressnodejssolidity

I am developing a smart contract project and I need to listen events on my expressjs-server. Is it possible to listen events from there?

Best Answer

You can use Graph to subscribe to event from your contract from your expressjs-server https://ethereum.org/en/developers/tutorials/the-graph-fixing-web3-data-querying/#gatsby-focus-wrapper as an alternative you can use Ethers.JS https://docs.ethers.io/v5/concepts/events/

Related Topic