XRPLF / xrpl.js

A JavaScript/TypeScript API for interacting with the XRP Ledger in Node.js and the browser
https://xrpl.org/
1.2k stars 511 forks source link

Running rippled and using ripple-lib #673

Closed Kekec852 closed 8 years ago

Kekec852 commented 8 years ago

Hi,

i have found an pickle running ripple-lib with my rippled server (server is at: 0.30.1-b10).

rippled: 0.30.1-b10 build from develop branch today ripple-lib: 0.16.2 nodejs: 4.2.3 npm: 2.14.7

I'm using following code to connect:

var ripple = require('ripple-lib');
var Remote = ripple.RippleAPI;

var remote = new Remote({
    server: 'ws://192.168.8.83:6006'
    //server: "wss://s1.ripple.com"
});

remote.connect().then(function () {
    console.log("Starting ... ");
}).catch(console.error);

remote.on('error', function (errorCode, errorMessage) {
    console.log(errorCode + ': ' + errorMessage);
});

When i connect to my server i receive this message but not every time:

[TypeError: Cannot read property 'split' of undefined]

When i connect to public ripple server everything is working every time.

What am I missing.

Best regards, Martin Hribar

clark800 commented 8 years ago

Thanks, should be fixed by this (not yet released to npm): https://github.com/ripple/ripple-lib/pull/675

Kekec852 commented 8 years ago

This pull-request fixes the TypeError, but now i have a different problem, that probably has same cause that lead to discovery of TypeError.

For unknown reason (a least for me) my ripple server is returning empty leader version.

Wish me a luck at finding miss configuration :P

Kekec852 commented 8 years ago

Found it ... it helps if you add [validators] to rippled.cfg :smile: