Created
February 24, 2017 08:09
-
-
Save bas-vk/760016a986ae50a2f01829401ac46c2a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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