settings: change Insight.js opts

This commit is contained in:
Manuel Araoz 2014-09-10 12:36:33 -07:00
parent 423348f5ec
commit 997c061b1a
2 changed files with 6 additions and 9 deletions

View File

@ -19,7 +19,7 @@ var defaultConfig = {
url: 'https://test-insight.bitpay.com:443'
},
livenet: {
url: 'https:insight.bitpay.com:443'
url: 'https://insight.bitpay.com:443'
},
},

View File

@ -15,9 +15,7 @@ var preconditions = require('preconditions').singleton();
subscribing to transactions on adressess and blocks.
Opts:
- host
- port
- schema
- url
- reconnection (optional)
- reconnectionDelay (optional)
@ -31,19 +29,18 @@ var preconditions = require('preconditions').singleton();
var Insight = function(opts) {
preconditions.checkArgument(opts)
.shouldBeObject(opts)
.checkArgument(opts.host)
.checkArgument(opts.port)
.checkArgument(opts.schema);
.checkArgument(opts.url)
this.status = this.STATUS.DISCONNECTED;
this.subscribed = {};
this.listeningBlocks = false;
this.url = opts.schema + '://' + opts.host + ':' + opts.port;
this.url = opts.url;
alert(this.url);
this.opts = {
'reconnection': opts.reconnection || true,
'reconnectionDelay': opts.reconnectionDelay || 1000,
'secure': opts.schema === 'https'
'secure': opts.url.indexOf('https') > -1
};
this.socket = this.getSocket();