Skip to content

Instantly share code, notes, and snippets.

@stefanhuber
Created November 10, 2016 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save stefanhuber/99d7609333e2aead6abf2b0c3b32c9db to your computer and use it in GitHub Desktop.
Save stefanhuber/99d7609333e2aead6abf2b0c3b32c9db to your computer and use it in GitHub Desktop.
Electrum Connection and Query
var client = net.connect(50001, 'electrum.no-ip.org', function() {
var message = JSON.stringify({
id : 234 ,
method : 'blockchain.address.get_balance' ,
params : ["1NS17iag9jJgTHD1VXjvLCEnZuQ3rJDE9L"]
});
client.write(message+"\n");
});
client.on('error', function(error) { console.log(error); });
client.on('data', function (data) {
console.log(data.toString());
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment