Skip to content

cjdelisle/pkt-docker-electrumx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

56 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pkt-electrumx

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.

Usage

  1. Install pktd

  2. Launch pktd with the following arguments:

pktd --addrindex --txindex --notls --rpclisten=172.17.0.1 -u x -P x
  1. Make a data directory
mkdir $HOME/electrumx_data
  1. Launch electrumx from docker:
docker run \
  -v $HOME/electrumx_data:/data \
  --ulimit nofile=262144:262144 \
  -e DAEMON_URL=http://x:x@172.17.0.1: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

Automatic discovery

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.

Testing

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.

TCP Port

By default only the SSL port is exposed. You can expose the unencrypted TCP port with -p 64766:64766, although this is strongly discouraged.

RPC Port

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.

License

MIT License

  • © Luke Childs
  • Caleb James DeLisle