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

No longer supported .request('request',fields) ??? #485

Closed tuloski closed 9 years ago

tuloski commented 9 years ago

I recently move to a new machine and updated my ripple-lib, but it seems that the remote request in the form remote.request('request',fields) are not supported anymore.

Example that is NOT working:

var request_info = remote.request('account_info',{
    account: MY_ADD
});
request_info.request(function(err, info) {
    if (err){
        //error
    }
    else{
        //good info
    }
});

Example that IS WORKING:

remote.requestAccountInfo({
            account: MY_ADD
        },function(err, info) {
            if (err){
                //error
            }
            else{
                //good
            }
});

The first one does not trow an error, it just never "answer". So is now only supported the 2nd version?

PS: please write some documentation. It was already hard to understand how to make things work.

kureus commented 9 years ago

What version did it previously work on? And what version have you upgraded too?

tuloski commented 9 years ago

I upgraded to the latest release with npm. I don't know the last working version, is it written somewhere? I still have the node_module folder.

kureus commented 9 years ago

Latest release on npm is 0.12.6, the last working version on your old machine will be in your package.json file

tuloski commented 9 years ago

Yeah, I have actually 0.12.6 and the old one is 0.11.0-rc3

kureus commented 9 years ago

You can see the change in the release notes, its the first change noted here https://github.com/ripple/ripple-lib/releases/tag/0.12.0

clark800 commented 9 years ago

According to semver.org: "Major version zero (0.y.z) is for initial development. Anything may change at any time. The public API should not be considered stable."

We try to bump the first non-zero version component for breaking changes and document them in the release notes.

Also note that the current API is being deprecated and replaced with a new RippleAPI that should be simpler and better documented: https://github.com/ripple/ripple-lib/pull/482

kureus commented 9 years ago

@clark800 From what I can see in the develop branches of ripple lib, the current ripple-lib has been moved off into core and the deprecated restful client (https://github.com/ripple/ripple-rest-client) essentially brought into the new api directory. Before it seemed developers had a straightforward choice, choose the restful client if you're happy to make calls at given intervals or on observed events say, or develop on top of ripple-lib building on top of a socket based app listening to a real time stream and making decisions off the back of it. If the ripple-lib devs will no longer be able to directly access core, and will be using the exposed api, and the rest client guys get pushed over to this api, will all the old functionality both through ripple-lib as it now exists in its current release version and the rest client still be available under one roof?

Basically, even if my current understanding is way off, what's the intention and scope of these changes and is there a public roadmap for this development?

clark800 commented 9 years ago

The idea is to simplify and improve the interface to the Ripple network. The roadmap is to transition active projects to the new RippleAPI from the current ripple-lib API. Here are the slides from a seminar I led recently: https://www.dropbox.com/s/q5p6gae98d2th4a/RippleAPI.pdf?dl=0

Note: after the seminar, we decided to switch to using promises.

kureus commented 9 years ago

@clark800 Chris, thank you for posting this link. Much appreciated. Are there any developer evangelists at ripple labs?

clark800 commented 9 years ago

@kureus Yes, you can get in touch through support@ripple.com

tuloski commented 9 years ago

Thank you for the slides.

I'll take a look at it soon and maybe I'll ask something ;)


Da: Chris Clark notifications@github.com Inviato: giovedì 13 agosto 2015 19.47 A: ripple/ripple-lib Cc: Michele Furci Oggetto: Re: [ripple-lib] No longer supported .request('request',fields) ??? (#485)

@kureushttps://github.com/kureus Yes, you can get in touch through support@ripple.commailto:support@ripple.com

Reply to this email directly or view it on GitHubhttps://github.com/ripple/ripple-lib/issues/485#issuecomment-130777120.