XRPLF / rippled

Decentralized cryptocurrency blockchain daemon implementing the XRP Ledger protocol in C++
https://xrpl.org
ISC License
4.64k stars 1.48k forks source link

How to enable Ripple Data API v2 on own peer? (Version: 1.5.0) #3567

Closed SteelBRS closed 4 years ago

SteelBRS commented 4 years ago

I've been reading the documentation, but after some experimentation I've been unable to get this working. I gives bad request when I try against a port configured with http ... but http means JSON-RPC ... how do I enable REST?

http://<serverIP>:<port>/v2/accounts/<account>/orders

MarkusTeufelberger commented 4 years ago

This is the wrong repository for this, the data API runs https://github.com/ripple/rippled-historical-database

intelliot commented 4 years ago

rippled does not provide a REST API. Depending on your use case, rippled's JSON-RPC API may be a good choice.

SteelBRS commented 4 years ago

Erh ... this belongs in a repo with the word 'historical' in it?

I'm requesting the current offers/orders for an account ... doesn't seem like a historical query to me

SteelBRS commented 4 years ago

Also ... isn't it good practice to call stuff the same? An offer should be called 'offer' also in the ripple data API, and not an order, right? Or am I missing something?

MarkusTeufelberger commented 4 years ago

Erh ... this belongs in a repo with the word 'historical' in it?

Yes, because that is the repository that hosts the code that runs behind the "data API" - not this repository here.

SteelBRS commented 4 years ago

Thanks for the info Markus ... it's a fulltime job to answer stuff here, and Ripple doesn't even pay you ... I don't understand :smile:

sublimator commented 4 years ago

He keeps them honest! :)

SteelBRS commented 4 years ago

... and I finally stopped bitching and converted my REST call into a JSON-RPC 1.0 post ... in 15 minutes

SteelBRS commented 4 years ago

@sublimator you were the dude, that created the Java API back in the day, right? I still don't understand why they dropped that ... doesn't Java still have the largest base of developers?

sublimator commented 4 years ago

Yeah, that's me!

I was never really a Java dev per se. It started as a weekend project to learn ripple. I was the only person who really used it at ripple so it bitrotted when I left.

I updated a fork once for someone: https://github.com/sublimator/ripple-lib-java

It's my thinking that they are focused on the XPring SDK now which has a Java client ? https://github.com/xpring-eng/xpring4j

It seems to use the javascript library for TXN serializing ?? :)

cjcobb23 commented 4 years ago

We added gRPC support to rippled and are building xpring SDKs in a variety of languages using the gRPC requests that are supported by rippled

intelliot commented 4 years ago

This issue has been resolved. Here's a summary of the answer:

Q: How to enable Ripple Data API v2 on own peer? A: Ripple Data API is separate from rippled, which is the project that this issue was created in. Running your own instance of the Data API is complicated and usually unnecessary, as you can often retrieve the same data using rippled, e.g. with rippled's JSON-RPC API.

Q: How to retrieve an account's offers? A: The account_offers method retrieves a list of offers made by a given account.

Note: order and offer are synonyms.

Hope this helps!