Skip to content

Instantly share code, notes, and snippets.

@bas-vk
Created February 24, 2017 08:09
Show Gist options
  • Save bas-vk/760016a986ae50a2f01829401ac46c2a to your computer and use it in GitHub Desktop.
Save bas-vk/760016a986ae50a2f01829401ac46c2a to your computer and use it in GitHub Desktop.
var oboe = require('oboe')
var net = require('net');
var client = net.createConnection("/tmp/geth.ipc");
client.on("connect", function() {
oboe(client)
// called each time a full json object is parsed
.done(function(newHead){
console.log(newHead);
console.log();
});
client.write('{"id": 1, "method": "eth_subscribe", "params": ["newHeads"]}');
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment