Rippled API Overview

From Ripple Wiki
Jump to: navigation, search

Contents

JSON Messaging

Business servers interact with the Ripple network by sending JSON formatted messages to their local rippled server. In reply rippled sends back JSON formatted responses.

There are two broad categories of JSON messages.

  1. Queries which return information about the current state of the server or the ledger.
  2. Transactions which change the state of the server or ledger.

All JSON messages are documented on this wiki page: JSON Messages

JSON data formatting rules are specified here: JSON format

The current state of every account, trust line and market offer is represented in the Ripple ledger. The ledger format is documented here: Ledger Format

Transaction types and formats are listed here: Transactions

Websockets vs RPC

Messages can be passed either by making individual RPC calls to the rippled server, or by opening a persistent websocket connection and submitting JSON requests over that channel. The individual JSON requests and responses use the same data format no matter which communication channel you chose to use.

The choice of communication channel is up to the integrator. The choice often depends on the language the existing business server is written in and the skills of the development team. Websockets is a more modern interface and is more suitable to high volume businesses. It is also allows user interfaces to update dynamically. RPC’s synchronous nature makes it easy for quick experimentation. https://ripple.com/wiki/Websocket_API#Websocket_vs_RPC

Higher level interfaces

command line

The rippled executable also provides a command line interface that simplifies sending RPC requests to your server. Command Line Agent

ripple-lib

Ripple Labs provides a javascript library called ripple-lib which abstracts the low level message sending details. This library is helpful for browser based user interfaces that interact with Ripple. It is also useful to those writing their business server in node.js.

If you are developing in a language other than javascript, ripple-lib can serve as a helpful reference implementation on which to base your implementation. https://github.com/ripple/ripple-lib

Personal tools
Namespaces

Variants
Actions
Navigation
Tools