put blockchain cache in image
This commit is contained in:
parent
be3618ce2a
commit
7eb49c0fef
@ -1,5 +1,7 @@
|
|||||||
FROM phusion/baseimage:0.9.19
|
FROM phusion/baseimage:0.9.19
|
||||||
|
|
||||||
|
ARG STEEMD_BLOCKCHAIN=https://cdn.datavibe.net/f/eeqj/20160906.steemd-blockchain.tbz2
|
||||||
|
|
||||||
# steem:master as of 2016-08-18
|
# steem:master as of 2016-08-18
|
||||||
ARG STEEMD_REPO=https://github.com/steemit/steem.git
|
ARG STEEMD_REPO=https://github.com/steemit/steem.git
|
||||||
ARG STEEMD_REV=master
|
ARG STEEMD_REV=master
|
||||||
@ -35,6 +37,7 @@ RUN \
|
|||||||
libssl-dev \
|
libssl-dev \
|
||||||
libtool \
|
libtool \
|
||||||
ncurses-dev \
|
ncurses-dev \
|
||||||
|
pbzip2 \
|
||||||
python3 \
|
python3 \
|
||||||
python3-dev \
|
python3-dev \
|
||||||
&& \
|
&& \
|
||||||
@ -117,9 +120,14 @@ RUN \
|
|||||||
/var/lib/apt/lists/* \
|
/var/lib/apt/lists/* \
|
||||||
/tmp/* \
|
/tmp/* \
|
||||||
/var/tmp/* \
|
/var/tmp/* \
|
||||||
|
/var/cache/* \
|
||||||
/usr/include \
|
/usr/include \
|
||||||
/usr/local/include
|
/usr/local/include
|
||||||
|
|
||||||
|
# add blockchain cache to image
|
||||||
|
ADD $STEEMD_BLOCKCHAIN /var/cache/steemd/blocks.tbz2
|
||||||
|
|
||||||
|
RUN chmod a+rx /var/cache/steemd /var/cache/steemd/*
|
||||||
|
|
||||||
ENV HOME /var/lib/steemd
|
ENV HOME /var/lib/steemd
|
||||||
RUN useradd -s /bin/bash -m -d /var/lib/steemd steemd
|
RUN useradd -s /bin/bash -m -d /var/lib/steemd steemd
|
||||||
|
17
steemd.run
17
steemd.run
@ -46,15 +46,24 @@ if [[ ! -z "$STEEMD_PRIVATE_KEY" ]]; then
|
|||||||
ARGS+=" --private-key=$STEEMD_PRIVATE_KEY"
|
ARGS+=" --private-key=$STEEMD_PRIVATE_KEY"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# without --data-dir it uses cwd as datadir(!)
|
|
||||||
# who knows what else it dumps into current dir
|
|
||||||
cd $HOME
|
|
||||||
|
|
||||||
# overwrite local config with image one
|
# overwrite local config with image one
|
||||||
cp /etc/steemd/config.ini $HOME/config.ini
|
cp /etc/steemd/config.ini $HOME/config.ini
|
||||||
|
|
||||||
chown steemd:steemd $HOME/config.ini
|
chown steemd:steemd $HOME/config.ini
|
||||||
|
|
||||||
|
if [[ ! -d $HOME/blockchain ]]; then
|
||||||
|
# init with blockchain cached in image
|
||||||
|
ARGS+=" --replay-blockchain"
|
||||||
|
mkdir -p $HOME/blockchain/database
|
||||||
|
cd $HOME/blockchain/database
|
||||||
|
tar xvjpf /var/cache/steemd/blocks.tbz2
|
||||||
|
chown -R steemd:steemd $HOME/blockchain
|
||||||
|
fi
|
||||||
|
|
||||||
|
# without --data-dir it uses cwd as datadir(!)
|
||||||
|
# who knows what else it dumps into current dir
|
||||||
|
cd $HOME
|
||||||
|
|
||||||
# slow down restart loop if flapping
|
# slow down restart loop if flapping
|
||||||
sleep 1
|
sleep 1
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user