12 changed files with 191 additions and 13 deletions
@ -0,0 +1,16 @@ |
|||
######################################### |
|||
# CONFIGURATION OF EXPLORER CONTAINER |
|||
######################################### |
|||
|
|||
|
|||
# Install and run a block explorer inside Dojo |
|||
# Value: on | off |
|||
EXPLORER_INSTALL=off |
|||
|
|||
|
|||
# Password required for accessing the block explorer |
|||
# (login can be anything) |
|||
# Keep this password secret! |
|||
# Provide a value with a high entropy! |
|||
# Type: alphanumeric |
|||
EXPLORER_KEY=myExplorerPassword |
@ -0,0 +1,33 @@ |
|||
FROM node:8.12.0-stretch |
|||
|
|||
ENV LOGS_DIR /data/logs |
|||
ENV APP_DIR /home/node/app |
|||
|
|||
ENV EXPLORER_URL https://github.com/janoside/btc-rpc-explorer/archive |
|||
ENV EXPLORER_VERSION 1.1.5 |
|||
|
|||
|
|||
# Create logs and apps directory |
|||
RUN mkdir -p "$LOGS_DIR" && \ |
|||
chown -R node:node "$LOGS_DIR" && \ |
|||
mkdir "$APP_DIR" |
|||
|
|||
# Download the source code and install it |
|||
RUN set -ex && \ |
|||
wget -qO explorer.tar.gz "$EXPLORER_URL/v$EXPLORER_VERSION.tar.gz" && \ |
|||
tar -xzvf explorer.tar.gz -C "$APP_DIR/" --strip-components 1 && \ |
|||
rm explorer.tar.gz && \ |
|||
cd "$APP_DIR" && \ |
|||
npm install --only=prod && \ |
|||
chown -R node:node "$APP_DIR" |
|||
|
|||
# Copy restart script |
|||
COPY ./restart.sh "$APP_DIR/restart.sh" |
|||
|
|||
RUN chown node:node "$APP_DIR/restart.sh" && \ |
|||
chmod u+x "$APP_DIR/restart.sh" && \ |
|||
chmod g+x "$APP_DIR/restart.sh" |
|||
|
|||
EXPOSE 3002 |
|||
|
|||
USER node |
@ -0,0 +1,21 @@ |
|||
#!/bin/bash |
|||
|
|||
cd /home/node/app |
|||
|
|||
explorer_options=( |
|||
--port 3002 |
|||
--host 172.28.1.7 |
|||
--basic-auth-password "$EXPLORER_KEY" |
|||
--coin BTC |
|||
--bitcoind-host "$BITCOIND_IP" |
|||
--bitcoind-port "$BITCOIND_RPC_PORT" |
|||
--bitcoind-user "$BITCOIND_RPC_USER" |
|||
--bitcoind-pass "$BITCOIND_RPC_PASSWORD" |
|||
--no-rates |
|||
--privacy-mode |
|||
) |
|||
|
|||
# Blacklist all functions provided by the RPC API |
|||
explorer_options+=(--rpc-blacklist "addnode,analyzepsbt,clearbanned,combinepsbt,combinerawtransaction,converttopsbt,createmultisig,createpsbt,createrawtransaction,decodepsbt,decoderawtransaction,decodescript,deriveaddresses,disconnectnode,echo,echojson,estimaterawfee,estimatesmartfee,finalizepsbt,generatetoaddress,generatetodescriptor,getaddednodeinfo,getbestblockhash,getblock,getblockchaininfo,getblockcount,getblockfilter,getblockhash,getblockheader,getblockstats,getblocktemplate,getchaintips,getchaintxstats,getconnectioncount,getdescriptorinfo,getdifficulty,getmemoryinfo,getmempoolancestors,getmempooldescendants,getmempoolentry,getmempoolinfo,getmininginfo,getnettotals,getnetworkhashps,getnetworkinfo,getnodeaddresses,getpeerinfo,getrawmempool,getrawtransaction,getrpcinfo,gettxout,gettxoutproof,gettxoutsetinfo,help,invalidateblock,joinpsbts,listbanned,logging,ping,preciousblock,prioritisetransaction,pruneblockchain,reconsiderblock,savemempool,scantxoutset,sendrawtransaction,setban,setmocktime,setnetworkactive,signmessagewithprivkey,signrawtransactionwithkey,stop,submitblock,submitheader,syncwithvalidationinterfacequeue,testmempoolaccept,uptime,utxoupdatepsbt,validateaddress,verifychain,verifymessage,verifytxoutproof,waitforblock,waitforblockheight,waitfornewblock") |
|||
|
|||
node ./bin/cli.js "${explorer_options[@]}" > /data/logs/explorer-error.log 2> /data/logs/explorer-output.log |
@ -1,18 +1,18 @@ |
|||
FROM nginx:1.15.10-alpine |
|||
FROM nginx:1.15.10-alpine |
|||
|
|||
# Create data directory |
|||
ENV LOGS_DIR /data/logs |
|||
ENV LOGS_DIR /data/logs |
|||
|
|||
RUN mkdir -p "$LOGS_DIR" && \ |
|||
chown -R nginx:nginx "$LOGS_DIR" |
|||
RUN mkdir -p "$LOGS_DIR" && \ |
|||
chown -R nginx:nginx "$LOGS_DIR" |
|||
|
|||
# Copy configuration files |
|||
COPY ./nginx.conf /etc/nginx/nginx.conf |
|||
|
|||
COPY ./dojo.conf /etc/nginx/sites-enabled/dojo.conf |
|||
COPY ./nginx.conf /etc/nginx/nginx.conf |
|||
COPY ./dojo.conf /etc/nginx/sites-enabled/dojo.conf |
|||
COPY ./dojo-explorer.conf /etc/nginx/sites-enabled/dojo-explorer.conf |
|||
|
|||
# Copy wait-for script |
|||
COPY ./wait-for /wait-for |
|||
COPY ./wait-for /wait-for |
|||
|
|||
RUN chmod u+x /wait-for && \ |
|||
chmod g+x /wait-for |
|||
RUN chmod u+x /wait-for && \ |
|||
chmod g+x /wait-for |
@ -0,0 +1,13 @@ |
|||
server { |
|||
listen 9080; |
|||
server_name _; |
|||
|
|||
location / { |
|||
proxy_pass http://explorer:3002; |
|||
proxy_http_version 1.1; |
|||
proxy_set_header Upgrade $http_upgrade; |
|||
proxy_set_header Connection 'upgrade'; |
|||
proxy_set_header Host $host; |
|||
proxy_cache_bypass $http_upgrade; |
|||
} |
|||
} |
@ -0,0 +1,28 @@ |
|||
version: "3.2" |
|||
|
|||
services: |
|||
explorer: |
|||
image: "samouraiwallet/dojo-explorer:${DOJO_EXPLORER_VERSION_TAG}" |
|||
container_name: explorer |
|||
build: |
|||
context: ./explorer |
|||
env_file: |
|||
- ./.env |
|||
- ./conf/docker-bitcoind.conf |
|||
- ./conf/docker-explorer.conf |
|||
restart: on-failure |
|||
command: "/home/node/app/restart.sh" |
|||
expose: |
|||
- "3002" |
|||
volumes: |
|||
- data-explorer:/data/logs |
|||
networks: |
|||
dojonet: |
|||
ipv4_address: 172.28.1.7 |
|||
|
|||
node: |
|||
depends_on: |
|||
- explorer |
|||
|
|||
volumes: |
|||
data-explorer: |
Loading…
Reference in new issue