Bitcoin Forum
November 12, 2024, 12:28:18 PM *
News: Check out the artwork 1Dq created to commemorate this forum's 15th anniversary
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: [Questions] Running my own electrum server  (Read 528 times)
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8336


Fiatheist


View Profile WWW
April 23, 2021, 08:42:43 AM
 #1

I have been experimenting with electrum as a wallet since I learnt about bitcoin, a year ago, and I can admit that it's the simplest and most useful one. I'd like to run my own electrum server, but not for privacy reasons, just for exercise. I also have bought a Windows VPS that isn't being used at the moment, so why not providing it to the electrum community?

I picked electrumx, because it's the most popular implementation. It seems that I can't install it on windows, only on unix. The thing is that I don't have an Ubuntu installed right now. Could this work with Windows 10 on an Ubuntu LTS?

Other questions too:
  • Is the same procedure if I want to run a testnet server? I don't have the storage for downloading the entire blockchain.
  • How does it return the balance of address(es) instantly? On Bitcoin Core it has to rescan the blockchain (which will take a lot of time).
  • Will I be shown on others' network servers? If no, how can I be shown?

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4361

<insert witty quote here>


View Profile
April 23, 2021, 09:07:02 AM
 #2

I also have bought a Windows VPS that isn't being used at the moment, so why not providing it to the electrum community?
Be wary of any storage, bandwidth or CPU caps that your VPS has... an Electrum server isn't necessarily "huge" in terms of requirements, but cheap VPSes often have relatively low caps.


I picked electrumx, because it's the most popular implementation. It seems that I can't install it on windows, only on unix. The thing is that I don't have an Ubuntu installed right now. Could this work with Windows 10 on an Ubuntu LTS?
Possibly... I've run other Electrum servers on WSL (ie. electrs) but it's obviously not ideal for performance reasons (and you're also doubling up on OS storage space requirements.)


  • Is the same procedure if I want to run a testnet server? I don't have the storage for downloading the entire blockchain.
usually you need a fully synced, unpruned node, running with txindex=1... and you set the "network" type in electrumx and then point it at the appropriate data directory.

  • How does it return the balance of address(es) instantly? On Bitcoin Core it has to rescan the blockchain (which will take a lot of time).
you'll want to read up about SPV and bloom filters. Wink but ElectrumX basically builds its own index of the blockchain


  • Will I be shown on others' network servers? If no, how can I be shown?
Will generally depend on how you set it up and firewalls etc

peer discovery is also explained in the ElectrumX docs: https://electrumx-spesmilo.readthedocs.io/en/latest/

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8336


Fiatheist


View Profile WWW
April 23, 2021, 09:20:07 AM
 #3

Do you mean Ubuntu LTS which run though VirtualBox/WSL? It should work.
I mean the Ubuntu LTS that requires enabling the WSL. But, going through a virtual box seems better, I hadn't thought of it.

usually you need a fully synced, unpruned node, running with txindex=1... and you set the "network" type in electrumx and then point it at the appropriate data directory.
Since it creates its own index, is there a reason why I should “carry” the entire blockchain? Also, are these things detailed on the documentation or I should use the search button whenever I have a similar query? I just want to know if it's a complicated setup.

peer discovery is also explained in the ElectrumX docs: https://electrumx-spesmilo.readthedocs.io/en/latest/
Nice, thanks.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8336


Fiatheist


View Profile WWW
April 23, 2021, 08:35:36 PM
 #4

I admit defeat... I've been trying to run electrumx for my testnet bitcoin node but can't understand how it works! Is that HOWTO tutorial is too complicated or is it just me? I still haven't found out what is the running file.


Is this the part that should start my electrumx server? Because it returns me this when I enter “systemctl start electrumx”.:
Code:
System has not been booted with systemd as init system (PID 1). Can't operate.

I also haven't understood yet how it'll connect with my bitcoind. Is it written on the HOWTO and I've missed it? Need help.  Lips sealed

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4361

<insert witty quote here>


View Profile
April 23, 2021, 09:12:01 PM
Merited by ABCbits (1)
 #5

Since it creates its own index, is there a reason why I should “carry” the entire blockchain?
It builds the index from the bitcoind blockchain, hence why you need it.


I don't think you can use systemd with WSL... you can however use it with WSL2: https://gist.github.com/djfdyuruiry/6720faa3f9fc59bfdf6284ee1f41f950

note that systemd is not entirely necessary to use ElectrumX... it's just a method for setting it up as a background service and autostart etc. You should be able to just "run" ElectrumX assuming you have the config etc setup correctly.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8336


Fiatheist


View Profile WWW
April 24, 2021, 10:18:58 AM
Last edit: April 24, 2021, 11:12:27 AM by BlackHatCoiner
 #6

It builds the index from the bitcoind blockchain, hence why you need it.
Does it need the entire chain once it builds the index? Can't you get rid of it later? Just wondering why you can't build the index by running pruned node.



I found this tutorial on the internet and I think that he explains it simpler than on the one of github. I haven't worked on Bitcoin Core a lot, for example I've never used its command line program, and thus I'm getting an error I don't understand. By running ./bitcoin-cli --testnet getinfo on the terminal I should be getting information about my node (such as block height).

I have opened the Bitcoin Core application (using ./bitcoind --testnet) but once I run the above command I get:
Code:
angelo@angelo:~/bitcoin/bin$ ./bitcoin-cli -testnet -rpcuser=root -rpcpassword=<PASSWORD> getinfo
error: Authorization failed: Incorrect rpcuser or rpcpassword

I have entered the same username and password on bitcoin.conf. What am I doing wrong?

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
DireWolfM14
Copper Member
Legendary
*
Offline Offline

Activity: 2338
Merit: 4566


Join the world-leading crypto sportsbook NOW!


View Profile WWW
April 24, 2021, 12:21:10 PM
Last edit: April 24, 2021, 03:09:05 PM by DireWolfM14
 #7

Since it creates its own index, is there a reason why I should “carry” the entire blockchain?
It builds the index from the bitcoind blockchain, hence why you need it.


I don't think you can use systemd with WSL... you can however use it with WSL2: https://gist.github.com/djfdyuruiry/6720faa3f9fc59bfdf6284ee1f41f950

note that systemd is not entirely necessary to use ElectrumX... it's just a method for setting it up as a background service and autostart etc. You should be able to just "run" ElectrumX assuming you have the config etc setup correctly.

You can't use systemd on wsl, it's not given access to base hardware functions like that.  I love using WSL, it's definitely the most convenient way I've found to SSH into another machine, VPS, and I even use it access my VirtualBox instances on the same host.

@BlackHatCoiner, you can install Ubuntu server onto VirtualBox, start the instance in "headless" mode, and access it with WSL.  The advantage is that you can copy and paste commands right from your windows desktop without installing all the VirtualBox additions.  I'll be a relatively light install without any bloat, and should work for your needs.

Also note worthy; ElectrumX requires bitcoin core to run unpruned, so you will have to download the entire blockchain.


In case anyone cares, here's how to set up a VirtualBox so you can ssh into it using WSL:

Obviously your VM needs to have SSH server installed, but you don't need to generate a key pair.

On your VM:
Code:
sudo apt install openssh-server

On your host, go to your vbox settings, click on network, on the "Adapter 1" tab click on Advanced to expand the field, and then click on the "Port Forwarding" button:



Create a rule as shown below.  The host port isn't critical but choose something you're certain isn't being used by another service.


Now you'll be able to start your vbox in headless mode, open a WSL window, and connect using this command:
Code:
ssh -p 2200 <vboxusername>@localhost

  ▄▄███████▄███████▄▄▄
 █████████████
▀▀▀▀▀▀████▄▄
███████████████
       ▀▀███▄
███████████████
          ▀███
 █████████████
             ███
███████████▀▀               ███
███                         ███
███                         ███
 ███                       ███
  ███▄                   ▄███
   ▀███▄▄             ▄▄███▀
     ▀▀████▄▄▄▄▄▄▄▄▄████▀▀
         ▀▀▀███████▀▀▀
░░░████▄▄▄▄
░▄▄░
▄▄███████▄▀█████▄▄
██▄████▌▐█▌█████▄██
████▀▄▄▄▌███░▄▄▄▀████
██████▄▄▄█▄▄▄██████
█░███████░▐█▌░███████░█
▀▀██▀░██░▐█▌░██░▀██▀▀
▄▄▄░█▀░█░██░▐█▌░██░█░▀█░▄▄▄
██▀░░░░▀██░▐█▌░██▀░░░░▀██
▀██
█████▄███▀▀██▀▀███▄███████▀
▀███████████████████████▀
▀▀▀▀███████████▀▀▀▀
█████████████LEADING CRYPTO SPORTSBOOK & CASINO█████████████
MULTI
CURRENCY
1500+
CASINO GAMES
CRYPTO EXCLUSIVE
CLUBHOUSE
FAST & SECURE
PAYMENTS
.
..PLAY NOW!..
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4361

<insert witty quote here>


View Profile
April 24, 2021, 09:32:12 PM
 #8

It builds the index from the bitcoind blockchain, hence why you need it.
Does it need the entire chain once it builds the index? Can't you get rid of it later? Just wondering why you can't build the index by running pruned node.
The short answer is "Yes"... the long answer is: I don't know if you can remove it later, there are personal servers that run on Pruned nodes, with the caveat that if you attempt to import addresses/keys or a new wallet, it may not show the full balance given that blocks are "missing". However, ElectrumX requires the full blockchain, AFAIK.

Why don't you try and prune the blockchain after ElectrumX has synced and then report your findings here?


I have opened the Bitcoin Core application (using ./bitcoind --testnet) but once I run the above command I get:
Code:
angelo@angelo:~/bitcoin/bin$ ./bitcoin-cli -testnet -rpcuser=root -rpcpassword=<PASSWORD> getinfo
error: Authorization failed: Incorrect rpcuser or rpcpassword

I have entered the same username and password on bitcoin.conf. What am I doing wrong?
Don't use rpcuser and rpcpassword... they're being deprecated... either use the rpcauth or the .cookie file...

The .cookie method is easiest... if you used the "default" datadir then you should just be able to not specify anything and it will just work... if you've specified a custom datadir, then you'll then to provide it on the commandline using -datadir or you can just use datadir=your/custom/path in the bitcoin.conf file.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8336


Fiatheist


View Profile WWW
April 28, 2021, 09:22:14 AM
 #9

Alright, let's see. I've redone the entire procedure, because I was very sure that I was doing something wrong.

I run electrumx_server on the terminal, but I get these errors:

Code:
angelo@DESKTOP-5QOEJVC:~/electrumx$ electrumx_server
INFO:electrumx:ElectrumX server starting
ERROR:electrumx:ElectrumX server terminated abnormally
Traceback (most recent call last):
  File "/home/angelo/.local/bin/electrumx_server", line 31, in main
    env = Env()
  File "/home/angelo/.local/lib/python3.7/site-packages/electrumx/server/env.py", line 46, in __init__
    self.db_dir = self.required('DB_DIRECTORY')
  File "/home/angelo/.local/lib/python3.7/site-packages/electrumx/lib/env_base.py", line 40, in required
    raise cls.Error(f'required envvar {envvar} not set')
electrumx.lib.env_base.EnvBase.Error: required envvar DB_DIRECTORY not set

Could it be a configuration issue?

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8336


Fiatheist


View Profile WWW
April 28, 2021, 11:34:32 AM
 #10

Yes. You need to configure the environment variable which mentioned on the electrumx environment docs.

Thanks. Are these environment variables located at home\<user>\scripts\electrumx\daemontools\env ?

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8336


Fiatheist


View Profile WWW
April 29, 2021, 09:15:06 AM
 #11

But few configuration file such as "DB_DIRECTORY" should be available by default.
The bitcoin's testnet block chain is downloaded on my external drive. Not inside any of the ubuntu's directories. Could this be the issue?

This is how I've modified DB_DIRECTORY on scripts\electrumx\daemontools\env:
Code:
E:\p2p\BTC\AppData\testnet

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8336


Fiatheist


View Profile WWW
April 29, 2021, 10:07:07 AM
Last edit: May 02, 2021, 08:32:25 PM by BlackHatCoiner
 #12

Assuming you're using daemontools and install as regular user (not as root), then yes.

What would be the difference? I'm not sure if I have installed it as a regular user. I have used sudo for most of the commands, because it kept returning me that I don't have permission. The electrumx directory is located on the main user (angelo) and not on electrumx.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4361

<insert witty quote here>


View Profile
April 29, 2021, 10:18:46 AM
 #13

This is how I've modified DB_DIRECTORY on scripts\electrumx\daemontools\env:
Code:
E:\p2p\BTC\AppData\testnet
That's not likely to work... WSL knows nothing of "Windows" paths... so things like "E:\" etc don't mean anything.

However, WSL should be mounting all the Windows drive letters under /mnt (and in lowercase!)... so you should be able to use something like:
Code:
/mnt/e/p2p/BTC/AppData/testnet

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8336


Fiatheist


View Profile WWW
April 29, 2021, 10:54:12 AM
 #14

Code:
/mnt/e/p2p/BTC/AppData/testnet

Thanks for that, but it seems that something else goes wrong, because I still get the same error. I reads that I haven't set a DB_DIRECTORY while I do have on scripts\electrumx\daemontools\env.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8336


Fiatheist


View Profile WWW
April 29, 2021, 11:25:20 AM
 #15

Sorry, i made a mistake, it's been some time since i tried electrumx and not familiar with daemontools (usually i use systemd).
If you're using an implementation of the server that has a simpler tutorial, feel free to give me a link please! The problem with systemd is that I get this:
Code:
angelo@DESKTOP-5QOEJVC:~/electrumx$ systemctl start electrumx
System has not been booted with systemd as init system (PID 1). Can't operate.

sudo affect how you run Electrum with daemontools, not where environment file is locate
I meant that I'm running the commands from “angelo”, which is the main user probably.

How do run electrumx? Simply by typing electrumx_server? If yes, i think that's the problem since you're following guide to configure/run electrum with daemontools.
I don't understand. Should there be a command for daemontools that will start the electrumx server? The only thing that is mentioned about those tools is this:  https://github.com/spesmilo/electrumx/blob/master/docs/HOWTO.rst#using-daemontools

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
ABCbits
Legendary
*
Offline Offline

Activity: 3052
Merit: 8079


Crypto Swap Exchange


View Profile
April 29, 2021, 12:02:22 PM
Merited by BlackHatCoiner (1)
 #16

In the end, i decided to try setup electrumx from scratch and i think successfully setup it based on the log file.

Code:
Launching ElectrumX server...
INFO:electrumx:ElectrumX server starting
INFO:electrumx:logging level: INFO
INFO:Controller:Python version: 3.8.7 (default, Jan 31 2021, 21:48:01)  [GCC 10.2.1 20201224]
INFO:Controller:software version: ElectrumX 1.16.0
INFO:Controller:aiorpcX version: 0.18.7
INFO:Controller:supported protocol versions: 1.4-1.4.2
INFO:Controller:event loop policy: None
INFO:Controller:reorg limit is 8,000 blocks
INFO:Daemon:daemon #1 at localhost:18332/ (current)
INFO:DB:switching current directory to /home/user/Desktop/electrumx/DB
INFO:DB:using leveldb for DB backend
INFO:DB:created new database
INFO:DB:creating metadata directory
INFO:DB:UTXO DB version: 8
INFO:DB:coin: Bitcoin
INFO:DB:network: testnet
INFO:DB:height: -1
INFO:DB:tip: 0000000000000000000000000000000000000000000000000000000000000000
INFO:DB:tx count: 0
INFO:DB:flushing DB cache at 1,200 MB
INFO:DB:sync time so far: 00s
INFO:History:history DB version: 1
INFO:History:flush count: 0
INFO:Prefetcher:catching up to daemon height 1,973,091 (1,973,092 blocks behind)
INFO:Prefetcher:verified genesis block with hash 000000000933ea01ad0ee984209779baaec3ced90fa3f408719526f8d77f4943
INFO:BlockProcessor:our height: 9 daemon: 1,973,091 UTXOs 0MB hist 0MB
INFO:BlockProcessor:our height: 104,142 daemon: 1,973,091 UTXOs 58MB hist 111MB



This is how i do it. Hopefully i don't forget any step or copy wrong command

1. Install daemontools

Code:
sudo apt install daemontools

2. Move to proper path

Code:
cd ~/Desktop
git clone https://github.com/kyuupichan/electrumx.git
cd electrumx

3. Configure Python virtual environment (optional)

Code:
python3.8 -m venv .venv
source .venv/bin/activate
mkdir ./DB

4. Install electrumx (i think it's optional)

Code:
pip install .

5. Create directory service

Code:
mkdir ./service

6. Copy the daemontools script

Code:
mkdir -p ./scripts/electrumx
cp -R ./contrib/daemontools ./scripts/electrumx

7. Configure ENV. Make sure to read this guide https://electrumx.readthedocs.io/en/latest/environment.html#environment

Code:
cd ./scripts/electrumx/daemontools/env
nano DB_DIRECTORY

Here's value i used

Code:
FILENAME=VALUE

COIN=BITCOIN
DAEMON_URL=USERNAME:PASSWORD@LOCALHOST
DB_DIRECTORY=/home/user/Desktop/electrum/DB
NET=TESTNET
ELECTRUMX=/home/user/Desktop/electrumx/.venv/bin/electrumx_server
USERNAME=user

8. Configure log path. Change /path/to/log/dir to /home/user/Desktop/electrumx/scripts/electrumx/daemontools/log

Code:
cd /home/user/Desktop/electrumx/scripts/electrumx/daemontools
nano run

9.  Start svscan

Code:
cd /home/user/Desktop/electrumx
svscan ./service

If you can't have multiple terminal run this instead

Code:
cd /home/user/Desktop/electrumx
svscan ./service & disown

10. Add the service

Code:
cd /home/user/Desktop/electrumx/service
ln -s /home/user/Desktop/electrumx/scripts/electrumx/daemontools electrumx

11. To see output from Electrum

Code:
cd /home/user/Desktop/electrumx/scripts/electrumx/daemontools/log
tail current

P.S. It's very complicated compared with setup for systemd system or using docker (https://github.com/lukechilds/docker-electrumx).

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8336


Fiatheist


View Profile WWW
April 29, 2021, 12:28:25 PM
Last edit: April 30, 2021, 08:25:18 AM by BlackHatCoiner
 #17

Thank you for your time!

9.  Start svscan

If you can't have multiple terminal run this instead

Code:
cd /home/user/Desktop/electrumx
svscan ./service & disown

I have an issue with svscan Fixed. I'm now running electrum-personal-server.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BlackHatCoiner (OP)
Legendary
*
Offline Offline

Activity: 1694
Merit: 8336


Fiatheist


View Profile WWW
April 30, 2021, 08:42:37 AM
 #18

I didn't fix it. I don't know why it didn't work, but I was feeling a little alienated after all those tries. I then watched a video on YouTube which was much more simpler than with electrumx's tutorial. Thus, I discovered electrum personal server which seems a great implementation under some serious development.

So, I just switched to EPS. I didn't fix electrumx. I may formulated it wrongly, but "fixed" goes to my main purpose, which is running electrum without trusting anyone. I achieved it, thank you for your help.  Smiley

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4361

<insert witty quote here>


View Profile
April 30, 2021, 08:59:51 AM
 #19

oh man... if I had known you just wanted a little local Electrum server... I would have recommended electrs Tongue I thought you were trying to get your own public facing Electrum server up and running.  Roll Eyes

I have successfully had electrs running under WSL+Ubuntu (reading a Windows based Bitcoin data directory and connecting to it from Windows based Electrum)... it works a treat and has a relatively small footprint. It "syncs" relatively quickly if it's been offline for a few days, although the initial build+initial sync process can take a while.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
ABCbits
Legendary
*
Offline Offline

Activity: 3052
Merit: 8079


Crypto Swap Exchange


View Profile
April 30, 2021, 09:42:58 AM
Merited by DireWolfM14 (1)
 #20

So, I just switched to EPS. I didn't fix electrumx. I may formulated it wrongly, but "fixed" goes to my main purpose, which is running electrum without trusting anyone. I achieved it, thank you for your help.  Smiley

As long as you accomplish your goal Roll Eyes

But if you want to use electrumx to make Electrum server which is publicly accessible, you can consider,
1. Easy installer, https://github.com/bauerj/electrumx-installer. Although i don't know how well it works.
2. Docker, https://github.com/lukechilds/docker-electrumx
3. Setup with systemd, https://electrumx-spesmilo.readthedocs.io/en/latest/HOWTO.html#using-systemd

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!