This question already has an answer here:

I want to get list of transactions by address and found example using web3.eth.subscribe. I wrote simple code from example

const Web3 = require('web3')
const web3 = new Web3(new Web3.providers.WebsocketProvider('ws://localhost:8546'))

web3.eth.subscribe('logs', options, function (err, res) {
    if (err)
.on("data", function(log){
.on("changed", function(log){
.on('error', function (err) {

but i dont get nothing. No console info or something like this.

marked as duplicate by Roman Frolov, Richard Horrocks, Achala Dissanayake, Luiz Soares, Jesse Busman Jan 20 '18 at 17:02

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.


web3.eth.subscribe works for subscribing to events, which can be coded in a smart contract. In your code sample you are looking for events named logs, error, changed and data.

In order to get all the transactions of one address, you need a fully unpruned Ethereum node.

Possible Duplicate Question: How to explore all transactions for a given account?

Not the answer you're looking for? Browse other questions tagged or ask your own question.