experiment: demo electron integration #999
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR is to demonstrate a deep Electron app integration. Key points are
Core
is compiled and imported as a node module (see, for example, this tutorial), precluding the need to run a separate executable and allowing us to useCore
directly in the Electron main process.Core
before even starting an HTTP server, e.g. initialization, wallet creation, dex registration. Once all of that is done, you can start the server and point your window at it. With some minor changes, we could probably even get around HTTP altogether by implementing a customnet.Listener
andnet.Conn
for theServer
to use.The demo is for Linux, but should be portable without too much effort. To run, go to
client/cmd/electron-demo
and runmake build run
On some Linux, you may see a message about a file called
chrome-sandbox
. You'll need to tighten permissions.If you have the dcrdex simnet harnesses running for
dcrdex
,dcr
, andbtc
, you can also use the full demo where the Electron app prepares the wallets and registers with the DEX. Justmake build run-simnet
.This is just for demo for now, but I can clean this up for merging if desired.
I'm using node version v15.8.0