From a53d6852f534c63964d42bfb12fd12360769c9a5 Mon Sep 17 00:00:00 2001 From: Shannon Appelcline Date: Thu, 15 Jun 2017 11:31:58 -0700 Subject: [PATCH] Create 12_3_Accessing_Bitcoind_with_Node.md --- 12_3_Accessing_Bitcoind_with_Node.md | 29 ++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 12_3_Accessing_Bitcoind_with_Node.md diff --git a/12_3_Accessing_Bitcoind_with_Node.md b/12_3_Accessing_Bitcoind_with_Node.md new file mode 100644 index 0000000..c815173 --- /dev/null +++ b/12_3_Accessing_Bitcoind_with_Node.md @@ -0,0 +1,29 @@ +# 12.3: Accessing Bitcoind with Node + +> **NOTE:** This is a draft in progress, so that I can get some feedback from early reviewers. It is not yet ready for learning. + +Accessing the `bitcoind` doesn't require `curl`. All you need is simple RPC functionality. That's what's provided by [BCRPC](https://github.com/dgarage/bcrpc) by kallewoof of Digital Garage. + +## Setting Up Node.js + +BCRPC is built on node.js. Thus, you'll first need to install the `node.js` and `npm` (node package manager) packages for your system. + +If you're using a Ubuntu machine, you can run the following commands to get a new version of `node.js` (as opposed to the horribly out-of-date version in the Ubuntu package system). +``` +curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - +sudo apt-get install -y nodejs +sudo apt-get install mocha -g +``` +### Setting Up BCRPC + +You should next download BCRPC from the [BCRPC Repository](https://github.com/dgarage/bcrpc). Clone it or download it, as you prefer. + +Once you've done that, you can finish setting it up: +``` +$ unzip bcrpc-master.zip +$ cd bcrpc-master +$ npm install +``` + +### Testing BCRPC +