diff --git a/bitcorenode/index.js b/bitcorenode/index.js index 5747c6f..ee7c85d 100644 --- a/bitcorenode/index.js +++ b/bitcorenode/index.js @@ -34,17 +34,16 @@ var Service = function(options) { this.node = options.node; this.https = options.https || this.node.https; this.httpsOptions = options.httpsOptions || this.node.httpsOptions; - this.bwsPort = options.bwsPort || Service.BWS_PORT; - this.messageBrokerPort = options.messageBrokerPort || Service.MESSAGE_BROKER_PORT; - this.lockerPort = options.lockerPort || Service.LOCKER_PORT; + this.bwsPort = options.bwsPort || baseConfig.port; + this.messageBrokerPort = options.messageBrokerPort || 3380; + if (baseConfig.lockOpts) { + this.lockerPort = baseConfig.lockOpts.lockerServer.port; + } + this.lockerPort = options.lockerPort || this.lockerPort; }; util.inherits(Service, EventEmitter); -Service.BWS_PORT = 3232; -Service.MESSAGE_BROKER_PORT = 3380; -Service.LOCKER_PORT = 3231; - Service.dependencies = ['insight-api']; /** diff --git a/test/bitcorenode.js b/test/bitcorenode.js index 4bff6cb..987809c 100644 --- a/test/bitcorenode.js +++ b/test/bitcorenode.js @@ -26,9 +26,9 @@ describe('Bitcore Node Service', function() { key: 'key', cert: 'cert' }); - service.bwsPort.should.equal(Service.BWS_PORT); - service.messageBrokerPort.should.equal(Service.MESSAGE_BROKER_PORT); - service.lockerPort.should.equal(Service.LOCKER_PORT); + service.bwsPort.should.equal(3232); + service.messageBrokerPort.should.equal(3380); + service.lockerPort.should.equal(3231); }); it('direct https options', function() { var node = {}; @@ -46,9 +46,9 @@ describe('Bitcore Node Service', function() { key: 'key', cert: 'cert' }); - service.bwsPort.should.equal(Service.BWS_PORT); - service.messageBrokerPort.should.equal(Service.MESSAGE_BROKER_PORT); - service.lockerPort.should.equal(Service.LOCKER_PORT); + service.bwsPort.should.equal(3232); + service.messageBrokerPort.should.equal(3380); + service.lockerPort.should.equal(3231); }); it('can set custom ports', function() { var node = {};