Last active
November 3, 2017 13:08
-
-
Save Alex-Werner/9fc45eaf42db5bc93bac054610f82c4b to your computer and use it in GitHub Desktop.
Revisions
-
Alex-Werner revised this gist
Nov 3, 2017 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -30,5 +30,14 @@ node.on('ready',function(){ }); }); dashd.on('block',function(block){console.log(block)}); dashd.on('tx',function(txData){ let tx = new bitcore.lib.Transaction(txData).toJSON(); let inputs = tx.inputs; inputs.forEach(function(input){ let script = new bitcore.lib.Script(input.script); let address = script.toAddress('testnet'); //Enjoy potato with address }) }); }); -
Alex-Werner created this gist
Oct 14, 2017 .There are no files selected for viewing
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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,34 @@ const bitcore = require('bitcore-node-dash'); const start = bitcore.scaffold.start; let config = { "network": "testnet", "port": 3001, "services": [ "bitcoind" ], "servicesConfig": { "bitcoind": { "connect": [{ "rpchost": "127.0.0.1", "rpcport": 9998, "rpcuser": "dash", "rpcpassword": "local321", "zmqpubrawtx": "tcp://127.0.0.1:28332" }] } } }; let node = start({path:"",config:config}); node.on('ready',function(){ console.log('Hey I\'m ready!') let dashd = node.services.bitcoind; dashd.getBestBlockHash(function(err, hash){ if(err){console.log(err);} dashd.getBlockHeader(hash,function(err, info){ console.log(info); }); }); dashd.on('block',function(block){console.log(block)}); dashd.on('tx',function(tx){console.log(tx)}); });