BREAKING CHANGE: "servers" parameter changed to single "server" and added a new broadcast wrapper class for multiple servers

This commit is contained in:
Chris Clark
2015-11-24 15:00:47 -08:00
parent a124635c2c
commit 7061e9afe4
9 changed files with 243 additions and 160 deletions

View File

@@ -0,0 +1,17 @@
'use strict';
const {RippleAPIBroadcast} = require('../../src');
function main() {
const servers = ['wss://s1.ripple.com', 'wss://s2.ripple.com'];
const api = new RippleAPIBroadcast(servers);
api.connect().then(() => {
api.getServerInfo().then(info => {
console.log(JSON.stringify(info, null, 2));
});
api.on('ledger', ledger => {
console.log(JSON.stringify(ledger, null, 2));
});
});
}
main();

View File

@@ -58,7 +58,7 @@ function testTransaction(testcase, type, lastClosedLedgerVersion, prepared) {
}
function setup() {
this.api = new RippleAPI({servers: ['wss://s1.ripple.com']});
this.api = new RippleAPI({server: 'wss://s1.ripple.com'});
console.log('CONNECTING...');
return this.api.connect().then(() => {
console.log('CONNECTED...');