ExchangeUnion / xud-docker-api

GNU Affero General Public License v3.0
0 stars 0 forks source link

feat: add status API #1

Closed reliveyy closed 4 years ago

reliveyy commented 4 years ago

This Go version status API is connecting to RPC port directly instead of using their cli programs. So it should be faster than before. And it is totally seperated from utils so it should make both more stable than mixed them with each other.

This PR provides GET /api/v1/status mainly and GET /api/v1/status/{service} for individual service.

The response of GET /api/v1/status is like

{
    "xud": "Ready",
    "lndbtc": "Ready",
    "lndltc": "Ready",
    "connext": "Ready",
}

And the response of GET /api/v1/status/{service} is like

"Ready"

Notice the string "Ready" is also a valid JSON.