diff --git a/README.md b/README.md index 96ff2459..69bc9c9f 100644 --- a/README.md +++ b/README.md @@ -7,4 +7,4 @@ mystery There is a bitcoind configuration sample at: ``` etc/mystery/bitcoin.conf -```: +``` diff --git a/etc/bitcoind/bitcoin.conf b/etc/bitcoind/bitcoin.conf index 50bac191..062c09e0 100644 --- a/etc/bitcoind/bitcoin.conf +++ b/etc/bitcoind/bitcoin.conf @@ -1,11 +1,12 @@ rpcuser=mystery rpcpassword=real_mystery server=1 -rpcallowip=127.0.0.1 rpcport=8332 -testnet=1 +testnet=3 txindex=1 +# Allow connections outsite localhost? +# rpcallowip=192.168.0.* diff --git a/util/get_block.js b/util/get_block.js new file mode 100755 index 00000000..27880d8f --- /dev/null +++ b/util/get_block.js @@ -0,0 +1,27 @@ +#!/usr/bin/env node + + + +var RpcClient = require('../node_modules/bitcore/RpcClient').class(); + + +var block_hash = process.argv[2] || '0000000000b6288775bbd326bedf324ca8717a15191da58391535408205aada4'; + +var rpc = new RpcClient({ + user: 'mystery', + pass: 'real_mystery', + protocol: 'http', +}); + +var block = rpc.getBlock(block_hash, function(err, block) { + + console.log("Err:"); + console.log(err); + + + console.log("Block info:"); + console.log(block); +}); + + +