checkpoint

This commit is contained in:
Jeffrey Paul 2016-08-18 13:50:02 +02:00
parent 2c9c10924f
commit 5387c3bfae
4 changed files with 86 additions and 27 deletions

View File

@ -1,62 +1,91 @@
FROM phusion/baseimage:0.9.19 FROM phusion/baseimage:0.9.19
ENV STEEMD_REV master
# steem:master as of 2016-08-18
ARG STEEMD_REPO=https://github.com/steemit/steem.git
ARG STEEMD_REV=045c2a340d254d11dfcd22e1253646132465f9b7
# secp256k1:master as of 2016-08-18
ARG SECP256K1_REPO=https://github.com/bitcoin/secp256k1
ARG SECP256K1_REV=7a49cacd3937311fcb1cb36b6ba3336fca811991
ARG UBUNTU_MIRROR=mirror://mirrors.ubuntu.com/mirrors.txt ARG UBUNTU_MIRROR=mirror://mirrors.ubuntu.com/mirrors.txt
ARG STEEMD_REPO=https://github.com/steemit/steem.git
RUN sed -i \ RUN sed -i \
-e s#http://archive.ubuntu.com/ubuntu/#${UBUNTU_MIRROR}#g \ -e s#http://archive.ubuntu.com/ubuntu/#${UBUNTU_MIRROR}#g \
-e s#http://security.ubuntu.com/ubuntu/#${UBUNTU_MIRROR}#g \ -e s#http://security.ubuntu.com/ubuntu/#${UBUNTU_MIRROR}#g \
/etc/apt/sources.list ; \ /etc/apt/sources.list ; \
grep -v deb-src /etc/apt/sources.list > \
/etc/apt/sources.list.new && \
mv /etc/apt/sources.list.new /etc/apt/sources.list && \
cat /etc/apt/sources.list cat /etc/apt/sources.list
RUN \ RUN \
apt-get update && \ apt-get update && \
apt-get install -y \ apt-get install -y \
autoconf \
automake \ automake \
autotools-dev \ autotools-dev \
bsdmainutils \ bsdmainutils \
build-essential \ build-essential \
cmake \ cmake \
doxygen \
git \ git \
libboost-chrono-dev \ libboost-all-dev \
libboost-filesystem-dev \ libreadline-dev \
libboost-program-options-dev \
libboost-system-dev \
libboost-test-dev \
libboost-thread-dev \
libevent-dev \
libminiupnpc-dev \
libssl-dev \ libssl-dev \
libtool \ libtool \
libzmq3-dev \ ncurses-dev \
libzmq5 \ python3 \
pkg-config \ python3-dev \
&& \ && \
apt-get clean && \ apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN \ RUN \
git clone $STEEMD_REPO /usr/local/src/steem && \ git clone \
cd /usr/local/src/steem && \ $SECP256K1_REPO \
git checkout $STEEMD_REV && \ /usr/local/src/secp256k1 && \
cd /usr/local/src/secp256k1 && \
git checkout $SECP256K1_REV && \
./autogen.sh && \ ./autogen.sh && \
./configure --enable-hardening && \ ./configure && \
make -j2 && \ make -j8 && \
./tests && \
make install && \ make install && \
cd / && \ cd / && \
rm -rfv /usr/local/src/secp256k1
RUN \
git clone \
$STEEMD_REPO \
/usr/local/src/steem && \
cd /usr/local/src/steem && \
git checkout $STEEMD_REV && \
git submodule update --init --recursive && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-DLOW_MEMORY_NODE=ON \
. \
&& \
make -j8 && \
make install && \
rm -rf /usr/local/src/steem rm -rf /usr/local/src/steem
# FIXME run steemd tests as part of build
RUN \ RUN \
apt-get remove -y \ apt-get remove -y \
automake \ automake \
autotools-dev \ autotools-dev \
bsdmainutils \ bsdmainutils \
build-essential \ build-essential \
doxygen \
git \ git \
libssl-dev \
libtool \ libtool \
pkg-config \ pkg-config \
python3-dev \
&& \ && \
apt-get autoremove -y && \ apt-get autoremove -y && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@ -74,7 +103,6 @@ EXPOSE 8333
RUN mkdir -p /etc/service/steemd RUN mkdir -p /etc/service/steemd
ADD steemd.run /etc/service/steemd/run ADD steemd.run /etc/service/steemd/run
RUN mkdir -p /etc/service/steemd/log
ADD steemd.log.run /etc/service/steemd/log/run ADD steemd.log.run /etc/service/steemd/log/run
RUN chmod +x /etc/service/steemd/log/run \ RUN chmod +x /etc/service/steemd/log/run \

View File

@ -1,7 +1,15 @@
BUILD_ARGS := --build-arg UBUNTU_MIRROR="mirror://mirrors.ubuntu.com/mirrors.txt"
ifdef UBUNTU_MIRROR
BUILD_ARGS := --build-arg UBUNTU_MIRROR="$(UBUNTU_MIRROR)"
endif
default: build default: build
build: kill build: kill
docker build -t sneak/steemd . docker build \
-t sneak/steemd \
$(BUILD_ARGS) \
.
run: kill run: kill
docker run --name sneak-steemd -d sneak/steemd docker run --name sneak-steemd -d sneak/steemd

View File

@ -1,2 +1,2 @@
#!/bin/sh #!/bin/sh
exec chpst -usyslog logger -t steemd exec chpst -udaemon svlogd -tt /var/log/steemd

View File

@ -1,14 +1,37 @@
#!/bin/bash #!/bin/bash
export HOME="/var/lib/steem" set -x
export HOME="/var/lib/steemd"
# gen random pw for rpc server
RANDOMPW=$(dd if=/dev/urandom bs=10 count=1 status=none | RANDOMPW=$(dd if=/dev/urandom bs=10 count=1 status=none |
shasum | cut -b 1-20) shasum | cut -b 1-20)
chown -R steem:steem $HOME chown -R steemd:steemd $HOME
exec chpst -usteem \ SEED_NODES="
steemd $ARGS \ 52.38.66.234:2001
52.37.169.52:2001
52.26.78.244:2001
192.99.4.226:2001
46.252.27.1:1337
81.89.101.133:2001
52.4.250.181:39705
steemd.pharesim.me:2001
seed.steemed.net:2001
steem.clawmap.com:2001
seed.steemwitness.com:2001
steem-seed1.abit-more.com:2001
"
ARGS=""
for NODE in $SEED_NODES ; do
ARGS+=" --seed-node=$NODE"
done
cd $HOME
chpst -usteemd \
steemd \
--rpc-endpoint=0.0.0.0:8090 \
$ARGS \
$STEEMD_EXTRA_OPTS \ $STEEMD_EXTRA_OPTS \
2>&1 2>&1 | logger -t steemd