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

JoinMarket Web UI #2747

Merged
merged 11 commits into from
Jan 15, 2022
Merged

JoinMarket Web UI #2747

merged 11 commits into from
Jan 15, 2022

Conversation

dennisreimann
Copy link
Contributor

The JoinMarket Web UI is work in progress, nevertheless the deployment on the RaspiBlitz works and I'm publishing this as a draft to allow others to give this early stage version a go.

@rootzoll rootzoll added this to the 1.7.2 Release milestone Nov 30, 2021
@openoms
Copy link
Collaborator

openoms commented Dec 1, 2021

Is this planned to be a CLI intstall only for now (for testing) or shall we put it into the SERVICES menu?

Also an update option might come useful if iterating on it often.

@dennisreimann
Copy link
Contributor Author

This is just the most basic version I could come up with :)

I'll happily add it to the service menu and add bells and whistles – right now more work needs to be done on the app though.

@openoms
Copy link
Collaborator

openoms commented Dec 1, 2021

Thank you for doing this already!
The question is more about how you feel about the maturity of the project, if we should expose it to be a one-click install in the menu or leave it to the more advanced people to test for now?

@openoms
Copy link
Collaborator

openoms commented Dec 1, 2021

Tried to install and the joinmarket-api.service is running ok, but the NodeJS UI would need service too, right?

if I do:

cd /home/joinmarket/webui/
sudo -u joinmarket npm start

There are these errors:

Compiled with warnings.

src/components/App.jsx
  Line 73:41:  React Hook useEffect has a missing dependency: 'refreshWallets'. Either include it or remove the dependency array  react-hooks/exhaustive-deps

src/components/CurrentWallet.jsx
  Line 74:6:  React Hook useEffect has missing dependencies: 'currentWallet', 'listUTXOs', and 'listWalletInfo'. Either include them or remove the dependency array. If 'listUTXOs' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps

src/components/Payment.jsx
  Line 5:10:  'getSession' is defined but never used  no-unused-vars

src/utils.js
  Line 19:6:  React Hook useEffect has missing dependencies: 'callback' and 'immediate'. Either include them or remove the dependency array. If 'callback' changes too often, find the parent component that defines it and wrap that definition in useCallback  react-hooks/exhaustive-deps

Search for the keywords to learn more about each warning.
To ignore, add // eslint-disable-next-line to the line before.

The web-UI only connects to an internal port to the joinmarket-api, right?
in that case would be best to separate the NodeJS gui to under an other user so it has no file access to the wallets.

@dennisreimann
Copy link
Contributor Author

dennisreimann commented Dec 1, 2021

if we should expose it to be a one-click install in the menu or leave it to the more advanced people to test for now?

Definitely the latter. I'm not done refactoring the app and making everything work. The current state is very early and should be considered as a way to get a glimpse in case you are curious and know what you are doing. We shouldn't convey the impression that this is something ready, hence I'd refrain from adding it to the menu just yet.

but the NodeJS UI would need service too, right?

Nope, the build version is served as a static website using nginx, that's also why there is plain http server entry.

The npm start command is used for local development. For the deployment we need to npm run build, which creates a production version in the build directory.

in that case would be best to separate the NodeJS gui to under an other user so it has no file access to the wallets.

As the GUI is just a bunch of static files that get run client side and there is no running server component involved, I think this isn't necessary.

@rootzoll
Copy link
Collaborator

OK .. seeing this marked as draft so I will push PR to v1.8.0 milestone to give it a bit more time.

@rootzoll rootzoll removed the final testing was fixed - needs testing label Dec 13, 2021
@rootzoll rootzoll modified the milestones: 1.7.2 Release, 1.8 Release Dec 13, 2021
@dennisreimann dennisreimann marked this pull request as ready for review January 4, 2022 13:50
@dennisreimann
Copy link
Contributor Author

The basics in the app are working now and the integration is done, so this is ready for review now :) /cc @openoms

@rootzoll
Copy link
Collaborator

rootzoll commented Jan 4, 2022

So should I move this PR to be included in v1.7.2?

@dennisreimann
Copy link
Contributor Author

Yes, that can happen imho. We should communicate that the app is still a very early version, nevertheless it is working and having it available to end users will help us gather valuable feedback.

@openoms
Copy link
Collaborator

openoms commented Jan 5, 2022

A quick test with a fresh node on dev with JM already installed.
(will edit with updates):

# download
wget -O assets/nginx/sites-available/joinmarket_webui.conf https://raw.githubusercontent.com/dennisreimann/raspiblitz/joinmarket-webui/home.admin/assets/nginx/sites-available/joinmarket_webui.conf

wget -O assets/nginx/sites-available/joinmarket_webui_ssl.conf https://raw.githubusercontent.com/dennisreimann/raspiblitz/joinmarket-webui/home.admin/assets/nginx/sites-available/joinmarket_webui_ssl.conf

wget -O assets/nginx/sites-available/joinmarket_webui_tor.conf https://raw.githubusercontent.com/dennisreimann/raspiblitz/joinmarket-webui/home.admin/assets/nginx/sites-available/joinmarket_webui_tor.conf 

wget -O assets/nginx/sites-available/joinmarket_webui_tor_ssl.conf https://raw.githubusercontent.com/dennisreimann/raspiblitz/joinmarket-webui/home.admin/assets/nginx/sites-available/joinmarket_webui_tor_ssl.conf 

