You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
619 B
29 lines
619 B
'use strict';
|
|
|
|
// Replace '..' with 'bitcore' if you plan on using this code elsewhere.
|
|
|
|
var util = require('util');
|
|
var RpcClient = require('../RpcClient').class();
|
|
var hash = process.argv[2] || '0000000000b6288775bbd326bedf324ca8717a15191da58391535408205aada4';
|
|
|
|
var config = {
|
|
protocol: 'http',
|
|
user: 'user',
|
|
pass: 'pass',
|
|
host: '127.0.0.1',
|
|
port: '18332',
|
|
};
|
|
|
|
var rpc = new RpcClient(config);
|
|
|
|
rpc.getBlock(hash, function(err, ret) {
|
|
|
|
if(err) {
|
|
console.error("An error occured fetching block", hash);
|
|
console.error(err);
|
|
return;
|
|
}
|
|
|
|
console.log(ret);
|
|
|
|
});
|
|
|