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

Add docker compose for one step setup with testnet #1000

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

oneforalone
Copy link

It's not easy to setup using rpcauth to connect to bitcoin core, so i just make it much easier for testnet setup. Hope that helps those who want to deploy an testnet with electrs quickly, just one command (docker compose up -d)

@romanz romanz self-requested a review January 31, 2024 16:32
README.md Outdated
@@ -28,25 +27,26 @@ If you can't use our guide, please ask about what you don't understand or consid
Note that this implementation of Electrum server is optimized for **personal/small-scale (family/friends) usage**.
It's a bad idea to run it publicly as it'd expose you to DoS and maybe also other attacks.
If you want to run a public server you may be interested in the [Blockstream fork of electrs](https://github.com/Blockstream/electrs)
which is better optimized for public usage at the cost of consuming *significantly* more resources.
which is better optimized for public usage at the cost of consuming _significantly_ more resources.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are those changes required?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, no, that's just my editor's auto-format plugin changed it while save the file. I'll remove this change, soon.

-zmqpubrawtx=tcp://0.0.0.0:28335 -zmqpubhashblock=tcp://0.0.0.0:28336
-txindex=1 -rpcbind=0.0.0.0 -rpcallowip=0.0.0.0/0
-rpcport=18332 -rest -listen=1 -listenonion=0
-rpcauth=alice:128f22494cc2208ea8376a3d0b45a131$9cc0187c0e49f35454a3ed1250e40ecaef420cfcd294d3ac22496adbe64f04b9
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible to not use a constant rpcauth?

Copy link
Author

@oneforalone oneforalone Mar 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm using this constant rpcauth just for easy use. Others may delete it and generate their own rpcauth via rpcauth.py, put it to ./bitcoind/bitcoin.conf and change the line auth = "alice:alice" in conf.toml to their own config.
Also, if you want to using cookie file to auth, there's a way to do it:

  1. you can remove the rpcauth config
  2. append one line in docker-compose.yml in [electrs] > volumes section: - ./cookie:/electrs/.cookie
  3. adjust the conf.toml file, i.e. comment out the rpcauth line, un-comment cookie_file and set it's value to /electrs/.cookie
  4. start with docker compose up -d, this command will only start bitcoind, but not electrs
  5. copy the bitcoind's cookie file's content to ./cookie file: cat ./bitcoind/testnet3/.cookie > cookie
  6. rebuild electrs with docker compose up -d --build --no-deps electrs

But i thought it's kind complicate, most people just want one-click to use it.

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

Successfully merging this pull request may close these issues.

3 participants