Skip to content
This repository has been archived by the owner on Sep 16, 2021. It is now read-only.

WebSocket subscribe on Address transaction #15

Open
SergeyEsipov opened this issue Feb 12, 2018 · 3 comments
Open

WebSocket subscribe on Address transaction #15

SergeyEsipov opened this issue Feb 12, 2018 · 3 comments

Comments

@SergeyEsipov
Copy link

"bitcoinAddress: new transaction concerning received from network. This event is published in the bitcoinAddress room."

How to use it?

I send:

io.emit('subscribe', "LTU2cds4aSdXFip9sV4gXphnhxGQjgfjmg");

and then:

io.on("LTU2cds4aSdXFip9sV4gXphnhxGQjgfjmg", function(data) {

console.log("New transaction LTU2cds4aSdXFip9sV4gXphnhxGQjgfjmg: ",data)

}).

But nothing happens. Transactions in the blockchain appear, but I do not get them.

Litecore works:
info: ::ffff:127.0.0.1 web socket subscribe: LTU2cds4aSdXFip9sV4gXphnhxGQjgfjmg

What am I doing wrong? Or how to do it? Just do not understand from the documentation .. :(

Please, help me.
Thank you!

@robertvo
Copy link

Hi Sergey, I am having the exact same problem. Did you find any solution/answer?

@phongnguyen91
Copy link

phongnguyen91 commented May 19, 2018

Hi all,

I got the same issue. After checking in the Insight-lite-ui to study how the framework subscribes to transaction change of address. I found out that they are using 'bitcoind/addresstxid' room to subscribe the socketIO, I checked with small code below and it's working.
`

<script src="your-domain/socket.io/socket.io.js"></script>

<script>
    socket = io("your-domain", {
  		transports: [ 'websocket' ]
	});
    socket.on('connect', function() {
        socket.nsp = "/";
        socket.emit('subscribe', 'bitcoind/addresstxid', ['mhNx3q2aZZYW5Hmex7VvUaDmJ1B8n3CP7Y']); // put list of addresses in the array
        socket.on('bitcoind/addresstxid', function(data) {
            console.log(data);
        });
    });
</script>

</body>
`

@robertvo
Copy link

thank you!!!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants