Rippled REST API provides a REST-like API proxy for the rippled
server. It is more REST-like than the existing interfaces and should be easier to use for those with REST API experience, while remaining close enough to the rippled
server's API to ensure eaiser maintenance, support and documenation than if a larger change was introduced.
A primary design goal of Rippled REST API is to support the OpenAPI Specification and tools such as Swagger UI.
Note: if you just want to use Postman, see the
rippled-postman
Postman Collection which can connect to rippled servers directly.
Providing a REST-like interface to Rippled requires thoughtful API design. Increasing REST-likeness will be introduced in several phases with different API versions of the Rippled REST API having specific design guidelines for that version.
It can run as any of the following:
- Server using
net/http
orfasthttp
- AWS Lambda function behind AWS API Gateway
- Heroku server
A test server is available at:
https://rippled-rest-api.herokuapp.com
HTTP_ENGINE
: set tonethttp
,fasthttp
orawslambda
.PORT
: TCP port to listen on
$ go get github.com/goxrp/rippled-rest-api
$ rippled-rest-api
- Use the
aws-package.sh
script to create a zip file to upload to AWS Lambda. - Change "Runtime settings" > "Handler" to
main
fromhello
or
$ heroku create
$ git push heroku master
$ heroku open
Heroku will automatically set the PORT
environment variable.
Test with:
curl -XGET 'https://{gatewayId}.execute-api.{awsZone}.amazonaws.com/{stage}/api'
curl -XPOST 'https://{gatewayId}.execute-api.{awsZone}.amazonaws.com/{stage}/api/v1/account_info' -H 'Content-Type: application/json' -d @docs/examples/endpoint_account_info_request.json
The API Spec is a work in progress and available at:
POST /api/v1/account_info
{
"account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn",
"strict": true,
"ledger_index": "current",
"queue": true
}
curl -XPOST 'http://localhost:8080/api/account_info' -d '{"account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn", "strict": true, "ledger_index": "current", "queue": true}'
{
"id": 2,
"command": "account_info",
"account": "r9cZA1mLK5R5Am25ArfXFmqgNwjZgnfk59",
"strict": true,
"ledger_index": "current",
"queue": true
}
POST /api/account_info
{
"method": "account_info",
"params": [
{
"account": "rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn",
"strict": true,
"ledger_index": "current",
"queue": true
}
]
}
- Heroku support provided via
github.com/grokify/goheroku
.