diff --git a/benchmarks/index.js b/benchmarks/index.js index 71e30864..29bc34ed 100644 --- a/benchmarks/index.js +++ b/benchmarks/index.js @@ -28,7 +28,7 @@ var fixtureData = { var bitcoind = require('../').services.Bitcoin({ node: { - datadir: process.env.HOME + '/.bitcoin', + datadir: process.env.HOME + '/.zcash', network: { name: 'testnet' } diff --git a/docs/services.md b/docs/services.md index 02eb1117..198c3312 100644 --- a/docs/services.md +++ b/docs/services.md @@ -49,7 +49,7 @@ var myNode = new bitcore.Node({ config: { spawn: { datadir: '/home//.bitcoin', - exec: '/home//bitcore-node/bin/bitcoind' + exec: '/home//bitcore-node/bin/zcashd' } } }, diff --git a/docs/upgrade.md b/docs/upgrade.md index fcc2cba1..d07df289 100644 --- a/docs/upgrade.md +++ b/docs/upgrade.md @@ -48,7 +48,7 @@ To start reindexing add `reindex=1` during the **first startup only**. "bitcoind": { "spawn": { "datadir": "/home//.bitcoin", - "exec": "/home//bitcore-node/bin/bitcoind" + "exec": "/home//bitcore-node/bin/zcashd" } } } diff --git a/lib/scaffold/default-base-config.js b/lib/scaffold/default-base-config.js index 1f584b55..4f641b2c 100644 --- a/lib/scaffold/default-base-config.js +++ b/lib/scaffold/default-base-config.js @@ -22,8 +22,8 @@ function getDefaultBaseConfig(options) { servicesConfig: { bitcoind: { spawn: { - datadir: options.datadir || path.resolve(process.env.HOME, '.bitcoin'), - exec: path.resolve(__dirname, '../../bin/bitcoind') + datadir: options.datadir || path.resolve(process.env.HOME, '.zcash'), + exec: path.resolve(__dirname, '../../bin/zcashd') } } } diff --git a/lib/scaffold/default-config.js b/lib/scaffold/default-config.js index 7075a7fc..852e9544 100644 --- a/lib/scaffold/default-config.js +++ b/lib/scaffold/default-config.js @@ -38,7 +38,7 @@ function getDefaultConfig(options) { bitcoind: { spawn: { datadir: path.resolve(defaultPath, './data'), - exec: path.resolve(__dirname, '../../bin/bitcoind') + exec: path.resolve(__dirname, '../../bin/zcashd') } } } diff --git a/lib/scaffold/start.js b/lib/scaffold/start.js index c5cd517e..b6f9bc28 100644 --- a/lib/scaffold/start.js +++ b/lib/scaffold/start.js @@ -34,7 +34,7 @@ function checkConfigVersion2(fullConfig) { bitcoind: { spawn: { datadir: fullConfig.datadir, - exec: path.resolve(__dirname, '../../bin/bitcoind') + exec: path.resolve(__dirname, '../../bin/zcashd') } } } diff --git a/lib/services/bitcoind.js b/lib/services/bitcoind.js index b827d539..2dc9899d 100644 --- a/lib/services/bitcoind.js +++ b/lib/services/bitcoind.js @@ -338,7 +338,7 @@ Bitcoin.prototype._loadSpawnConfiguration = function(node) { this._expandRelativeDatadir(); var spawnOptions = this.options.spawn; - var configPath = path.resolve(spawnOptions.datadir, './bitcoin.conf'); + var configPath = path.resolve(spawnOptions.datadir, './zcash.conf'); log.info('Using bitcoin config file:', configPath); @@ -488,10 +488,10 @@ Bitcoin.prototype._initChain = function(callback) { Bitcoin.prototype._getDefaultConf = function() { var networkOptions = { - rpcport: 8332 + rpcport: 8232 }; if (this.node.network === bitcore.Networks.testnet) { - networkOptions.rpcport = 18332; + networkOptions.rpcport = 18232; } return networkOptions; }; @@ -499,9 +499,9 @@ Bitcoin.prototype._getDefaultConf = function() { Bitcoin.prototype._getNetworkConfigPath = function() { var networkPath; if (this.node.network === bitcore.Networks.testnet) { - networkPath = 'testnet3/bitcoin.conf'; + networkPath = 'testnet3/zcash.conf'; if (this.node.network.regtestEnabled) { - networkPath = 'regtest/bitcoin.conf'; + networkPath = 'regtest/zcash.conf'; } } return networkPath; @@ -796,7 +796,7 @@ Bitcoin.prototype._loadTipFromNode = function(node, callback) { Bitcoin.prototype._stopSpawnedBitcoin = function(callback) { var self = this; var spawnOptions = this.options.spawn; - var pidPath = spawnOptions.datadir + '/bitcoind.pid'; + var pidPath = spawnOptions.datadir + '/zcashd.pid'; function stopProcess() { fs.readFile(pidPath, 'utf8', function(err, pid) { diff --git a/regtest/bitcoind.js b/regtest/bitcoind.js index 9f270507..fb9cb7c5 100644 --- a/regtest/bitcoind.js +++ b/regtest/bitcoind.js @@ -46,7 +46,7 @@ describe('Bitcoind Functionality', function() { bitcoind = require('../').services.Bitcoin({ spawn: { datadir: datadir, - exec: path.resolve(__dirname, '../bin/bitcoind') + exec: path.resolve(__dirname, '../bin/zcashd') }, node: { network: regtestNetwork, diff --git a/regtest/cluster.js b/regtest/cluster.js index 2397d3e9..56dc1d0c 100644 --- a/regtest/cluster.js +++ b/regtest/cluster.js @@ -19,11 +19,11 @@ var BitcoinService = index.services.Bitcoin; describe('Bitcoin Cluster', function() { var node; var daemons = []; - var execPath = path.resolve(__dirname, '../bin/bitcoind'); + var execPath = path.resolve(__dirname, '../bin/zcashd'); var nodesConf = [ { datadir: path.resolve(__dirname, './data/node1'), - conf: path.resolve(__dirname, './data/node1/bitcoin.conf'), + conf: path.resolve(__dirname, './data/node1/zcash.conf'), rpcuser: 'bitcoin', rpcpassword: 'local321', rpcport: 30521, @@ -32,7 +32,7 @@ describe('Bitcoin Cluster', function() { }, { datadir: path.resolve(__dirname, './data/node2'), - conf: path.resolve(__dirname, './data/node2/bitcoin.conf'), + conf: path.resolve(__dirname, './data/node2/zcash.conf'), rpcuser: 'bitcoin', rpcpassword: 'local321', rpcport: 30522, @@ -41,7 +41,7 @@ describe('Bitcoin Cluster', function() { }, { datadir: path.resolve(__dirname, './data/node3'), - conf: path.resolve(__dirname, './data/node3/bitcoin.conf'), + conf: path.resolve(__dirname, './data/node3/zcash.conf'), rpcuser: 'bitcoin', rpcpassword: 'local321', rpcport: 30523, diff --git a/regtest/node.js b/regtest/node.js index 8d189286..c5febe19 100644 --- a/regtest/node.js +++ b/regtest/node.js @@ -53,7 +53,7 @@ describe('Node Functionality', function() { config: { spawn: { datadir: datadir, - exec: path.resolve(__dirname, '../bin/bitcoind') + exec: path.resolve(__dirname, '../bin/zcashd') } } } diff --git a/regtest/p2p.js b/regtest/p2p.js index e405cfa7..cc6b61b9 100644 --- a/regtest/p2p.js +++ b/regtest/p2p.js @@ -52,7 +52,7 @@ describe('P2P Functionality', function() { bitcoind = require('../').services.Bitcoin({ spawn: { datadir: datadir, - exec: path.resolve(__dirname, '../bin/bitcoind') + exec: path.resolve(__dirname, '../bin/zcashd') }, node: { network: bitcore.Networks.testnet diff --git a/test/scaffold/create.integration.js b/test/scaffold/create.integration.js index f2c61523..ccf7c742 100644 --- a/test/scaffold/create.integration.js +++ b/test/scaffold/create.integration.js @@ -33,7 +33,7 @@ describe('#create', function() { if (err) { throw err; } - mkdirp(testDir + '/.bitcoin', function(err) { + mkdirp(testDir + '/.zcash', function(err) { if (err) { throw err; } @@ -104,7 +104,7 @@ describe('#create', function() { dirname: 'mynode3', name: 'My Node 3', isGlobal: true, - datadir: '../.bitcoin' + datadir: '../.zcash' }, function(err) { if (err) { throw err; @@ -139,7 +139,7 @@ describe('#create', function() { dirname: 'mynode4', name: 'My Node 4', isGlobal: false, - datadir: '../.bitcoin' + datadir: '../.zcash' }, function(err) { should.exist(err); err.message.should.equal('There was an error installing dependencies.'); diff --git a/test/scaffold/default-base-config.integration.js b/test/scaffold/default-base-config.integration.js index b622c742..72b994f8 100644 --- a/test/scaffold/default-base-config.integration.js +++ b/test/scaffold/default-base-config.integration.js @@ -14,8 +14,8 @@ describe('#defaultBaseConfig', function() { info.config.port.should.equal(3001); info.config.services.should.deep.equal(['bitcoind', 'web']); var bitcoind = info.config.servicesConfig.bitcoind; - bitcoind.spawn.datadir.should.equal(home + '/.bitcoin'); - bitcoind.spawn.exec.should.equal(path.resolve(__dirname, '../../bin/bitcoind')); + bitcoind.spawn.datadir.should.equal(home + '/.zcash'); + bitcoind.spawn.exec.should.equal(path.resolve(__dirname, '../../bin/zcashd')); }); it('be able to specify a network', function() { var info = defaultBaseConfig({network: 'testnet'}); diff --git a/test/scaffold/default-config.integration.js b/test/scaffold/default-config.integration.js index 83e674e5..9b5338d1 100644 --- a/test/scaffold/default-config.integration.js +++ b/test/scaffold/default-config.integration.js @@ -6,7 +6,7 @@ var sinon = require('sinon'); var proxyquire = require('proxyquire'); describe('#defaultConfig', function() { - var expectedExecPath = path.resolve(__dirname, '../../bin/bitcoind'); + var expectedExecPath = path.resolve(__dirname, '../../bin/zcashd'); it('will return expected configuration', function() { var config = JSON.stringify({ diff --git a/test/services/bitcoind.unit.js b/test/services/bitcoind.unit.js index 96c9a8d0..0a75654f 100644 --- a/test/services/bitcoind.unit.js +++ b/test/services/bitcoind.unit.js @@ -18,13 +18,13 @@ var log = index.log; var errors = index.errors; var Transaction = bitcore.Transaction; -var readFileSync = sinon.stub().returns(fs.readFileSync(path.resolve(__dirname, '../data/bitcoin.conf'))); +var readFileSync = sinon.stub().returns(fs.readFileSync(path.resolve(__dirname, '../data/zcash.conf'))); var BitcoinService = proxyquire('../../lib/services/bitcoind', { fs: { readFileSync: readFileSync } }); -var defaultBitcoinConf = fs.readFileSync(path.resolve(__dirname, '../data/default.bitcoin.conf'), 'utf8'); +var defaultBitcoinConf = fs.readFileSync(path.resolve(__dirname, '../data/default.zcash.conf'), 'utf8'); describe('Bitcoin Service', function() { var txhex = '01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff0704ffff001d0104ffffffff0100f2052a0100000043410496b538e853519c726a2c91e61ec11600ae1390813a627c66fb8be7947be63c52da7589379515d4e0a604f8141781e62294721166bf621e73a82cbf2342c858eeac00000000'; @@ -357,7 +357,7 @@ describe('Bitcoin Service', function() { afterEach(function() { sandbox.restore(); }); - it('will parse a bitcoin.conf file', function() { + it('will parse a zcash.conf file', function() { var TestBitcoin = proxyquire('../../lib/services/bitcoind', { fs: { readFileSync: readFileSync, @@ -369,7 +369,7 @@ describe('Bitcoin Service', function() { } }); var bitcoind = new TestBitcoin(baseConfig); - bitcoind.options.spawn.datadir = '/tmp/.bitcoin'; + bitcoind.options.spawn.datadir = '/tmp/.zcash'; var node = {}; bitcoind._loadSpawnConfiguration(node); should.exist(bitcoind.spawn.config); @@ -423,7 +423,7 @@ describe('Bitcoin Service', function() { it('should throw an exception if txindex isn\'t enabled in the configuration', function() { var TestBitcoin = proxyquire('../../lib/services/bitcoind', { fs: { - readFileSync: sinon.stub().returns(fs.readFileSync(__dirname + '/../data/badbitcoin.conf')), + readFileSync: sinon.stub().returns(fs.readFileSync(__dirname + '/../data/badzcash.conf')), existsSync: sinon.stub().returns(true), }, mkdirp: { @@ -466,7 +466,7 @@ describe('Bitcoin Service', function() { } }; var bitcoind = new TestBitcoin(config); - bitcoind.options.spawn.datadir = '/tmp/.bitcoin'; + bitcoind.options.spawn.datadir = '/tmp/.zcash'; var node = {}; bitcoind._loadSpawnConfiguration(node); }); @@ -480,7 +480,7 @@ describe('Bitcoin Service', function() { afterEach(function() { sandbox.restore(); }); - it('should warn the user if reindex is set to 1 in the bitcoin.conf file', function() { + it('should warn the user if reindex is set to 1 in the zcash.conf file', function() { var bitcoind = new BitcoinService(baseConfig); var config = { txindex: 1, @@ -829,7 +829,7 @@ describe('Bitcoin Service', function() { } }; var bitcoind = new BitcoinService(config); - bitcoind._getNetworkConfigPath().should.equal('testnet3/bitcoin.conf'); + bitcoind._getNetworkConfigPath().should.equal('testnet3/zcash.conf'); }); it('will get default rpc port for regtest', function() { bitcore.Networks.enableRegtest(); @@ -843,7 +843,7 @@ describe('Bitcoin Service', function() { } }; var bitcoind = new BitcoinService(config); - bitcoind._getNetworkConfigPath().should.equal('regtest/bitcoin.conf'); + bitcoind._getNetworkConfigPath().should.equal('regtest/zcash.conf'); }); }); @@ -1749,7 +1749,7 @@ describe('Bitcoin Service', function() { bitcoind._loadSpawnConfiguration = sinon.stub(); bitcoind.spawn = {}; bitcoind.spawn.exec = 'testexec'; - bitcoind.spawn.configPath = 'testdir/bitcoin.conf'; + bitcoind.spawn.configPath = 'testdir/zcash.conf'; bitcoind.spawn.datadir = 'testdir'; bitcoind.spawn.config = {}; bitcoind.spawn.config.rpcport = 20001; @@ -1766,7 +1766,7 @@ describe('Bitcoin Service', function() { spawn.callCount.should.equal(1); spawn.args[0][0].should.equal('testexec'); spawn.args[0][1].should.deep.equal([ - '--conf=testdir/bitcoin.conf', + '--conf=testdir/zcash.conf', '--datadir=testdir', '--testnet' ]); @@ -1800,7 +1800,7 @@ describe('Bitcoin Service', function() { bitcoind.spawn = {}; bitcoind.spawn.exec = 'bitcoind'; bitcoind.spawn.datadir = '/tmp/bitcoin'; - bitcoind.spawn.configPath = '/tmp/bitcoin/bitcoin.conf'; + bitcoind.spawn.configPath = '/tmp/bitcoin/zcash.conf'; bitcoind.spawn.config = {}; bitcoind.spawnRestartTime = 1; bitcoind._loadTipFromNode = sinon.stub().callsArg(1); @@ -1838,7 +1838,7 @@ describe('Bitcoin Service', function() { bitcoind.spawn = {}; bitcoind.spawn.exec = 'bitcoind'; bitcoind.spawn.datadir = '/tmp/bitcoin'; - bitcoind.spawn.configPath = '/tmp/bitcoin/bitcoin.conf'; + bitcoind.spawn.configPath = '/tmp/bitcoin/zcash.conf'; bitcoind.spawn.config = {}; bitcoind.spawnRestartTime = 1; bitcoind._loadTipFromNode = sinon.stub().callsArg(1); @@ -1885,7 +1885,7 @@ describe('Bitcoin Service', function() { bitcoind.spawn = {}; bitcoind.spawn.exec = 'bitcoind'; bitcoind.spawn.datadir = '/tmp/bitcoin'; - bitcoind.spawn.configPath = '/tmp/bitcoin/bitcoin.conf'; + bitcoind.spawn.configPath = '/tmp/bitcoin/zcash.conf'; bitcoind.spawn.config = {}; bitcoind.spawnRestartTime = 1; bitcoind._loadTipFromNode = sinon.stub().callsArg(1); @@ -1924,7 +1924,7 @@ describe('Bitcoin Service', function() { bitcoind._loadSpawnConfiguration = sinon.stub(); bitcoind.spawn = {}; bitcoind.spawn.exec = 'testexec'; - bitcoind.spawn.configPath = 'testdir/bitcoin.conf'; + bitcoind.spawn.configPath = 'testdir/zcash.conf'; bitcoind.spawn.datadir = 'testdir'; bitcoind.spawn.config = {}; bitcoind.spawn.config.rpcport = 20001; @@ -1954,7 +1954,7 @@ describe('Bitcoin Service', function() { bitcoind._loadSpawnConfiguration = sinon.stub(); bitcoind.spawn = {}; bitcoind.spawn.exec = 'testexec'; - bitcoind.spawn.configPath = 'testdir/bitcoin.conf'; + bitcoind.spawn.configPath = 'testdir/zcash.conf'; bitcoind.spawn.datadir = 'testdir'; bitcoind.spawn.config = {}; bitcoind.spawn.config.rpcport = 20001;