-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile.mainnet.dev
127 lines (101 loc) · 4.31 KB
/
Dockerfile.mainnet.dev
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
ARG build_image=golang:1.22.9-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.7
ARG kava_v0_18_0_upgrade_version=v0.18.2
ARG kava_v0_19_0_upgrade_version=v0.19.0
ARG kava_v0_21_0_upgrade_version=v0.21.0
ARG kava_v0_23_0_upgrade_version=v0.23.1
ARG kava_v0_24_0_upgrade_version=v0.24.0
ARG kava_v0_25_0_upgrade_version=v0.25.0
ARG kava_v0_26_0_upgrade_version=v0.26.0
ARG kava_v0_27_0_upgrade_version=v0.27.0
ENV KAVA_GENESIS_VERSION=$kava_genesis_version
ENV KAVA_V0_18_0_UPGRADE_VERSION=$kava_v0_18_0_upgrade_version
ENV KAVA_V0_19_0_UPGRADE_VERSION=$kava_v0_19_0_upgrade_version
ENV KAVA_V0_21_0_UPGRADE_VERSION=$kava_v0_21_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_18_0_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.18.0/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.18.0/bin
RUN cd kava \
&& git checkout $KAVA_V0_19_0_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.19.0/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.19.0/bin
RUN cd kava \
&& git checkout $KAVA_V0_21_0_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.21.0/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.21.0/bin
RUN cd kava \
&& git checkout $KAVA_V0_23_0_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.23.0/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.23.0/bin
RUN cd kava \
&& git checkout $KAVA_V0_24_0_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.24.0/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.24.0/bin
RUN cd kava \
&& git checkout $KAVA_V0_25_0_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.25.0/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.25.0/bin
RUN cd kava \
&& git checkout $KAVA_V0_26_0_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.26.0/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.26.0/bin
RUN cd kava \
&& git checkout $KAVA_V0_27_0_UPGRADE_VERSION \
&& make install \
&& mkdir -p /app/cosmovisor/upgrades/v0.27.0/bin \
&& mv /go/bin/kava /app/cosmovisor/upgrades/v0.27.0/bin
COPY . rosetta-kava
RUN cd rosetta-kava \
&& 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"]