-
Notifications
You must be signed in to change notification settings - Fork 48
/
Dockerfile-node
42 lines (32 loc) · 1.33 KB
/
Dockerfile-node
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
FROM --platform=linux/amd64 ubuntu:24.04
# Install dependencies
RUN apt-get update && \
apt-get install -y \
git \
sudo \
wget \
jq \
make \
gcc \
unzip && \
rm -rf /var/lib/apt/lists/*
# Install Go
RUN wget https://golang.org/dl/go1.22.5.linux-amd64.tar.gz && \
tar -C /usr/local -xzf go1.22.5.linux-amd64.tar.gz && \
rm go1.22.5.linux-amd64.tar.gz
# Set Go environment variables
ENV GOPATH=/root/go
ENV PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
# Create Go workspace directory
RUN mkdir -p /root/go
WORKDIR /root
# https://docs.0g.ai/0g-doc/run-a-node/validator-node
RUN git clone -b v0.2.3 https://github.com/0glabs/0g-chain.git
RUN ./0g-chain/networks/testnet/install.sh
RUN 0gchaind config chain-id zgtendermint_16600-2
RUN 0gchaind init testnetnode --chain-id zgtendermint_16600-2
RUN rm ~/.0gchain/config/genesis.json
RUN wget -P ~/.0gchain/config https://github.com/0glabs/0g-chain/releases/download/v0.2.3/genesis.json
RUN 0gchaind validate-genesis
RUN sed -i 's|seeds = ""|seeds = "[email protected]:26656,[email protected]:26656,[email protected]:26656,[email protected]:26656"|' $HOME/.0gchain/config/config.toml
ENTRYPOINT ["0gchaind", "start"]