Merge pull request #103 from braydonf/startfix
Error message and environment variable fix for bin/start.js
This commit is contained in:
commit
503d39dc89
@ -1,7 +1,7 @@
|
|||||||
Bitcore Node
|
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
|
## Install
|
||||||
|
|
||||||
|
|||||||
12
bin/start.js
12
bin/start.js
@ -7,8 +7,8 @@ var log = chainlib.log;
|
|||||||
log.debug = function() {};
|
log.debug = function() {};
|
||||||
|
|
||||||
var configuration = {
|
var configuration = {
|
||||||
datadir: process.env.BITCOINDJS_DIR || '~/.bitcoin',
|
datadir: process.env.BITCORENODE_DIR || '~/.bitcoin',
|
||||||
network: process.env.BITCOINDJS_NETWORK || 'livenet',
|
network: process.env.BITCORENODE_NETWORK || 'livenet',
|
||||||
port: 3000
|
port: 3000
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -56,7 +56,9 @@ node.on('ready', function() {
|
|||||||
|
|
||||||
if(params.length !== methodsMap[message.method].args) {
|
if(params.length !== methodsMap[message.method].args) {
|
||||||
return socketCallback({
|
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);
|
methodsMap[message.method].fn.apply(this, params);
|
||||||
} else {
|
} else {
|
||||||
socketCallback({
|
socketCallback({
|
||||||
error: 'Method Not Found'
|
error: {
|
||||||
|
message: 'Method Not Found'
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user