Hi, I am trying to listen for all transaction on an address using the websocket provided. But when I did a test transaction to check for the functionality, it didn’t work and also got no errors. Can someone help with what am doing wrong? Below is the code I used to listen for log events in node js.
const Web3 = require("web3");
let web3 = new Web3(
new Web3.providers.WebsocketProvider(
"wss://kovan.infura.io/ws/v3/ID"
)
);
var subscription = web3.eth
.subscribe(
"logs",
{
address: "some example address",
},
(error, result) => {
if (!error) console.log("Result - " + result);
}
)
.on("data", (log) => console.log("Data - " + log))
.on("changed", (log) => console.log("Changed - " + log))
.on("connected", (log) => console.log("Subscription connected!"));
The connected event fires up on starting the server though.