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

How to build a headless executable CLI? #6166

Open
msafi opened this issue May 19, 2020 · 5 comments
Open

How to build a headless executable CLI? #6166

msafi opened this issue May 19, 2020 · 5 comments

Comments

@msafi
Copy link

msafi commented May 19, 2020

I want to use Electrum CLI to provide wallet functionality in my app. So basically I want to build a GUI on top of an Electrum CLI. So I was wondering if it's possible to build executable Electrum CLIs for Windows, macOS, and Linux? And how to do it?

@ecdsa
Copy link
Member

ecdsa commented May 20, 2020

you do not need to 'build' it, just run Electrum from python sources.
if you use only the CLI you do not need to install Qt

@msafi
Copy link
Author

msafi commented May 20, 2020

@ecdsa I'm not sure what you mean by "just run Electrum from python sources".

I want to ship Electrum CLI as part of a TypeScript Electron desktop app. So I need an executable binary of Electrum's CLI.

I tried to create this executable binary on my macOS machine, but I don't think I did it right. I cloned the spesmilo/electrum, ran brew install qt5 pyqt5 gettext, then ran python3 run_electrum and got this:

Error: at least one of ('pycryptodomex', 'cryptography') needs to be installed.

But even if I fix this error and manage to run Electrum with the run_electrum script, I don't think that alone gets me to my goal of having a portable Electrum CLI, right?

@SomberNight
Copy link
Member

I don't know how you could have a "portable" binary between e.g. Windows and MacOS.
The typical solution is just to build one for each platform.
This is also what we do when distributing Electrum.

You could build Electrum using the build scripts in this repository, separate binary for each target platform. Those binaries can be used for CLI (well, Windows is problematic atm, see #2592). If you want, you can strip out Qt by customising the build scripts.

@msafi
Copy link
Author

msafi commented May 21, 2020

@SomberNight Yes, sorry I wasn't clear. I do expect to build a separate binary for each platform.

It's a bummer that the CLI doesn't work on Windows though!

@harryqt
Copy link

harryqt commented Jun 18, 2023

Do anyone knows how to build electrum cli only? I don't want GUI because it will be running on a server.

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

No branches or pull requests

4 participants