-
Notifications
You must be signed in to change notification settings - Fork 38
/
Copy pathDockerfile
39 lines (30 loc) · 1.39 KB
/
Dockerfile
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
FROM ubuntu:24.04
ARG USERNAME=hluser
ARG USER_UID=10000
ARG USER_GID=$USER_UID
# Define URLs as environment variables
ARG PUB_KEY_URL=https://raw.githubusercontent.com/hyperliquid-dex/node/refs/heads/main/pub_key.asc
ARG HL_VISOR_URL=https://binaries.hyperliquid-testnet.xyz/Testnet/hl-visor
ARG HL_VISOR_ASC_URL=https://binaries.hyperliquid-testnet.xyz/Testnet/hl-visor.asc
# Create user and install dependencies
RUN groupadd --gid $USER_GID $USERNAME \
&& useradd --uid $USER_UID --gid $USER_GID -m $USERNAME \
&& apt-get update -y && apt-get install -y curl gnupg \
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
&& mkdir -p /home/$USERNAME/hl/data && chown -R $USERNAME:$USERNAME /home/$USERNAME/hl
USER $USERNAME
WORKDIR /home/$USERNAME
# Configure chain to testnet
RUN echo '{"chain": "Testnet"}' > /home/$USERNAME/visor.json
# Import GPG public key
RUN curl -o /home/$USERNAME/pub_key.asc $PUB_KEY_URL \
&& gpg --import /home/$USERNAME/pub_key.asc
# Download and verify hl-visor binary
RUN curl -o /home/$USERNAME/hl-visor $HL_VISOR_URL \
&& curl -o /home/$USERNAME/hl-visor.asc $HL_VISOR_ASC_URL \
&& gpg --verify /home/$USERNAME/hl-visor.asc /home/$USERNAME/hl-visor \
&& chmod +x /home/$USERNAME/hl-visor
# Expose gossip ports
EXPOSE 4000-4010
# Run a non-validating node
ENTRYPOINT ["/home/hluser/hl-visor", "run-non-validator", "--replica-cmds-style", "recent-actions"]