0.0.9 • Published 7 years ago

geth-js v0.0.9

Weekly downloads
12
License
MIT
Repository
github
Last release
7 years ago

geth-js

A simple Node.js controller for go-ethereum ('geth').

Install

$ npm install geth-js

Usage

var Geth = require('..');
var geth = new Geth({datadir: '/mnt/ssd/.ethereum'});


geth.start().then(function () {
	console.log('timestamp,number,size,tx_count,volume');
	geth.rpc.eth.filter('latest', function (err, block) {
		if (!err) {
			var block = geth.rpc.eth.getBlock(block);
			var txs   = block.transactions.map(tx => geth.rpc.eth.getTransaction(tx));
			block.volume = 0;
			txs.forEach((tx) => {volume += parseInt(txs.value)});
			var data = [block.timestamp,block.number, block.size, block.txs.length, block.volume];
			console.log(data.join(','));
		}
	})
})
0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago

0.0.0

7 years ago