From bfefdcdc545faaa646afc05dc82e2c30822f8c0c Mon Sep 17 00:00:00 2001 From: Shannon Appelcline Date: Wed, 2 Sep 2020 14:01:43 -1000 Subject: [PATCH] Create 17_3_getinfo.js --- src/17_3_getinfo.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 src/17_3_getinfo.js diff --git a/src/17_3_getinfo.js b/src/17_3_getinfo.js new file mode 100644 index 0000000..3971724 --- /dev/null +++ b/src/17_3_getinfo.js @@ -0,0 +1,15 @@ +const RpcAgent = require('bcrpc'); +agent = new RpcAgent({port: 18332, user: 'StandUp', pass: '6305f1b2dbb3bc5a16cd0f4aac7e1eba'}); + +agent.getBlockCount(function (err, blockCount) { + if (err) + throw Error(JSON.stringify(err)); + console.log(blockCount.result); + + agent.getBlockHash(blockCount.result, function (err, hash) { + if (err) + throw Error(JSON.stringify(err)); + console.log(hash.result); + }) + +});