raiden-network / light-client

The Raiden Light Client
https://raiden.network/
MIT License
33 stars 31 forks source link

I want to easily install the dApp on my local system #880

Closed christianbrb closed 3 years ago

christianbrb commented 4 years ago

User Story

As Chris, I want to easily install the dApp on my local system so that I can test it without a hosted environment.

Acceptance criteria

nephix commented 4 years ago

without a hosted environment

does that mean no external dependencies at all?

kelsos commented 4 years ago

We can give it a try if you can use the gh_pages branch sources in the browser without the need for any server. If it works maybe we can pack a version of the dApp in an archive and allow the users to extract and run locally from the browser.

nephix commented 4 years ago

In Chrome v73 and later we can already install the Light Client as a Chrome App:

  1. Go to https://lightclient.raiden.network
  2. Click on Settings (3 dots at top right)
  3. Click on Install raiden-dapp

It then installs it as a PWA locally and starts it in a "native window". Still requires a hosted version to fetch updates from though. It can then be started by typing chrome://apps into Chrome and clicking on raiden-dapp.

Not sure but depending on exact requirements it could already be sufficient

andrevmatos commented 4 years ago

Nice finding @nephix, thanks @kelsos for the the seamless PWA implementation. The local static files from gh_pages branch is also a nice option, although we need to check if everything behaves properly when served from local filesystem on Chrome & Firefox. Just let's not go the cursed Electron route on this issue.

christianbrb commented 4 years ago

@andrevmatos to check, if PWA works with MetaMask

christianbrb commented 4 years ago

@kelsos proposed to do this with Electron

kelsos commented 4 years ago

@kelsos proposed to do this with Electron

I wouldn't say I proposed to do this with Electron. Rather, I said if the other ways to do it are not acceptable and we have to go the electron way then I can help because I have some prior experience with Electron and Vue :)

christianbrb commented 4 years ago

Ok, I hear your excitement 🤣

christianbrb commented 4 years ago

We should check

  1. If there is an easy way to host it on the user's machine (like the wizard with a local webserver).
  2. If MetaMask can be integrated in Electron
christianbrb commented 4 years ago

@andrevmatos @weilbith @kelsos Who has got time to do some pre-iteration research on this?

andrevmatos commented 4 years ago

I just checked here, and Metamask is definitely fully available for PWAs on Chromium. Would it be enough to provide it, and point to the serve_pr script or full local build/serve if the user needs further control?

kelsos commented 4 years ago

I just checked here, and Metamask is definitely fully available for PWAs on Chromium. Would it be enough to provide it, and point to the serve_pr script or full local build/serve if the user needs further control?

The problem with serve_pr is that it requires some technical skills, if the local version is targeting non-technical users I don't think it would work that easy.

christianbrb commented 4 years ago

The proposal from Kelsos:

palango commented 3 years ago

The proposal from Kelsos:

* Pack an express app with a node backend which serves the application

* Leave the user to use MetaMask

* Run in the local browser

The only problem I see with this approach is that the user might not know/understand how to stop the application properly. The same happened with the wizard running as a bundle from a terminal.

kelsos commented 3 years ago

The proposal from Kelsos:

* Pack an express app with a node backend which serves the application

* Leave the user to use MetaMask

* Run in the local browser

The only problem I see with this approach is that the user might not know/understand how to stop the application properly. The same happened with the wizard running as a bundle from a terminal.

I don't see how that is a problem. This could be easily solved if you add a terminate endpoint to the "server" and some packaged mode customization so that the user can terminate the server directly from the dApp. I think the WebUI is doing a similar thing with the python client already.

kelsos commented 3 years ago

Btw the server doesn't have to be node either, you could easily do a small flask backend packaged with PyInstaller that can produce binaries for Linux/OSX and Windows.

christianbrb commented 3 years ago

To check, if it works as a progressive web app:

christianbrb commented 3 years ago

@andrevmatos Could you roughly check the PWA concept.

Ok, I think it is not working on a lot of browsers: https://caniuse.com/web-app-manifest

I have found this articles: https://almbok.com/kb/progressive_web_application https://web.dev/progressive-web-apps/

PWA seems to work on MetaMask Mobile: https://github.com/MetaMask/metamask-mobile/issues/1966

christianbrb commented 3 years ago

It seems to mainly work on mobile.

christianbrb commented 3 years ago

Just for completness. There is a PWA plug-in for Vue: https://axelhodler.medium.com/caching-in-a-vue-js-pwa-845233696072 https://vuepress.vuejs.org/plugin/official/plugin-pwa.html

christianbrb commented 3 years ago

Edit: Caching question moved to #2382

If not there is another way of building offline available web pages: https://vueschool.io/articles/vuejs-tutorials/vue-js-performance-mastering-cache/ https://samvloeberghs.be/posts/lessons-learned-on-offline-capabilities-with-service-workers-using-workbox/

weilbith commented 3 years ago

https://vuepress.vuejs.org/plugin/official/plugin-pwa.html

We use that already if I'm not wrong.

christianbrb commented 3 years ago

Closing this one as it has a long discussion and the scope is not clear any more.

First we are going to fix https://github.com/raiden-network/light-client/issues/2382

If need we are going to create a new issue for using the service worker / cache offline capability.