wget -O config.scripts/bonus.joinmarket-webui.sh  https://raw.githubusercontent.com/dennisreimann/raspiblitz/joinmarket-webui/home.admin/config.scripts/bonus.joinmarket-webui.sh 

# make executable
chmod +x  config.scripts/bonus.joinmarket-webui.sh

# install
config.scripts/bonus.joinmarket-webui.sh on

# info
config.scripts/bonus.joinmarket-webui.sh menu

Nice and clean install I like it!

@dennisreimann
Copy link
Contributor Author

dennisreimann commented Jan 5, 2022

@openoms While we are at it: What is the best/recommended way to test a PR, especially it it involves more files? There ain't a way to check out a specific branch, right? So I assume doing it like you posted is the most pragmatic solution.

@openoms
Copy link
Collaborator

openoms commented Jan 5, 2022

@openoms While we are at it: What is the best/recommended way to test a PR, especially it it involves more files? There ain't a way to check out a specific branch, right? So I assume doing it like you posted is the most pragmatic solution.

check the UPDATE menu, there you can use your own forked repo branch or checkout a PR as well.

The dev has changed a lot, but it does not really affect bitcoin or joinmarket so it is fine to just download these 5 files separately too.

Currently testing a change to have everything configured ready for the web-gui without needing to enter the joininbox menu.

openoms added a commit that referenced this pull request Jan 5, 2022
@openoms openoms modified the milestones: 1.8 Release, 1.7.2 Release Jan 5, 2022
@openoms
Copy link
Collaborator

openoms commented Jan 5, 2022

There is one more thing that:
the wallet.dat needs to be loaded in bitcoind before the jmwalletd.py can start.
As the bitcoin-cli cannot be reliably used during the initial setup and recovery this should be checked in a precheck script with the joinmarket-api.service.

if
bitcoin-cli listwallets
does not have the wallet.dat
will need to run:
bitcoin-cli createwallet wallet.dat
I will do this once merged.

@rootzoll this looks good already and would be good to be part of v1.7.2 (rc)

@rootzoll
Copy link
Collaborator

rootzoll commented Jan 9, 2022

Just a raw quick test. I installed the Joinmarket-WebUi and then calling the hidden service I got:

Bildschirmfoto 2022-01-09 um 01 24 09

What to check for debugging?

@openoms
Copy link
Collaborator

openoms commented Jan 9, 2022

Just a raw quick test. I installed the Joinmarket-WebUi and then calling the hidden service I got:

Bildschirmfoto 2022-01-09 um 01 24 09

What to check for debugging?

the reason is exactly what is described in the comment above.
The backend doesn't run until:

bitcoin-cli createwallet wallet.dat

is done.

@openoms
Copy link
Collaborator

openoms commented Jan 11, 2022

Ok should be all functional now even on fresh installs>
Test on a v1.7.2RC:

# download
wget -O assets/nginx/sites-available/joinmarket_webui.conf https://raw.githubusercontent.com/dennisreimann/raspiblitz/joinmarket-webui/home.admin/assets/nginx/sites-available/joinmarket_webui.conf

wget -O assets/nginx/sites-available/joinmarket_webui_ssl.conf https://raw.githubusercontent.com/dennisreimann/raspiblitz/joinmarket-webui/home.admin/assets/nginx/sites-available/joinmarket_webui_ssl.conf

wget -O assets/nginx/sites-available/joinmarket_webui_tor.conf https://raw.githubusercontent.com/dennisreimann/raspiblitz/joinmarket-webui/home.admin/assets/nginx/sites-available/joinmarket_webui_tor.conf 

wget -O assets/nginx/sites-available/joinmarket_webui_tor_ssl.conf https://raw.githubusercontent.com/dennisreimann/raspiblitz/joinmarket-webui/home.admin/assets/nginx/sites-available/joinmarket_webui_tor_ssl.conf 

wget -O config.scripts/bonus.joinmarket-webui.sh  https://raw.githubusercontent.com/dennisreimann/raspiblitz/joinmarket-webui/home.admin/config.scripts/bonus.joinmarket-webui.sh 

# make executable
chmod +x  config.scripts/bonus.joinmarket-webui.sh

# install
config.scripts/bonus.joinmarket-webui.sh on

# info
config.scripts/bonus.joinmarket-webui.sh menu

@rootzoll
Copy link
Collaborator

Test looks good - merging :)

@rootzoll rootzoll merged commit 7a7693c into raspiblitz:dev Jan 15, 2022
@rootzoll
Copy link
Collaborator

@openoms do we also want to add it to the service menu ... how do we combine the option with the JoinInBox?

@openoms
Copy link
Collaborator

openoms commented Jan 16, 2022

Good question.
I think at this stage the webgui functions are still very limited so adding to the raspiblitz menu would create more confusion than help and adding it by default is not yet a good idea.

I am planning to add this install script to joininbox as well which has faster iterations so it can be a more obvious menu option there soon.

In my opinion we can aim to make the JM webgui install option available in the RaspiBlitz menu in the v1.8.0 release.

What do you think @dennisreimann ?

@dennisreimann
Copy link
Contributor Author

@openoms that sounds very reasonable and good. 👍

@rootzoll
Copy link
Collaborator

OK .. created a folllow-up issue for v1.8 #2891

So we can consider this issue ready for release. Good work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants