-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile
More file actions
72 lines (66 loc) · 4.85 KB
/
Copy pathDockerfile
File metadata and controls
72 lines (66 loc) · 4.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
ARG TON_BRANCH=latest
FROM ghcr.io/ton-blockchain/ton:${TON_BRANCH} AS ton
ENV DEBIAN_FRONTEND=noninteractive
FROM ubuntu:24.04
ENV DEBIAN_FRONTEND=noninteractive
RUN set -eux; \
apt update; \
apt install -y --no-install-recommends \
ca-certificates curl gnupg lsb-release; \
mkdir -p /etc/apt/keyrings; \
curl -fsSL https://apt.llvm.org/llvm-snapshot.gpg.key \
| gpg --dearmor -o /etc/apt/keyrings/llvm.gpg; \
echo "deb [signed-by=/etc/apt/keyrings/llvm.gpg] http://apt.llvm.org/noble/ llvm-toolchain-noble-22 main" \
> /etc/apt/sources.list.d/llvm.list; \
apt update; \
apt-get install -y --no-install-recommends \
libc-bin clang-22 build-essential software-properties-common \
gperf make cmake libblas-dev wget gcc libgsl-dev \
python3-dev python3-pip sudo git fio iproute2 \
plzip pv aria2 ninja-build rocksdb-tools sysstat iotop \
autoconf automake libtool iputils-ping nload jq bc xxd htop \
libsecp256k1-dev libsodium-dev liblz4-dev libjemalloc2 libjemalloc-dev; \
ln -sf /usr/bin/clang-22 /usr/bin/clang; \
ln -sf /usr/bin/clang++-22 /usr/bin/clang++; \
curl https://sh.rustup.rs -sSf | sh -s -- -y --profile minimal; \
/root/.cargo/bin/rustup toolchain install stable; \
/root/.cargo/bin/rustup default stable; \
rm -rf /var/lib/apt/lists/*; \
mkdir -p \
/var/ton-work/db/static \
/var/ton-work/db/import \
/var/ton-work/db/keyring \
/usr/local/bin/mytonctrl \
/usr/src/ton \
/usr/src/mytonctrl \
/usr/src/ton-teleport-btc-periphery; \
cd /usr/src/ton; \
git init; \
git remote add origin https://github.com/ton-blockchain/ton.git; \
cd /usr/src/mytonctrl; \
git init; \
git remote add origin https://github.com/ton-blockchain/mytonctrl.git; \
cd /usr/src/ton-teleport-btc-periphery; \
git init; \
git remote add origin https://github.com/RSquad/ton-teleport-btc-periphery.git; \
wget -nv https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py \
-O /usr/bin/systemctl; \
chmod +x /usr/bin/systemctl; \
useradd -ms /bin/bash validator
COPY --from=ton /usr/local/bin/validator-engine /usr/bin/ton/validator-engine/
COPY --from=ton /usr/local/bin/validator-engine-console /usr/bin/ton/validator-engine-console/
COPY --from=ton /usr/local/bin/lite-client /usr/bin/ton/lite-client/
COPY --from=ton /usr/local/bin/generate-random-id /usr/bin/ton/utils/
COPY --from=ton /usr/local/bin/fift /usr/bin/ton/crypto/
COPY --from=ton /usr/local/bin/func /usr/bin/ton/crypto/
VOLUME ["/var/ton-work", "/usr/local/bin/mytoncore", "/usr/local/bin/mytonctrl", "/usr/src/ton"]
COPY --chmod=755 scripts/entrypoint.sh/ /scripts/entrypoint.sh
RUN echo 'alias getstats="/usr/bin/ton/validator-engine-console/validator-engine-console -k /var/ton-work/keys/client -p /var/ton-work/keys/server.pub -a $(hostname -I | tr -d " "):$(jq .control[].port <<< cat /var/ton-work/db/config.json) -c getstats"' >> ~/.bashrc
RUN echo 'alias last="/usr/bin/ton/lite-client/lite-client -p /var/ton-work/keys/liteserver.pub -a $(hostname -I | tr -d " "):$(jq .liteservers[].port <<< cat /var/ton-work/db/config.json) -t 3 -c last"' >> ~/.bashrc
RUN echo 'alias sync="/usr/bin/ton/lite-client/lite-client -p /var/ton-work/keys/liteserver.pub -a $(hostname -I | tr -d " "):$(jq .liteservers[].port <<< cat /var/ton-work/db/config.json) -t 3 -c last 2>&1 | sed -nE \"s/.*\\(([0-9]+) second(s)? ago\\).*/\\1/p\" | tail -n1"' >> ~/.bashrc
RUN echo 'alias config32="/usr/bin/ton/lite-client/lite-client -p /var/ton-work/keys/liteserver.pub -a $(hostname -I | tr -d " "):$(jq .liteservers[].port <<< cat /var/ton-work/db/config.json) -t 3 -c \"getconfig 32\""' >> ~/.bashrc
RUN echo 'alias config34="/usr/bin/ton/lite-client/lite-client -p /var/ton-work/keys/liteserver.pub -a $(hostname -I | tr -d " "):$(jq .liteservers[].port <<< cat /var/ton-work/db/config.json) -t 3 -c \"getconfig 34\""' >> ~/.bashrc
RUN echo 'alias config36="/usr/bin/ton/lite-client/lite-client -p /var/ton-work/keys/liteserver.pub -a $(hostname -I | tr -d " "):$(jq .liteservers[].port <<< cat /var/ton-work/db/config.json) -t 3 -c \"getconfig 36\""' >> ~/.bashrc
RUN echo 'alias elid="/usr/bin/ton/lite-client/lite-client -p /var/ton-work/keys/liteserver.pub -a $(hostname -I | tr -d " "):$(jq .liteservers[].port <<< cat /var/ton-work/db/config.json) -t 3 -c \"runmethod -1:3333333333333333333333333333333333333333333333333333333333333333 active_election_id\""' >> ~/.bashrc
RUN echo 'alias participants="/usr/bin/ton/lite-client/lite-client -p /var/ton-work/keys/liteserver.pub -a $(hostname -I | tr -d " "):$(jq .liteservers[].port <<< cat /var/ton-work/db/config.json) -t 3 -c \"runmethod -1:3333333333333333333333333333333333333333333333333333333333333333 participant_list\""' >> ~/.bashrc
ENTRYPOINT ["/scripts/entrypoint.sh"]