'Web3 Listening event err
i am using web3 suscribe event for listening to incoming and outgoing transaction from rinkeby testnet. but i am not getting anything in console.even my transaction is succesful.
i use infura websocket provider
here is my code
const Web3 = require('web3');
const webs3 = new Web3(new Web3.providers.WebsocketProvider('wss://rinkeby.infura.io/ws/v3/projectid'));
var subscription = webs3.eth.subscribe('logs', {
address: '0x20617a33cf37387F35e0DA32aBdaDAF09D46B351',
topics: [null]
}, function(error, result){
if (!error)
console.log(result);
})
.on("data", function(log){
console.log(log);
})
.on("changed", function(log){
});
// unsubscribes the subscription
subscription.unsubscribe(function(error, success){
if(success)
console.log('Successfully unsubscribed!');
});
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
