Run a PKT Electrumx server with one command
An easily configurable Docker image for running an Electrumx server on the PKT network.
Check it out on dockerhub at cjd1/pkt-electrumx.
-
Install pktd
-
Launch pktd with the following arguments:
pktd --addrindex --txindex --notls --rpclisten=172.17.0.1 -u x -P x
- Make a data directory
mkdir $HOME/electrumx_data
- Launch electrumx from docker:
docker run \
-v $HOME/electrumx_data:/data \
--ulimit nofile=262144:262144 \
-e DAEMON_URL=http://x:[email protected]:64765 \
-e BANDWIDTH_UNIT_COST=9999999999 \
-e COST_SOFT_LIMIT=50001 \
-e COST_HARD_LIMIT=50000 \
-e INITIAL_CONCURRENT=10000000 \
-e REQUEST_SLEEP=20 \
-p 64767:64767 \
-e REPORT_SERVICES="ssl://yourdomain.example.com:64767" \
cjd1/pkt-electrumx
If there's an SSL certificate/key (electrumx.crt
/electrumx.key
) in the /electrumx_data
volume it'll be used. If not, one will be generated for you.
You can view all ElectrumX environment variables here: https://github.com/spesmilo/electrumx/blob/master/docs/environment.rst
For hardcoded nodes to share your ElectrumX instance to Electrum clients, it is necessary to set the REPORT_SERVICES env variable with
the domain used to expose your node.
After your electrumx server has fully imported the blockchain, it will begin serving information to electrum instances. Once it is serving, you can perform a basic check that it is in fact accessible by using openssl:
openssl s_client -connect host.name.of.your.server:64767
If it is working correctly, you should see some information about the certificate and SSL session and finally a hung terminal, press the enter key once and you should see this message:
{"jsonrpc": "2.0", "error": {"code": -32700, "message": "invalid JSON"}, "id": null}
As a reminder, this test will not work until after electrumx has fully imported the blockchain.
By default only the SSL port is exposed. You can expose the unencrypted TCP port with -p 64766:64766
, although this is strongly discouraged.
To access RPC from your host machine, you'll also need to expose port 8252. You probably only want this available to localhost: -p 127.0.0.1:8252:8252
.
If you're only accessing RPC from within the container, there's no need to expose the RPC port.
MIT License
- © Luke Childs
- Caleb James DeLisle