-
Notifications
You must be signed in to change notification settings - Fork 7
/
Dockerfile.testnet
178 lines (146 loc) · 6.67 KB
/
Dockerfile.testnet
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
ARG build_image=golang:1.22.8-bullseye
FROM $build_image AS kava-rosetta-build
RUN apt-get update \
&& apt-get install -y git make gcc \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /app
WORKDIR /app
ARG cosmovisor_version=v1.1.0
ENV COSMOVISOR_VERSION=$cosmovisor_version
RUN git clone https://github.com/cosmos/cosmos-sdk \
&& cd cosmos-sdk \
&& git checkout cosmovisor/$COSMOVISOR_VERSION \
&& make cosmovisor \
&& mv /app/cosmos-sdk/cosmovisor/cosmovisor /go/bin
ARG kava_genesis_version=v0.17.5
ARG kava_v0_19_0_upgrade_version=v0.19.0-testnet
ARG kava_v0_19_1_upgrade_version=v0.19.1-testnet
ARG kava_v0_19_2_upgrade_version=v0.19.2-testnet
ARG kava_v0_19_3_upgrade_version=v0.19.3-testnet
ARG kava_v0_19_4_upgrade_version=v0.19.4-testnet
ARG kava_v0_19_5_upgrade_version=v0.19.5-testnet
ARG kava_v0_20_0_upgrade_version=v0.20.0-alpha.0
ARG kava_v0_21_0_upgrade_version=v0.21.0-alpha.1
ARG kava_v0_22_0_upgrade_version=v0.22.0-alpha.1
ARG kava_v0_23_0_upgrade_version=v0.23.0-alpha.0
ARG kava_v0_24_0_upgrade_version=v0.24.0-alpha.0
ARG kava_v0_25_0_upgrade_version=v0.25.0-alpha.0
ARG kava_v0_26_0_upgrade_version=v0.26.0-alpha.0
ARG kava_v0_27_0_upgrade_version=v0.27.0-alpha.0
ENV KAVA_GENESIS_VERSION=$kava_genesis_version
ENV KAVA_V0_19_0_UPGRADE_VERSION=$kava_v0_19_0_upgrade_version
ENV KAVA_V0_19_1_UPGRADE_VERSION=$kava_v0_19_1_upgrade_version
ENV KAVA_V0_19_2_UPGRADE_VERSION=$kava_v0_19_2_upgrade_version
ENV KAVA_V0_19_3_UPGRADE_VERSION=$kava_v0_19_3_upgrade_version
ENV KAVA_V0_19_4_UPGRADE_VERSION=$kava_v0_19_4_upgrade_version
ENV KAVA_V0_19_5_UPGRADE_VERSION=$kava_v0_19_5_upgrade_version
ENV KAVA_V0_20_0_UPGRADE_VERSION=$kava_v0_20_0_upgrade_version
ENV KAVA_V0_21_0_UPGRADE_VERSION=$kava_v0_21_0_upgrade_version
ENV KAVA_V0_22_0_UPGRADE_VERSION=$kava_v0_22_0_upgrade_version
ENV KAVA_V0_23_0_UPGRADE_VERSION=$kava_v0_23_0_upgrade_version
ENV KAVA_V0_24_0_UPGRADE_VERSION=$kava_v0_24_0_upgrade_version
ENV KAVA_V0_25_0_UPGRADE_VERSION=$kava_v0_25_0_upgrade_version
ENV KAVA_V0_26_0_UPGRADE_VERSION=$kava_v0_26_0_upgrade_version
ENV KAVA_V0_27_0_UPGRADE_VERSION=$kava_v0_27_0_upgrade_version
RUN git clone https://github.com/kava-labs/kava \
&& cd kava \
&& git checkout $KAVA_GENESIS_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/genesis/bin \
&& mv /go/bin/kava /app/cosmovisor/genesis/bin
RUN cd kava \
&& git checkout $KAVA_V0_19_0_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.19.0-testnet/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.19.0-testnet/bin
RUN cd kava \
&& git checkout $KAVA_V0_19_1_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.19.1-testnet/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.19.1-testnet/bin
RUN cd kava \
&& git checkout $KAVA_V0_19_2_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.19.2-testnet/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.19.2-testnet/bin
RUN cd kava \
&& git checkout $KAVA_V0_19_3_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.19.3-testnet/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.19.3-testnet/bin
RUN cd kava \
&& git checkout $KAVA_V0_19_4_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.19.4-testnet/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.19.4-testnet/bin
RUN cd kava \
&& git checkout $KAVA_V0_19_5_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.19.5-testnet/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.19.5-testnet/bin
RUN cd kava \
&& git checkout $KAVA_V0_20_0_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.20.0-alpha.0/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.20.0-alpha.0/bin
RUN cd kava \
&& git checkout $KAVA_V0_21_0_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.21.0-alpha.0/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.21.0-alpha.0/bin
RUN cd kava \
&& git checkout $KAVA_V0_22_0_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.22.0-alpha.0/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.22.0-alpha.0/bin
RUN cd kava \
&& git checkout $KAVA_V0_23_0_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.23.0-alpha.0/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.23.0-alpha.0/bin
RUN cd kava \
&& git checkout $KAVA_V0_24_0_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.24.0-alpha.0/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.24.0-alpha.0/bin
RUN cd kava \
&& git checkout $KAVA_V0_25_0_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.25.0-alpha.0/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.25.0-alpha.0/bin
RUN cd kava \
&& git checkout $KAVA_V0_26_0_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.26.0-alpha.0/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.26.0-alpha.0/bin
RUN cd kava \
&& git checkout $KAVA_V0_27_0_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.27.0-alpha.0/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.27.0-alpha.0/bin
ARG kava_rosetta_version=v9.0.0-beta.1
ENV KAVA_ROSETTA_VERSION=$kava_rosetta_version
RUN git clone https://github.com/Kava-Labs/rosetta-kava.git \
&& cd rosetta-kava \
&& git checkout $KAVA_ROSETTA_VERSION \
&& make install
FROM ubuntu:22.04
RUN apt-get update \
&& apt-get install -y supervisor curl \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /app \
&& mkdir /app/bin
WORKDIR /app
ENV PATH=$PATH:/app/bin
# copy build binaries from build environment
COPY --from=kava-rosetta-build /app/cosmovisor /app/cosmovisor
COPY --from=kava-rosetta-build /go/bin/cosmovisor /app/bin/cosmovisor
COPY --from=kava-rosetta-build /go/bin/rosetta-kava /app/bin/rosetta-kava
# copy config templates to automate setup
COPY --from=kava-rosetta-build /app/rosetta-kava/examples /app/templates
# copy scripts to run services
COPY --from=kava-rosetta-build /app/rosetta-kava/conf/start-services.sh /app/bin/start-services.sh
COPY --from=kava-rosetta-build /app/rosetta-kava/conf/kill-supervisord.sh /app/bin/kill-supervisord.sh
COPY --from=kava-rosetta-build /app/rosetta-kava/conf/supervisord.conf /etc/supervisor/conf.d/rosetta-kava.conf
ENV KAVA_RPC_URL=http://localhost:26657
CMD ["/app/bin/start-services.sh"]