forked from kyuupichan/electrumx
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from rizkiwicaksono/dockerize-electrumx
docker for running zclassic node and electrumx server
- Loading branch information
Showing
2 changed files
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |