Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: serve orderbook #49

Merged
merged 1 commit into from
Aug 2, 2022
Merged

feat: serve orderbook #49

merged 1 commit into from
Aug 2, 2022

Conversation

theborakompanioni
Copy link
Collaborator

@theborakompanioni theborakompanioni commented Jul 25, 2022

Serving the orderbook via nginx by passing requests to ob-watcher.py daemon.

Related to joinmarket-webui/jam#422.

How to test these changes?

  • Checkout this branch and build the standalone docker image locally with
docker build --label "local" \
        --build-arg JM_UI_REPO_REF=master \
        --build-arg JM_SERVER_REPO_REF=master \
        --tag "jam-serve-orderbook-standalone" ./standalone
  • Checkout the branch orderbook for PR#422 in project joinmarket-webui and apply the following patch:
From b1a94581941cee920e90d314c141b150ad269244 Mon Sep 17 00:00:00 2001
From: theborakompanioni <[email protected]>
Date: Mon, 25 Jul 2022 14:56:12 -0600
Subject: [PATCH] dev: test serve-orderbook-docker-patch

---
 docker/regtest/docker-compose.yml                             | 4 ++--
 .../dockerfile-deps/joinmarket/webui-standalone/Dockerfile    | 2 +-
 src/setupProxy.js                                             | 4 ++--
 3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/docker/regtest/docker-compose.yml b/docker/regtest/docker-compose.yml
index b956eea..e51423d 100644
--- a/docker/regtest/docker-compose.yml
+++ b/docker/regtest/docker-compose.yml
@@ -59,8 +59,8 @@ services:
       READY_FILE: /root/.nbxplorer/btc_fully_synched
       ENSURE_WALLET: "true"
       REMOVE_LOCK_FILES: "true"
-      APP_USER: joinmarket
-      APP_PASSWORD: joinmarket
+      #APP_USER: joinmarket
+      #APP_PASSWORD: joinmarket
       jm_rpc_wallet_file: jm_secondary
       jm_minimum_makers: 1
       jm_tx_broadcast: self
diff --git a/docker/regtest/dockerfile-deps/joinmarket/webui-standalone/Dockerfile b/docker/regtest/dockerfile-deps/joinmarket/webui-standalone/Dockerfile
index 126e19e..acf1fa0 100644
--- a/docker/regtest/dockerfile-deps/joinmarket/webui-standalone/Dockerfile
+++ b/docker/regtest/dockerfile-deps/joinmarket/webui-standalone/Dockerfile
@@ -1,4 +1,4 @@
-FROM ghcr.io/joinmarket-webui/joinmarket-webui-dev-standalone:master
+FROM jam-serve-orderbook-standalone:latest
 
 COPY default.cfg "${DEFAULT_CONFIG}"
 
diff --git a/src/setupProxy.js b/src/setupProxy.js
index bf02f15..9ea938e 100644
--- a/src/setupProxy.js
+++ b/src/setupProxy.js
@@ -31,8 +31,8 @@ module.exports = (app) => {
 
   app.use(
     createProxyMiddleware(`${PUBLIC_URL}/obwatch/`, {
-      target: 'http://localhost:62601',
-      pathRewrite: { [`^${PUBLIC_URL}/obwatch/`]: '' },
+      target: 'http://localhost:29080',
+      //pathRewrite: { [`^${PUBLIC_URL}/obwatch/`]: '' },
       changeOrigin: true,
       secure: false,
     })
-- 
2.37.1

Requests to the orderbook will then be routed to the secondary container that contains the change and will serve the orderbook via the nginx proxy rules.

Start the regtest setup as normal and view the orderbook. It might take some time for the ob-watcher.py script to complete initialization. If the orderbook is not served as expected immediately, see the obwatcher logs with:

docker exec -it jm_regtest_joinmarket2 tail -f /root/.joinmarket/logs/obwatch_stdout.log -n 200

.. and wait for the following message

started http server, visit http://127.0.0.1:62601/

@theborakompanioni theborakompanioni added enhancement New feature or request concept labels Jul 25, 2022
@theborakompanioni theborakompanioni self-assigned this Jul 25, 2022
@theborakompanioni theborakompanioni marked this pull request as ready for review July 25, 2022 11:24
@theborakompanioni theborakompanioni requested a review from a user July 25, 2022 11:24
@ghost ghost changed the title feat: Serve orderbook feat: serve orderbook Aug 2, 2022
Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested according to description. Works fine. LGTM ✅

@theborakompanioni theborakompanioni merged commit 0298b0f into master Aug 2, 2022
@theborakompanioni theborakompanioni deleted the serve-orderbook branch August 2, 2022 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
concept enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant