Skip to content

Commit

Permalink
Merge pull request #5 from rizkiwicaksono/dockerize-electrumx
Browse files Browse the repository at this point in the history
docker for running zclassic node and electrumx server
  • Loading branch information
ch4ot1c authored Jan 30, 2018
2 parents 5508300 + 7a3bfc0 commit 85150b6
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 0 deletions.
33 changes: 33 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM python:3.6
# Prepare user
RUN useradd -ms /bin/bash zcluser
WORKDIR /home/zcluser

# Install zcl dependencies
RUN apt-get update
RUN apt-get install -y apt-utils
RUN apt-get install -y libleveldb1 libleveldb-dev
RUN apt-get install -y build-essential pkg-config libc6-dev m4 g++-multilib autoconf libtool ncurses-dev unzip git python zlib1g-dev wget bsdmainutils automake

# Build zcl node daemon
RUN git clone https://github.com/z-classic/zclassic
RUN mkdir /home/zcluser/zcl_electrum_db
RUN /home/zcluser/zclassic/zcutil/build.sh -j$(nproc)

# Install electrumx dependencies
RUN pip install pylru==1.0.9
RUN pip install aiohttp==1.0.5
RUN pip install x11_hash==1.4
RUN pip install plyvel==0.9

COPY run_electrumx_docker.sh /home/zcluser/run_electrumx_docker.sh
RUN chown -R zcluser:zcluser /home/zcluser/zcl_electrum_db /home/zcluser/run_electrumx_docker.sh
RUN chmod 755 /home/zcluser/run_electrumx_docker.sh

USER zcluser
RUN /home/zcluser/zclassic/zcutil/fetch-params.sh
RUN git clone https://github.com/BTCP-community/electrumx.git
RUN wget -q https://github.com/z-classic/zclassic/releases/download/Config/zclassic.conf
RUN sed -ie '/^rpcport=8232/a txindex=1' zclassic.conf

ENTRYPOINT ["/bin/sh", "-c", "/home/zcluser/run_electrumx_docker.sh"]
19 changes: 19 additions & 0 deletions run_electrumx_docker.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

# Make self-signed SSL cert and key
openssl genrsa -des3 -passout pass:x -out server.pass.key 2048
openssl rsa -passin pass:x -in server.pass.key -out server.key
openssl req -new -key server.key -out server.csr -subj "/C=NL/CN=electrumx.zclassic.org"
openssl x509 -req -days 1825 -in server.csr -signkey server.key -out server.crt
rm server.pass.key
rm server.csr

# Update RPC username and password
sed -ie s/rpcuser=change-this/rpcuser=${RPCUSER}/ zclassic.conf
sed -ie s/rpcpassword=change-this/rpcpassword=${RPCPASS}/ zclassic.conf

mkdir -p ~/.zclassic/
cp zclassic.conf ~/.zclassic/
/home/zcluser/zclassic/src/zcashd -daemon

COIN=Zclassic DB_DIRECTORY=/home/zcluser/zcl_electrum_db DAEMON_URL=http://${RPCUSER}:${RPCPASS}@127.0.0.1:8232 HOST=0.0.0.0 SSL_PORT=50002 PEER_DISCOVERY=Off SSL_CERTFILE=/home/zcluser/server.crt SSL_KEYFILE=/home/zcluser/server.key BANDWIDTH_LIMIT=10000000 /home/zcluser/electrumx/electrumx_server.py

0 comments on commit 85150b6

Please sign in to comment.