Error message and environment variable fix for bin/start.js

This commit is contained in:
Braydon Fuller 2015-08-05 08:15:13 -04:00
parent c21ff322b7
commit 22890b8863
2 changed files with 9 additions and 5 deletions

View File

@ -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

View File

@ -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'
}
});
}
});