diff --git a/.gitignore b/.gitignore index b512c09..b7d4aa3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -node_modules \ No newline at end of file +node_modules +config.js +package-lock.json diff --git a/config.example.js b/config.example.js new file mode 100644 index 0000000..89152ff --- /dev/null +++ b/config.example.js @@ -0,0 +1 @@ +module.exports.rpcURL = 'http://bitcoin:bitcoin@127.0.0.1:8332'; diff --git a/lib/rpc.js b/lib/rpc.js index ac7fa56..53032fa 100644 --- a/lib/rpc.js +++ b/lib/rpc.js @@ -1,5 +1,6 @@ 'use strict'; var request = require('request'); +var config = require('../config'); var Rpc = function() { @@ -8,13 +9,14 @@ var Rpc = function() { Rpc.prototype.callMethod = function(method, params, callback) { request({ method: 'POST', - url: 'http://bitcoin:bitcoin@127.0.0.1:8332', + url: config.rpcURL, body: { jsonrpc: '1.0', id: Date.now(), method: method, params: params }, + rejectUnauthorized: false, json: true }, function(err, res, body) { if(err) {