API Overview

From Ripple Wiki
Jump to: navigation, search

Ripple APIs

If you intend to act as a gateway, or if you are a developer with great ideas of how to use the Ripple Network, you will probably want to build a custom client application that you or your customers can use to send, receive, or observe funds on the Ripple Network.

Connecting to the Ripple Network generally means communicating with the Ripple Server software, rippled (pronounced “ripple-dee”). To get started, you can try running a few calls to retrieve information from public servers using the Ripple API Tool or you try downloading and running your own instance of rippled.

If you are building your own client, you have several options of interfaces that you can use to interact with the Ripple Network:

Tool Summary Interface Abstraction Level Pros Cons
Ripple-REST RESTful interface to rippled as a Node.js application HTTP interface High abstraction ✓ Simple robust transaction submission
✓ Broad HTTP-client support
✗ Lacks access to a few features like viewing currency exchange offers
✗ Requires Node.js
ripple-lib Reference implementation for accessing the WebSocket API Javascript library Moderate abstraction ✓ Simple robust transaction submission
✓ Good balance of simplicity and power
✗ Javascript only (Clients for other languages are in progress)
rippled WebSocket API Powerful, asynchronous API built on the WebSocket protocol WebSocket interface Low abstraction ✓ Access to all Ripple functionality
✓ Can be pushed ordered stream data
✗ Fewer convenient abstractions
✗ WebSocket clients are rare outside of Javascript
rippled JSON-RPC API Powerful, synchronous API built on the JSON-RPC convention HTTP interface Low abstraction ✓ Access to almost all Ripple functionality
✓ Broad HTTP-client support
✗ Fewer convenient abstractions
✗ Callbacks may arrive out of order
✗ No incremental pathfinding


Network Interfaces

rippled exposes up to 3 different protocols on one or several ports:

peer
This protocol is used between rippled servers for relaying information about transactions and consensus. It operates as a protocol buffer via SSL. This is an untrusted connection. Secrets are never sent over this protocol.
websocket
This persistent connection can be used for retrieving information about the ledger, signing and submitting transactions, and administering the server. You can configure specific IPs that have administrative access.
rpc
This HTTP interface can be used for everything that websocket uses, except for subscribing to push updates from the server. You can configure specific IPs that have administrative access.