Bitcoin Asked by Taghi on October 24, 2021
I am trying to run an ElectrumX server on my PC. I run it on a docker container with the following Dockerfile configuration:
FROM python:3.7-alpine3.11
LABEL maintainer="Luke Childs <[email protected]>"
COPY ./bin /usr/local/bin
COPY ./VERSION /tmp
RUN VERSION=$(cat /tmp/VERSION) &&
chmod a+x /usr/local/bin/* &&
apk add --no-cache git build-base openssl &&
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.11/main leveldb-dev &&
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing rocksdb-dev &&
pip install aiohttp pylru plyvel websockets python-rocksdb &&
git clone -b $VERSION https://github.com/kyuupichan/electrumx.git &&
cd electrumx &&
python setup.py install &&
apk del git build-base &&
rm -rf /tmp/*
VOLUME ["/data"]
ENV HOME /data
ENV ALLOW_ROOT 1
ENV DB_DIRECTORY /data
ENV SERVICES=tcp://:50001,ssl://:50002,wss://:50004,rpc://0.0.0.0:8000
ENV SSL_CERTFILE ${DB_DIRECTORY}/electrumx.crt
ENV SSL_KEYFILE ${DB_DIRECTORY}/electrumx.key
ENV HOST ""
WORKDIR /data
EXPOSE 50001 50002 50004 8000
CMD ["init"]
I want to advertise the ElectrumX server as a Tor hidden server. My bitcoin-core is also reachable by an .onion address: j3zla562edof65jn.onion. How can I configure the ElectrumX hidden server? What will be the .onion address of the server? I cannot access the ElectrumX from my electrum client using j3zla562edof65jn.onion address. Also, the status of the server is Closed in the Servers list.
Many Thanks.
I found the answer. It was not too hard. You should make a separate Tor hidden service for the ElectrumX server. The following two links helped me:
To create a hidden service, you should take the following steps:
torcc
file (probably you can find it at /etc/tor/torrc
). Add these lines to the file:HiddenServiceDir /var/lib/tor/electrumX_service/
HiddenServiceVersion 2
HiddenServicePort 50001 127.0.0.1:50001
HiddenServicePort 50002 127.0.0.1:50002
sudo service tor restart
sudo cat /var/lib/tor/electrumX_service/hostname
. you will see the hostname. For example, my hostname is dpojvtzgm5dcg5ds.onion
.docker run --name=electrumx --rm --network=host -v /home/taghi/Taghi/docker-electrumx/electrumx:/data
-e DAEMON_URL=http://MY_BITCOIN_CORE_USERNAME:[email protected]:8332
-e COIN=BitcoinSegwit
-e REPORT_SERVICES=tcp://dpojvtzgm5dcg5ds.onion:50001,ssl://dpojvtzgm5dcg5ds.onion:50002
lukechilds/electrumx
Remember: I have exposed 50001, 50002, 50004, and 8000 ports in the above Dockerfile.
Answered by Taghi on October 24, 2021
Get help from others!
Recent Answers
Recent Questions
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP