From 22890b8863240321eb7ad50e58e9222ae8b2ffc1 Mon Sep 17 00:00:00 2001 From: Braydon Fuller Date: Wed, 5 Aug 2015 08:15:13 -0400 Subject: [PATCH] Error message and environment variable fix for bin/start.js --- README.md | 2 +- bin/start.js | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 454d646d..7e93674a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ Bitcore Node ======= -A Node.js module that adds a native interface to Bitcoin Core for querying information about the Bitcoin blockchain. Bindings are linked to Bitcore Core compiled as a shared library. +A Node.js module that adds a native interface to Bitcoin Core for querying information about the Bitcoin blockchain. Bindings are linked to Bitcoin Core compiled as a shared library. ## Install diff --git a/bin/start.js b/bin/start.js index 24d2a122..8b63d2f4 100644 --- a/bin/start.js +++ b/bin/start.js @@ -7,8 +7,8 @@ var log = chainlib.log; log.debug = function() {}; var configuration = { - datadir: process.env.BITCOINDJS_DIR || '~/.bitcoin', - network: process.env.BITCOINDJS_NETWORK || 'livenet', + datadir: process.env.BITCORENODE_DIR || '~/.bitcoin', + network: process.env.BITCORENODE_NETWORK || 'livenet', port: 3000 }; @@ -56,7 +56,9 @@ node.on('ready', function() { if(params.length !== methodsMap[message.method].args) { return socketCallback({ - error: 'Expected ' + methodsMap[message.method].args + ' parameters' + error: { + message: 'Expected ' + methodsMap[message.method].args + ' parameters' + } }); } @@ -83,7 +85,9 @@ node.on('ready', function() { methodsMap[message.method].fn.apply(this, params); } else { socketCallback({ - error: 'Method Not Found' + error: { + message: 'Method Not Found' + } }); } });