A simplified RESTful API for interfacing with the Ripple Network.
See the Guide and the API Reference for details on how to use the API.
A test version of the API can be found at https://ripple-rest.herokuapp.com
.
Even though the test API supports HTTPS connections, only submit transactions from test accounts, we make NO GUARANTEES about the security of your secret keys on this server.
- Node.js
- PostgreSQL (on a Mac use the app). Follow the instructions here or those that came with your PostgreSQL to get the database server running on your machine
- Run
git clone https://github.com/ripple/ripple-rest.git
in a terminal and switch into theripple-rest
directory - Run
npm install
to install the dependencies and setup the database - Run
node server.js
to start the server - Visit
http://localhost:5990/api/v1/status
in your browser to confirm that the server is up and running
- From the root
ripple-rest
directory runnpm install
to update to the newest version, update dependencies, and reconfigure the database - If the old version of the server is still running, kill the process with
CTRL-C
in the same terminal window where it is running orkillall node
to stop all Node.js processes on a Linux or Mac computer - Run
node server.js
to restart the server - Visit
http://localhost:5990/api/v1/status
in your browser to confirm that the server is up and running
-
Configuration options are loaded from various sources according to the following hierarchy (where 1 is the highest priority):
- Command line options:
node server.js --DATABASE_URL=postgres://ripple_rest_user:password@localhost:5432/ripple_rest_db
- Environment variables:
export DATABASE_URL=postgres://ripple_rest_user:password@localhost:5432/ripple_rest_db; node server.js
- The
config.json
file, which follows the format of theconfig-example.json
file:
{ /* ... */ DATABASE_URL: "postgres://ripple_rest_user:password@localhost:5432/ripple_rest_db" /* ... */ }
For more information on the
config.json
file and its versions see docs/CONFIG.md. -
Configure the PostgreSQL connection by setting the
DATABASE_URL
field in any of the aforementioned configuration sources to a string in the following format:postgres://ripple_rest_user:password@localhost:5432/ripple_rest_db
. -
Configure the
rippled
connection by setting therippled_servers
field to a JSON object of the form:"rippled_servers": [ { "host": "s_west.ripple.com", "port": 443, "secure": true } ]
-
Enable SSL by including the following in the
config.json
in any of the configuration sources:{ /* ... */ "ssl": { "key_path": "path/to/server.key", "cert_path": "path/to/server.crt" } /* ... */ }
Note that you will need to connect to the server with
https://
if you have SSL enabled. -
If installing on Heroku you must add the Heroku PostgreSQL add-on first by running the command:
heroku addons:add heroku-postgresql:dev
npm test
This API is still in beta. Please open issues for any problems you encounter.