ExchangeUnion / xud-docker-api

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

feat: show xud-docker setup details #13

Closed reliveyy closed 4 years ago

reliveyy commented 4 years ago

This PR adds a new endpoint /api/v1/setup-status. It shows the details of xud-docker setup process.

➜  ~ curl localhost:8080/api/v1/setup-status
{"status":"Waiting for XUD dependencies to be ready","details":null}
{"status":"Syncing light clients","details":{"lndbtc":"Syncing 0.00% (0/0)","lndltc":"Syncing 0.00% (0/0)"}}
{"status":"Syncing light clients","details":{"lndbtc":"Syncing 0.00% (0/1890767)","lndltc":"Syncing 0.00% (0/0)"}}
{"status":"Syncing light clients","details":{"lndbtc":"Syncing 0.00% (0/1890767)","lndltc":"Syncing 0.00% (0/1677117)"}}
{"status":"Syncing light clients","details":{"lndbtc":"Syncing 0.00% (0/1890767)","lndltc":"Syncing 0.00% (0/1677117)"}}
...
{"status":"Setup wallets","details":null}
{"status":"Create wallets","details":null}
{"status":"Setup backup location","details":null}
{"status":"Unlock wallets","details":null}

The stream HTTP response could be changed to SSE (HTTP Server-Sent Events) if it is more convenient to use in frontend. @krrprr @erkarl

ghost commented 4 years ago

I'm testing this with:

➜  ~ bash xud.sh -b setup-status --proxy.disabled false

The light clients are syncing:

πŸƒ Warming up...

Syncing light clients:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ SERVICE β”‚ STATUS                                              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ lndbtc  β”‚ Syncing 37.95% (249000/656126)                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ lndltc  β”‚ Syncing 8.12% (158000/1944013)                      β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

But API is not responsive:

➜  ~ curl localhost:8080/api/v1/setup-status
curl: (7) Failed to connect to localhost port 8080: Connection refused
reliveyy commented 4 years ago

@erkarl Should work now https://github.com/ExchangeUnion/xud-docker/pull/771/commits/67f92d7b6516e240c8f17b6a52ff49a451ad9387

ghost commented 4 years ago

@erkarl Should work now ExchangeUnion/xud-docker@67f92d7

It still seems to use proxy 1.0.0 for me :thinking:

➜  xud-docker git:(master) βœ— bash xud.sh -b setup-status --proxy.disabled false
1) Simnet
2) Testnet
3) Mainnet
Please choose the network: 3
Pulling image exchangeunion/utils:latest__setup-status
πŸš€ Launching mainnet environment
🌍 Checking for updates...
- Container mainnet_proxy_1: recreate
A new version is available. Would you like to upgrade (Warning: this may restart your environment and cancel all open orders)? [Y/n] Y
Recreating mainnet_proxy_1...

πŸƒ Warming up...

Syncing light clients:
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ SERVICE β”‚ STATUS                                              β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ lndbtc  β”‚ Syncing 99.99% (656128/656135)                      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ lndltc  β”‚ Syncing 23.55% (458000/1944029)                     β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Running containers:

➜  ~ docker ps
CONTAINER ID        IMAGE                                      COMMAND                  CREATED             STATUS              PORTS                                                    NAMES
d74fc25fc836        exchangeunion/proxy:1.0.0                  "/entrypoint.sh"         37 seconds ago      Up 36 seconds       127.0.0.1:8889->8080/tcp                                 mainnet_proxy_1
0e8ebef3d812        exchangeunion/utils:latest__setup-status   "python -m launcher …"   47 seconds ago      Up 47 seconds                                                                mainnet_utils_1
e0d12c54775e        exchangeunion/xud:1.2.0                    "/entrypoint.sh"         About an hour ago   Up 36 seconds       8887/tcp, 18887/tcp, 0.0.0.0:8885->8885/tcp, 28887/tcp   mainnet_xud_1
095d6536f455        exchangeunion/boltz:1.1.1                  "/usr/bin/supervisor…"   About an hour ago   Up 36 seconds       9002-9003/tcp                                            mainnet_boltz_1
5dfcd57e78a1        exchangeunion/connext:1.3.6                "/usr/bin/supervisor…"   About an hour ago   Up 36 seconds       5040/tcp                                                 mainnet_connext_1
cfaa8d9ee12b        exchangeunion/lndltc:0.11.0-beta.rc1       "/usr/bin/supervisor…"   About an hour ago   Up 36 seconds                                                                mainnet_lndltc_1
ba5bdbaa4154        exchangeunion/lndbtc:0.11.1-beta           "/usr/bin/supervisor…"   About an hour ago   Up 36 seconds                                                                mainnet_lndbtc_1
ghost commented 4 years ago

Also, needs a rebase @reliveyy