-
Notifications
You must be signed in to change notification settings - Fork 406
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
YihaoPeng
committed
Nov 30, 2018
1 parent
3fa000b
commit ece4ee7
Showing
5 changed files
with
143 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,45 @@ | ||
# | ||
# Dockerfile | ||
# | ||
# @author zhibiao.pan@bitmain.com, yihao.peng@bitmain.com | ||
# @copyright btc.com | ||
# @since 2016-08-01 | ||
# | ||
# | ||
FROM phusion/baseimage:0.10.2 | ||
MAINTAINER YihaoPeng <yihao.peng@bitmain.com> | ||
|
||
ENV HOME /root | ||
ENV TERM xterm | ||
CMD ["/sbin/my_init"] | ||
|
||
# use aliyun source | ||
ADD sources-aliyun.com.list /etc/apt/sources.list | ||
|
||
RUN apt-get update | ||
RUN apt-get install -y build-essential libtool autotools-dev automake pkg-config libssl-dev libevent-dev bsdmainutils python3 | ||
RUN apt-get install -y libboost-all-dev libzmq3-dev curl wget net-tools | ||
|
||
# build litecoind | ||
RUN mkdir ~/source | ||
RUN cd ~/source && wget https://github.com/litecoin-project/litecoin/archive/v0.16.3.tar.gz | ||
RUN cd ~/source \ | ||
&& tar zxf v0.16.3.tar.gz && cd litecoin-0.16.3 \ | ||
&& ./autogen.sh \ | ||
&& ./configure --disable-wallet --disable-tests \ | ||
&& make -j4 && make install | ||
|
||
# mkdir litecoind data dir | ||
RUN mkdir -p /root/.litecoin | ||
RUN mkdir -p /root/scripts | ||
|
||
# logrotate | ||
ADD logrotate-litecoind /etc/logrotate.d/litecoind | ||
|
||
# | ||
# services | ||
# | ||
# service for mainnet | ||
RUN mkdir /etc/service/litecoind | ||
ADD run /etc/service/litecoind/run | ||
RUN chmod +x /etc/service/litecoind/run |
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,69 @@ | ||
Docker for Litecoind v0.16.3 | ||
============================ | ||
|
||
* Docker Image OS: `Ubuntu 16.04 LTS` | ||
* litecoind: `v0.16.3` | ||
|
||
## Install Docker | ||
|
||
``` | ||
# Use 'curl -sSL https://get.daocloud.io/docker | sh' instead of this line | ||
# when your server is in China. | ||
wget -qO- https://get.docker.com/ | sh | ||
service docker start | ||
service docker status | ||
``` | ||
|
||
## Build Docker Images | ||
|
||
``` | ||
cd /work | ||
git clone https://github.com/btccom/btcpool.git | ||
cd btcpool/docker/litecoind/v0.16.3 | ||
# If your server is in China, please check "Dockerfile" and uncomment some lines. | ||
# If you want to enable testnet3, please uncomment several lines behind `# service for testnet3` | ||
# build | ||
docker build -t litecoind:0.16.3 . | ||
# docker build --no-cache -t litecoind:0.16.3 . | ||
# mkdir for litecoind | ||
mkdir -p /work/litecoind | ||
# litecoin.conf | ||
touch /work/litecoind/litecoin.conf | ||
``` | ||
|
||
### litecoin.conf example | ||
|
||
``` | ||
rpcuser=litecoinrpc | ||
# generate random rpc password: | ||
# $ strings /dev/urandom | grep -o '[[:alnum:]]' | head -n 30 | tr -d '\n'; echo | ||
rpcpassword=xxxxxxxxxxxxxxxxxxxxxxxxxx | ||
rpcthreads=4 | ||
rpcallowip=172.16.0.0/12 | ||
rpcallowip=192.168.0.0/16 | ||
rpcallowip=10.0.0.0/8 | ||
# use 1G memory for utxo, depends on your machine's memory | ||
dbcache=1000 | ||
# set maximum BIP141 block weight | ||
blockmaxweight=4000000 | ||
``` | ||
|
||
## Start Docker Container | ||
|
||
``` | ||
# start docker | ||
docker run -it -v /work/litecoind:/root/.litecoin --name litecoind -p 9331-9333:9331-9333 --restart always -d litecoind:0.16.3 | ||
# login | ||
docker exec -it litecoind /bin/bash | ||
litecoin-cli getblockchaininfo | ||
``` |
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,6 @@ | ||
/root/.litecoin/debug.log /root/.litecoin/testnet3/debug.log { | ||
daily | ||
rotate 3 | ||
missingok | ||
copytruncate | ||
} |
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,13 @@ | ||
#! /bin/bash | ||
# | ||
# run shell for litecoind | ||
# | ||
# @copyright btc.com | ||
# @author zhibiao.pan@bitmain.com | ||
# | ||
export LC_ALL=C | ||
SROOT=$(cd $(dirname "$0"); pwd) | ||
cd $SROOT | ||
|
||
OPT_ZMQ="-zmqpubrawblock=tcp://0.0.0.0:9331 -zmqpubrawtx=tcp://0.0.0.0:9331 -zmqpubhashtx=tcp://0.0.0.0:9331 -zmqpubhashblock=tcp://0.0.0.0:9331" | ||
litecoind -conf="/root/.litecoin/litecoin.conf" -datadir="/root/.litecoin" $OPT_ZMQ |
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,10 @@ | ||
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse | ||
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse | ||
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse | ||
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse | ||
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse | ||
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse | ||
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse | ||
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse | ||
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse | ||
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse |