-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.hardfork.parameterized
51 lines (46 loc) · 2.57 KB
/
Dockerfile.hardfork.parameterized
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
FROM ghcr.io/anoma/namada:v0.45.1 AS namada-0.45.1
FROM ghcr.io/anoma/namada:v0.46.0 AS namada-0.46.0
USER root
# Install both versions of Namada from before and after hard fork
COPY --from=namada-0.45.1 /usr/local/bin/namada /usr/local/bin/namada-0.45.1
COPY --from=namada-0.45.1 /usr/local/bin/namadac /usr/local/bin/namadac-0.45.1
COPY --from=namada-0.45.1 /usr/local/bin/namadan /usr/local/bin/namadan-0.45.1
COPY --from=namada-0.45.1 /usr/local/bin/namadaw /usr/local/bin/namadaw-0.45.1
RUN mv /usr/local/bin/namada /usr/local/bin/namada-0.46.0 \
&& mv /usr/local/bin/namadac /usr/local/bin/namadac-0.46.0 \
&& mv /usr/local/bin/namadan /usr/local/bin/namadan-0.46.0 \
&& mv /usr/local/bin/namadaw /usr/local/bin/namadaw-0.46.0
# Install system dependencies
RUN apt update \
&& apt install -y vim curl wget unzip procps simpleproxy jq less iputils-ping iproute2 tcpdump strace netcat-traditional
RUN cd /tmp \
&& wget https://github.com/denoland/deno/releases/download/v1.46.3/deno-x86_64-unknown-linux-gnu.zip \
&& unzip deno-x86_64-unknown-linux-gnu.zip \
&& mv deno /usr/local/bin \
&& rm deno-x86_64-unknown-linux-gnu.zip
# Configure node
USER namada
ENV NAMADA_NETWORK_CONFIGS_SERVER="https://testnet.namada-dryrun.tududes.com/configs"
ENV CHAIN_ID="namada-dryrun.abaaeaf7b78cb3ac"
ENV DATA_DIR="/home/namada/.local/share/namada/$CHAIN_ID"
ENV WASM_DIR="$DATA_DIR/wasm"
ENV CONFIG_DIR="$DATA_DIR/config.toml"
RUN namadac-0.45.1 utils join-network --chain-id $CHAIN_ID --wasm-dir $WASM_DIR
RUN sed -i.bak "s#^log_level *=.*#log_level = \"debug\"#" $CONFIG_DIR
RUN sed -i.bak "s#^laddr = \"tcp://127.0.0.1:26657\"#laddr = \"tcp://0.0.0.0:26657\"#" $CONFIG_DIR
RUN sed -i.bak "s#^persistent_peers_max_dial_period *=.*#persistent_peers_max_dial_period = \"5000ms\"#" $CONFIG_DIR
RUN sed -i.bak "s#^handshake_timeout *=.*#handshake_timeout = \"60000ms\"#" $CONFIG_DIR
RUN sed -i.bak "s#^dial_timeout *=.*#dial_timeout = \"10000ms\"#" $CONFIG_DIR
#RUN sed -ie "s#^seeds *=.*#seeds = \"tcp://836a25b5c465352adf17430135888689b9a0f1d6@namada-seed-housefire.mandragora.io:21656\"#" $CONFIG_DIR
#ADD addrbook.json $DATA_DIR/cometbft/config/addrbook.json
# Configure persistent peer set
ARG PEERS
ENV PEERS=${PEERS}
RUN echo "Configuring persistent_peers: $PEERS"
RUN sed -i.bak "s#^persistent_peers *=.*#persistent_peers = \"$PEERS\"#" $CONFIG_DIR
# Install control script
ADD deno.json deno.lock deps.js /
RUN deno cache --import-map=/deno.json --lock=/deno.lock deps.js
ADD lib.js services.js status.js rpc_proxy.js control_node.js sync_proxy.js peers.json /
ENTRYPOINT [ "/bin/bash" ]
CMD [ "-c", "/control_node.js" ]