getblock working!
This commit is contained in:
parent
6f90dce4e0
commit
1c96756743
|
@ -4,5 +4,10 @@ module.exports = {
|
|||
db: "mongodb://localhost/mystery-dev",
|
||||
app: {
|
||||
name: "Mystery - Development"
|
||||
},
|
||||
bitcoind: {
|
||||
user: 'mystery',
|
||||
pass: 'real_mystery',
|
||||
protocol: 'http',
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,9 @@ module.exports = function(app) {
|
|||
var index = require('../app/controllers/index');
|
||||
app.get('/', index.render);
|
||||
|
||||
//TX routes
|
||||
//
|
||||
//Block routes
|
||||
|
||||
var blocks = require('model/app/controllers/blocks');
|
||||
app.get('/block/:block_hash', blocks.show);
|
||||
|
||||
};
|
||||
|
|
|
@ -32,6 +32,7 @@
|
|||
"postinstall": "node node_modules/bower/bin/bower install"
|
||||
},
|
||||
"dependencies": {
|
||||
"classtool": "*",
|
||||
"express": "~3.4.7",
|
||||
"jade": "~1.0.2",
|
||||
"mongoose": "~3.8.3",
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
#!/usr/bin/env node
|
||||
|
||||
|
||||
process.env.NODE_ENV = process.env.NODE_ENV || 'development';
|
||||
|
||||
var RpcClient = require('../node_modules/bitcore/RpcClient').class();
|
||||
|
||||
var config = require('../config/config');
|
||||
|
||||
|
||||
var block_hash = process.argv[2] || '0000000000b6288775bbd326bedf324ca8717a15191da58391535408205aada4';
|
||||
|
||||
var rpc = new RpcClient({
|
||||
user: 'mystery',
|
||||
pass: 'real_mystery',
|
||||
protocol: 'http',
|
||||
});
|
||||
|
||||
var rpc = new RpcClient(config.bitcoind);
|
||||
|
||||
var block = rpc.getBlock(block_hash, function(err, block) {
|
||||
|
||||
|
|
Loading…
Reference in New Issue