question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't Run Electrum Daemon on Windows

See original GitHub issue
$electrum daemon start

C:\Python36\lib\site-packages\win32\lib\pywintypes.py:2: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp, sys, os
Traceback (most recent call last):
  File "./run_electrum", line 377, in <module>
    pid = os.fork()
AttributeError: module 'os' has no attribute 'fork'```

Issue Analytics

  • State:open
  • Created 4 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
Telariustcommented, Aug 11, 2019

I declare - Electrum daemon fully works in Windows! I am using it now! (there are just some unobvious details) (what do you mean by “fully works”?) (if you mean server electrumX and its server commands, then this is completely different)

Daemon starts, but the json rpc api does not function

json rpc api (after secfix 3.0.5)

  • used rand port
  • used rand password
  • not load_wallet on run (but we can load wallet under rpc, if know right port and pass!)

ok, explain, step-by-step

FAQ, how run Electrum in daemon mode with json rpc api under Windows.

success tested on win7x64, run cmd/.bat as admin

  1. download electrum i used electrum-3.3.8-portable.exe i dont tested full install ver, but i think - not diff

  2. run it and create wallet with seed - better if import privkey, some command correlation with seed dont be work(example, getseed) if import pub/xpub, some command correlation with privkey dont be work(example, signtransaction)

  3. close it

  4. goto wallet dir, open config, example ./electrum_data/config add strings

    "rpcpassword": "myrpcpass",
    "rpcport": 7777,
    "rpcuser": "user",

rpchost not need, all works without it, but u can try 0.0.0.0 or 127.0.0.1 rpcpassword may already be. in base64 form. this is misleading - you DO NOT need to convert your new pwd to base64, and does not affect the basic-auth rpc! just electrum generates a rand pwd from raw bytes and presents them in base64 for convenience. wrote the new pwd in plaintext and for rpc - too, as it is. or use default rand pwd as it is, without any decode/encode.

  1. create some .bat files create _start-rpc.bat (if want gui)
start electrum-3.3.8-portable.exe
timeout /T 10
start electrum-3.3.8-portable.exe daemon load_wallet

create _start-rpc_as_daemon.bat (if want not gui)

start electrum-3.3.8-portable.exe daemon 
timeout /T 10
start electrum-3.3.8-portable.exe daemon load_wallet

create _stop-rpc.bat (if u want correct close) start electrum-3.3.8-portable.exe daemon stop

  1. if u want use custom path to wallet, use -w start electrum-3.3.8-portable.exe daemon load_wallet -w /path/to/my/wallet/dir

  2. run _start-rpc.bat or _start-rpc_as_daemon.bat now in task manager u seen 2proc of electrum, it norm

  3. try connect to rpc, try some commands - all must work

  4. all work on top fork! success tested on ElectrumSV-1.2.1-portable Electron-Cash-4.0.7-portable (but .bat not auto close, because stdout on forks tied to cmd parent proc, but it not big problem)

profit! hoho!

1reaction
Telariustcommented, Jul 21, 2019

maybe python36 in 2019? but there are other factors

checked win7x64, cmd as admin

if try run daemon under windows (according to official manual) C:\1>electrum-3.3.8-portable.exe daemon start …get back popup-qt

Fatal error detected
Failed to execute script run_electrum

after googled, ./run_electrum - old problem for windows

but use simple fix - run it without start opt C:\1>electrum-3.3.8-portable.exe daemon and now in task manager u seen 2proc dont forget load_wallet C:\1>electrum-3.3.8-portable.exe daemon load_wallet after this - rpc full ready!

if would need, add -w [custom_path_to_wallet]

if need close C:\1>electrum-3.3.8-portable.exe daemon stop

PS: see also usefull message by @turcol about windows cmd https://github.com/spesmilo/electrum/issues/2592#issuecomment-484562196

Read more comments on GitHub >

github_iconTop Results From Across the Web

Electrum 3.3.8 is not opening on Windows 10 - Bitcoin Forum
Try uninstalling Electrum and moving 'Electrum' folder located in 'C:\Users\Username\AppData\Roaming\Electrum' to your desktop. Don't delete it ...
Read more >
Command Line — Electrum 3.3 documentation
By default, commands are sent to an Electrum daemon. Here is how to start and stop the daemon: electrum daemon -d electrum getinfo...
Read more >
How to use electrum RPC to get address balance on windows
Turns out that electrum doesn't have to be in daemon mode to receive api requests, but it has to be in daemon mode...
Read more >
How To Install Electrum On Linux - AddictiveTips
Going this route means that nearly anyone on any distribution can use Electrum. To start the installation process, open up a terminal window...
Read more >
Electrum over Tor - Hodl-Guide
The circle in the bottom right corner should now be blue and not green. You have now configured Electrum to run over Tor....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found