Jump to content
mDuo13

RippleAPI Announcement

Recommended Posts

Any tip on how to transfer old code with old ripple-lib to new one?
Is there a way to run old programs with old ripple-lib while having the new rippleAPI and test new code? I'm not very expert of npm but I'm afraid that if I install the new rippleAPI, it will override old one, making all my old code unusable and with high risks of bugs.

Share this post


Link to post
Share on other sites
2 hours ago, tulo said:

Any tip on how to transfer old code with old ripple-lib to new one?
Is there a way to run old programs with old ripple-lib while having the new rippleAPI and test new code? I'm not very expert of npm but I'm afraid that if I install the new rippleAPI, it will override old one, making all my old code unusable and with high risks of bugs.

You should install local in a new directory (npm install ripple-lib without the -g option). When you do an npm install ripple-lib without the -g option, everything is newly installed within that same directory (actually in a node_modules directory).

If you still feel uncomfortable installing the ripple-lib, then start developing on a new VM, so you're definitly sure you will not break anything.

I personally have an ubuntu install on VMware on my home-PC where I develop and test new code. On this VM I leave the secret keys out c.q. replace them with bogus-tekst so I can savely do some testing. Once the code is final and I am confident enough it works as intended I move it to my ubuntu production server in the cloud.

Edited by jn_r

Share this post


Link to post
Share on other sites
4 minutes ago, jn_r said:

You should install local in a new directory (npm install ripple-lib without the -g option). When you do an npm install ripple-lib without the -g option, everything that is newly installed is installed within that directory (actually in the node_modules directory).

If you still feel uncomfortable installing the ripple-lib, then start developing on a new VM, so you're definitly sure you will not break anything.

I personally have an ubuntu install on VMware on my home-PC where I develop and test new code. On this VM I leave the secret keys out c.q. replace them with bogus-tekst so I can savely do some testing. Once the code is final and I am confident enough it works as intended I move it to my ubuntu production server in the cloud.

Thanks for the answer.

So if I install locally, and then I do "require('ripple-lib')" in my script.js, where my script.js should be located to require the correct tipple-lib?

Share this post


Link to post
Share on other sites
14 minutes ago, tulo said:

Thanks for the answer.

So if I install locally, and then I do "require('ripple-lib')" in my script.js, where my script.js should be located to require the correct tipple-lib?

In the same directory as where you did the 'npm install ripple-lib'

Share this post


Link to post
Share on other sites
10 minutes ago, jn_r said:

In the same directory as where you did the 'npm install ripple-lib'

But plz be carefull.

I don't want to be responsible for your bot not working anymore ;-)

Savest thing is to start on a new system..

Share this post


Link to post
Share on other sites

I've used the Ripple-REST HTTP calls before, but it's been a while.  So I noticed this quote in the blog:

"Meanwhile, the rippled APIs continue to provide an alternative method of interacting with the Ripple Consensus Ledger, providing maximum power at a cost of increased complexity, so you can choose the tradeoffs that are best for your use case."

Does that mean if I program my own bots, they'll be faster if I use the old rippled APIs?  Or will the response time be the same as the newer APIs?

Share this post


Link to post
Share on other sites
6 hours ago, Hodor said:

I've used the Ripple-REST HTTP calls before, but it's been a while.  So I noticed this quote in the blog:

"Meanwhile, the rippled APIs continue to provide an alternative method of interacting with the Ripple Consensus Ledger, providing maximum power at a cost of increased complexity, so you can choose the tradeoffs that are best for your use case."

Does that mean if I program my own bots, they'll be faster if I use the old rippled APIs?  Or will the response time be the same as the newer APIs?

Using new APIs shouldn't make your bots faster compared to Rippled API (assuming you rely only on data in validated ledgers). New RippleAPI uses rippled APIs under the hood, but it hides some technical details from you.

Edited by T8493
Added "assuming you rely only on data in validated ledgers"

Share this post


Link to post
Share on other sites

With the new RippleAPI it is very easy to compute your calculation on basis of the event of 'new ledger'. And that is the fastest you will ever need to be in Ripple.

There was some racing issue brought on by donch I believe, but that isssue was solved if I remember correct, i.e. if 2 entities would create an order to be validated in the same ledger, then per randomization it is decided which order will be placed first.

It would be nice if I could get some confirmation on the above, I'm not 100% sure..

(like in https://github.com/ripple/rippled/commit/07418cfb343b93616032d0564e9b8fd64526d639)

Edited by jn_r

Share this post


Link to post
Share on other sites

I like the Promises and I LOVE the documentation.

Thanks documentation guru @mDuo13:bb::dance4::clapping:

But I don't see how to subscribe to a book with some push API for real-time. Is now the only way to get an orderbook by polling with "getOrderbook"?

Share this post


Link to post
Share on other sites
On 2/13/2016 at 8:03 PM, T8493 said:

Any plans to offer complete RippleAPI functionality in other programming languages? 

We designed the API with the hope that we could offer it in other programming languages, but there are no efforts as of yet to do so.

 

On 2/14/2016 at 7:16 PM, Hodor said:

Does that mean if I program my own bots, they'll be faster if I use the old rippled APIs?  Or will the response time be the same as the newer APIs?

There shouldn't be any noticeable difference in response times, since the RippleAPI software uses the rippled APIs under the hood -- they just do some convenient processing for you to make the results easier to use. The differences from rippled's APIs are more about flexibility, the biggest one being that RippleAPI doesn't have any function to query for not-yet-validated proposed transactions. There are also some smaller things: rippled can generate validator keys or account keys from a non-random seed, it has a utility to check an address's NoRipple settings against our recommendations, a command to sum up the amount of currency a gateway has issued, and various admin things for actually running the server. For viewing validated ledger data, trading, sending payments, and other common use cases, RippleAPI should be perfectly capable.

 

On 2/14/2016 at 6:12 AM, tulo said:

I like the Promises and I LOVE the documentation.

Thanks documentation guru @mDuo13:bb::dance4::clapping:

But I don't see how to subscribe to a book with some push API for real-time. Is now the only way to get an orderbook by polling with "getOrderbook"?

I can't take full credit for the documentation: the ripple-lib developers (in particular Chris Clark and Alan Cohen) have set in place excellent policies for making documentation part of the RippleAPI development process, and they've been very diligent in keeping the RippleAPI Reference up-to-date. I helped out here and there in getting the docs ready, and wrote the Beginners Guide, but most of the hard work is theirs, not mine.

As for how to subscribe to an order book, polling with getOrderbook is probably the easiest. You can watch the ledger event stream for updates in order to know when to poll, but that's about it. It's conceivable that for some sort of high-frequency-trading or front-running scheme, that you would want to know the in-progress (tentative) state of the ledger -- which would require using rippled's JSON-RPC or WebSocket APIs instead of RippleAPI. Honestly, RCL (somewhat intentionally) makes HFT difficult, so I don't recommend it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...