mirror of
https://github.com/Xahau/xahau.js.git
synced 2025-12-02 01:55:48 +00:00
BREAKING CHANGE: "servers" parameter changed to single "server" and added a new broadcast wrapper class for multiple servers
This commit is contained in:
17
test/integration/broadcast-test.js
Normal file
17
test/integration/broadcast-test.js
Normal 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();
|
||||
@@ -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...');
|
||||
|
||||
Reference in New Issue
Block a user