-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add webui This commit adds xud-webui-poc (ReactJS based frontend) and xud-socketio (NodeJS based backend) into one container `webui`. And the container will expose port 8080 to your host. The frontend app uses REST + Websocket (socketio) API to get the order book of different trading pairs. The backend server translates the REST + Websocket API to gRPC calls and send it back to xud container. * revert xud changes * fixup! testnet and mainnet * add --webui option * fix arm grpc-tools * update * update favicon * use fontsource-roboto * add --webui.disabled and --webui.expose-ports options * move webui before xud * add missing --use-local-images * expose webui port by default * stop webui gracefully * add webui expose-ports option in network.conf * 8080
- Loading branch information
Showing
12 changed files
with
209 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,3 +131,7 @@ | |
|
||
[boltz] | ||
#disabled = false | ||
|
||
[webui] | ||
#disabled = false | ||
#expose-ports = ["18888:8080"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from .base import Node | ||
|
||
|
||
class Webui(Node): | ||
def __init__(self, name, ctx): | ||
super().__init__(name, ctx) | ||
|
||
def status(self): | ||
return "Ready" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
FROM node:14-alpine as builder | ||
RUN apk --no-cache add git | ||
|
||
RUN git clone -b socketio https://github.com/ExchangeUnion/xud-webui-poc /src/frontend | ||
WORKDIR /src/frontend | ||
RUN git fetch && git checkout b94cb330 | ||
RUN yarn install | ||
RUN yarn build | ||
|
||
RUN git clone -b dev https://github.com/ExchangeUnion/xud-socketio /src/backend | ||
WORKDIR /src/backend | ||
RUN git fetch && git checkout a3fd8648 | ||
RUN sed -Ei 's/^.*grpc-tools.*$//g' package.json | ||
RUN yarn install | ||
RUN apk --no-cache add bash | ||
RUN yarn build | ||
|
||
|
||
FROM node:14-alpine | ||
COPY --from=builder /src/backend/node_modules /app/node_modules | ||
COPY --from=builder /src/backend/dist /app/dist | ||
COPY --from=builder /src/backend/bin /app/bin | ||
COPY --from=builder /src/frontend/build /app/public | ||
COPY entrypoint.sh / | ||
WORKDIR /app | ||
RUN apk --no-cache add supervisor | ||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
FROM node:14-alpine as builder | ||
RUN apk --no-cache add git | ||
|
||
RUN git clone -b socketio https://github.com/ExchangeUnion/xud-webui-poc /src/frontend | ||
WORKDIR /src/frontend | ||
RUN git fetch && git checkout b94cb330 | ||
RUN yarn install | ||
RUN yarn build | ||
|
||
RUN git clone -b dev https://github.com/ExchangeUnion/xud-socketio /src/backend | ||
WORKDIR /src/backend | ||
RUN git fetch && git checkout a3fd8648 | ||
RUN sed -Ei 's/^.*grpc-tools.*$//g' package.json | ||
RUN apk --no-cache add python3 make g++ | ||
RUN yarn install | ||
RUN apk --no-cache add bash | ||
RUN yarn build | ||
|
||
|
||
FROM node:14-alpine | ||
COPY --from=builder /src/backend/node_modules /app/node_modules | ||
COPY --from=builder /src/backend/dist /app/dist | ||
COPY --from=builder /src/backend/bin /app/bin | ||
COPY --from=builder /src/frontend/build /app/public | ||
COPY entrypoint.sh / | ||
WORKDIR /app | ||
RUN apk --no-cache add supervisor | ||
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
ENTRYPOINT ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/sh | ||
|
||
case $NETWORK in | ||
simnet) | ||
RPCPORT=28886 | ||
;; | ||
testnet) | ||
RPCPORT=18886 | ||
;; | ||
mainnet) | ||
RPCPORT=8886 | ||
;; | ||
*) | ||
echo "Invalid NETWORK" | ||
exit 1 | ||
esac | ||
|
||
while ! [ -e /root/.xud/tls.cert ]; do | ||
echo "Waiting for /root/.xud/tls.cert" | ||
sleep 1 | ||
done | ||
|
||
exec bin/server --xud.rpchost=xud --xud.rpcport=$RPCPORT --xud.rpccert=/root/.xud/tls.cert |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
[supervisord] | ||
nodaemon=true | ||
logfile=/supervisord.log | ||
childlogdir=/app | ||
user=root | ||
|
||
[program:webui] | ||
stdout_logfile=/dev/stdout | ||
stdout_logfile_maxbytes=0 | ||
command=/entrypoint.sh | ||
stopsignal=SIGINT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,3 +5,5 @@ pytest-html | |
pytest-integration | ||
pytest-timeout | ||
pytest-dotenv | ||
toml | ||
demjson |