commit 3a335dbe30f525cb4921e2c251d9844e7cedf1c3 Author: Ian Munoz Date: Mon Jun 18 09:53:39 2018 -0400 initial commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..7427b81 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,47 @@ +FROM debian:latest + +RUN apt-get update + +RUN apt-get install -y curl +RUN apt-get install -y gnupg2 +RUN apt-get install -y wget +RUN apt-get install -y libzmq3-dev +RUN apt-get install -y git +RUN apt-get install -y build-essential + +RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - +RUN apt-get install -y nodejs + +RUN wget -qO - https://apt.z.cash/zcash.asc | apt-key add - +RUN echo "deb [arch=amd64] https://apt.z.cash/ jessie main" | tee /etc/apt/sources.list.d/zcash.list +RUN apt-get update && apt-get install -y zcash + +RUN useradd -m zcashd + +RUN mkdir -p /home/zcashd/.npm-global ; \ + mkdir -p /home/zcashd/.zcash/ ; \ + mkdir -p /home/zcashd/.zcash-params/ ; \ + chown -R zcashd /home/zcashd +ENV PATH=/home/zcashd/.npm-global/bin:$PATH +ENV NPM_CONFIG_PREFIX=/home/zcashd/.npm-global + +ENV x x +COPY --chown=zcashd:zcashd ./zcash.conf /home/zcashd/.zcash/zcash.conf + +USER zcashd + +RUN npm install -g npm@latest +RUN npm -g install zcash-hackworks/bitcore-node-zcash + +WORKDIR /home/zcashd/ +RUN bitcore-node create zc +COPY --chown=zcashd:zcashd ./bitcore-node.json /home/zcashd/zc/ + +WORKDIR /home/zcashd/zc/ +RUN bitcore-node install zcash-hackworks/insight-api-zcash zcash-hackworks/insight-ui-zcash + +RUN zcash-fetch-params --testnet + +RUN sed -i 's/testnet = false/testnet = true/g' /home/zcashd/zc/node_modules/insight-ui-zcash/public/src/js/app.js + +ENTRYPOINT ["/home/zcashd/zc/node_modules/bitcore-node-zcash/bin/bitcore-node", "start"] diff --git a/README.md b/README.md new file mode 100644 index 0000000..cbf88b6 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +This repo contains a Dockerfile to run and set up an insight explorer for the Zcash blockchain. diff --git a/bitcore-node.json b/bitcore-node.json new file mode 100644 index 0000000..5f203cd --- /dev/null +++ b/bitcore-node.json @@ -0,0 +1,23 @@ +{ + "network": "testnet", + "port": 3001, + "services": [ + "bitcoind", + "web" + ], + "servicesConfig": { + "bitcoind": { + "spawn": { + "datadir": "/home/zcashd/.zcash", + "exec": "/usr/bin/zcashd" + } + }, + "insight-api-zcash": { + "routePrefix": "api" + }, + "insight-ui-zcash": { + "apiPrefix": "api", + "routePrefix": "" + } + } +} diff --git a/bitcored.service b/bitcored.service new file mode 100644 index 0000000..4a5e910 --- /dev/null +++ b/bitcored.service @@ -0,0 +1,15 @@ +[Unit] +Description=Zcash Bitcore node +After=network.target + +[Service] +Type=simple +User=zcashd +WorkingDirectory=/home/zcashd/zc +ExecStart=/home/zcashd/zc/node_modules/bitcore-node-zcash/bin/bitcore-node start +ExecReload=/bin/kill -2 \$MAINPID +KillMode=process +Restart=on-failure + +[Install] +WantedBy=multi-user.target diff --git a/zcash.conf b/zcash.conf new file mode 100644 index 0000000..677d898 --- /dev/null +++ b/zcash.conf @@ -0,0 +1,15 @@ +testnet=1 +server=1 +whitelist=127.0.0.1 +zmqpubrawtx=tcp://127.0.0.1:9994 +zmqpubhashblock=tcp://127.0.0.1:9994 +addnode=testnet.z.cash +rpcallowip=127.0.0.1 +rpcuser=bitcoin +rpcpassword=local321 +showmetrics=0 +txindex=1 +addressindex=1 +timestampindex=1 +spentindex=1 +uacomment=bitcore