Skip to content

Instantly share code, notes, and snippets.

@Engelberg
Last active October 5, 2022 18:26
Show Gist options
  • Save Engelberg/aac9da2f27b723683982d187bd4d5ea4 to your computer and use it in GitHub Desktop.
Save Engelberg/aac9da2f27b723683982d187bd4d5ea4 to your computer and use it in GitHub Desktop.
Installing local electrum server that relies on the bitcoin daemon inside of Samourai Dojo for its data
I am successfully running a local electrum server, getting its data from dojo. This is useful for private use of hardware wallets.
Step 1: As Laurent MT suggested in the Samourai telegram group, you need to edit the docker-compose.yaml file, adding to the bitcoind section the following two lines
ports:
- "127.0.0.1:28256:28256"
Step 2: Follow install directions for electrs, an electrum server written in rust.
electrs install directions can be found here: https://github.com/romanz/electrs/blob/master/doc/usage.md
Step 3: Change directory so you are in the electrs directory. Then, run with the following flags:
cargo run --release -- -vvv --timestamp --db-dir ./db --electrum-rpc-addr="127.0.0.1:50001" --cookie="dojorpcuser:dojorpcpassword" --daemon-rpc-addr="127.0.0.1:28256" --jsonrpc-import
Use whatever rpc user and password you configured in your own config file when setting up dojo.
It took about 12 hours on my computer for electrum to build its index.
Also on that page are instructions on how to configure your electrum client to connect only to your sever. From the command line, you'll type:
$ electrum setconfig oneserver true
$ electrum setconfig server 127.0.0.1:50001:t
The "t" in the server configuration is important, specifying a protocol between client and server that is different from the default, and I don't see a way to do it through the client UI, only through command line.
On windows, I had difficulty accomplishing this from the command line, but you can do the same thing from the console window of the client:
setconfig("oneserver", True)
setconfig("server", "127.0.0.1:50001:t")
If you want to be able to access Electrum server from a client running on another computer in your local network, you can accomplish this by changing the runtime flag --electrum-rpc-addr to use your actual private ip address rather than 127.0.0.1.
Then, when configuring the server to use in the client, you refer to the private ip address of the computer running the server.
Your private ip address likely starts with 192 or 10, and you can find it on linux with the terminal command "ip address".
@Engelberg
Copy link
Author

About 48g

@rider0211
Copy link

please let me know how to install electrum wallet as a daemon on windows server. please help me!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment