Skip to content

Commit 6b09b51

Browse files
authored
Merge pull request ethereum#69 from gnosischain/fix/reth-gnosis-client
fix: reth gnosis client docker files
2 parents 2e0f516 + ee95b0c commit 6b09b51

File tree

8 files changed

+58
-53
lines changed

8 files changed

+58
-53
lines changed

clients/go-ethereum-gnosis/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ COPY --from=builder /usr/local/bin/geth /usr/local/bin/geth
1414
# Generate the version.txt file.
1515
RUN /usr/local/bin/geth console --exec 'console.log(admin.nodeInfo.name)' --maxpeers=0 --nodiscover --dev 2>/dev/null | head -1 > /version.txt
1616

17+
# Add the default genesis file and genesis mapper script.
18+
ADD genesis.json /genesis.json
19+
ADD mapper.jq /mapper.jq
20+
1721
# Inject the startup script.
1822
ADD geth.sh /geth.sh
19-
ADD mapper.jq /mapper.jq
2023
RUN chmod +x /geth.sh
2124

2225
# Inject the enode id retriever script.
2326
RUN mkdir /hive-bin
2427
ADD enode.sh /hive-bin/enode.sh
2528
RUN chmod +x /hive-bin/enode.sh
2629

27-
# Add a default genesis file.
28-
ADD genesis.json /genesis.json
29-
3030
# Export the usual networking ports to allow outside access to the node
3131
EXPOSE 8545 8546 8547 8551 30303 30303/udp
3232

clients/go-ethereum-gnosis/Dockerfile.git

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
FROM golang:1.23-alpine AS builder
44
ARG github=gnosischain/go-ethereum
5-
ARG tag=latest
5+
ARG tag=master
66

77
# Install dependencies
88
RUN \
@@ -24,19 +24,19 @@ COPY --from=builder /usr/local/bin/geth /usr/local/bin/geth
2424
# Generate the version.txt file.
2525
RUN /usr/local/bin/geth console --exec 'console.log(admin.nodeInfo.name)' --maxpeers=0 --nodiscover --dev 2>/dev/null | head -1 > /version.txt
2626

27+
# Add the default genesis file and genesis mapper script.
28+
ADD genesis.json /genesis.json
29+
ADD mapper.jq /mapper.jq
30+
2731
# Inject the startup script.
2832
ADD geth.sh /geth.sh
29-
ADD mapper.jq /mapper.jq
3033
RUN chmod +x /geth.sh
3134

3235
# Inject the enode id retriever script.
3336
RUN mkdir /hive-bin
3437
ADD enode.sh /hive-bin/enode.sh
3538
RUN chmod +x /hive-bin/enode.sh
3639

37-
# Add a default genesis file.
38-
ADD genesis.json /genesis.json
39-
4040
# Export the usual networking ports to allow outside access to the node
4141
EXPOSE 8545 8546 8547 8551 30303 30303/udp
4242

clients/go-ethereum-gnosis/Dockerfile.local

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
FROM golang:1-alpine AS builder
44

5-
# Default local client path: clients/go-ethereum-gnosis/<go-ethereum-gnosis>
6-
ARG local_path=go-ethereum-gnosis
7-
COPY $local_path go-ethereum-gnosis
5+
# Default local client path: clients/go-ethereum-gnosis/<go-ethereum>
6+
ARG local_path=go-ethereum
7+
COPY $local_path /go-ethereum
8+
WORKDIR /go-ethereum
89

9-
WORKDIR /go-ethereum-gnosis
1010
RUN apk add --update bash curl jq git make gcc libc-dev linux-headers
1111
RUN make geth
1212
RUN mv ./build/bin/geth /usr/local/bin/geth
@@ -18,19 +18,19 @@ COPY --from=builder /usr/local/bin/geth /usr/local/bin/geth
1818
# Generate the version.txt file.
1919
RUN /usr/local/bin/geth console --exec 'console.log(admin.nodeInfo.name)' --maxpeers=0 --nodiscover --dev 2>/dev/null | head -1 > /version.txt
2020

21+
# Add the default genesis file and genesis mapper script.
22+
ADD genesis.json /genesis.json
23+
ADD mapper.jq /mapper.jq
24+
2125
# Inject the startup script.
2226
ADD geth.sh /geth.sh
23-
ADD mapper.jq /mapper.jq
2427
RUN chmod +x /geth.sh
2528

2629
# Inject the enode id retriever script.
2730
RUN mkdir /hive-bin
2831
ADD enode.sh /hive-bin/enode.sh
2932
RUN chmod +x /hive-bin/enode.sh
3033

31-
# Add a default genesis file.
32-
ADD genesis.json /genesis.json
33-
3434
# Export the usual networking ports to allow outside access to the node
3535
EXPOSE 8545 8546 8547 8551 30303 30303/udp
3636

clients/nethermind-gnosis/Dockerfile.local

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ RUN chmod +x /nethermind.sh /hive-bin/enode.sh
3636
# Expose networking ports
3737
EXPOSE 8545 30303 30303/udp
3838

39-
ENV NETHERMIND_HIVE_ENABLED true
39+
ENV NETHERMIND_HIVE_ENABLED=true
4040
ENTRYPOINT ["/nethermind.sh"]

clients/reth-gnosis/Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
11
ARG baseimage=ghcr.io/gnosischain/reth_gnosis
2-
ARG tag=master
2+
ARG tag=latest
33

4-
FROM $baseimage:$tag as builder
4+
# Build the reth-gnosis binary
5+
FROM $baseimage:$tag AS builder
56
ARG GOPROXY
6-
77
ENV GOPROXY=${GOPROXY}
88

99
# Install script tools.
1010
RUN apt-get update -y
1111
RUN apt-get install -y bash curl jq
1212

13-
# Add genesis mapper script.
14-
ADD genesis.json /genesis.json
15-
ADD mapper.jq /mapper.jq
13+
# Add default genesis file and genesis mapper script.
14+
COPY genesis.json /genesis.json
15+
COPY mapper.jq /mapper.jq
1616

1717
# Add the startup script.
18-
ADD reth.sh /reth.sh
18+
COPY reth.sh /reth.sh
1919
RUN chmod +x /reth.sh
2020

2121
# Add the enode URL retriever script.
22-
ADD enode.sh /hive-bin/enode.sh
22+
RUN mkdir /hive-bin
23+
COPY enode.sh /hive-bin/enode.sh
2324
RUN chmod +x /hive-bin/enode.sh
2425

2526
# Create version.txt

clients/reth-gnosis/Dockerfile.git

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
2-
### Build Reth From Git:
3-
## Pulls reth from a git repository and builds it from source.
1+
# Pulls reth gnosis from a git repository and builds it from source.
42

53
## Builder stage: Compiles reth from a git repository
6-
FROM rust:latest as builder
7-
8-
ARG github=paradigmxyz/reth
9-
ARG tag=main
4+
FROM rust:latest AS builder
5+
ARG github=gnosischain/reth_gnosis
6+
ARG tag=master
107

118
RUN apt-get update && apt-get install -y libclang-dev pkg-config build-essential \
129
&& echo "Cloning: $github - $tag" \
13-
&& git clone --depth 1 --branch $tag https://github.com/$github reth \
14-
&& cd reth && cargo build --release \
10+
&& git clone --depth 1 --branch $tag https://github.com/$github reth_gnosis \
11+
&& cd reth_gnosis && cargo build --release \
1512
&& cp target/release/reth /usr/local/bin/reth
1613

1714
## Final stage: Sets up the environment for running reth
@@ -22,17 +19,21 @@ RUN apt-get update && apt-get install -y bash curl jq \
2219
# Copy compiled binary from builder
2320
COPY --from=builder /usr/local/bin/reth /usr/local/bin/reth
2421

25-
# Add genesis mapper script, startup script, and enode URL retriever script
22+
# Add default genesis file and genesis mapper script.
2623
COPY genesis.json /genesis.json
2724
COPY mapper.jq /mapper.jq
25+
26+
# Inject the startup script.
2827
COPY reth.sh /reth.sh
29-
COPY enode.sh /hive-bin/enode.sh
28+
RUN chmod +x /reth.sh
3029

31-
# Set execute permissions for scripts
32-
RUN chmod +x /reth.sh /hive-bin/enode.sh
30+
# Inject the enode id retriever script.
31+
RUN mkdir /hive-bin
32+
COPY enode.sh /hive-bin/enode.sh
33+
RUN chmod +x /hive-bin/enode.sh
3334

3435
# Create version.txt
35-
RUN /usr/local/bin/reth --version | head -1 > /version.txt
36+
RUN /usr/local/bin/reth --version | sed -e 's/reth \(.*\)/\1/' > /version.txt
3637

3738
# Export the usual networking ports
3839
EXPOSE 8545 8546 30303 30303/udp

clients/reth-gnosis/Dockerfile.local

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
### Build Reth Locally:
2-
## Requires a copy of <reth>/ -> hive/clients/reth/<reth>
1+
## Build reth gnosis from source from a local directory.
32

43
## Builder stage: Compiles reth from a git repository
5-
FROM rust:latest as builder
4+
FROM rust:latest AS builder
65

7-
# Default local client path: clients/reth/<reth>
8-
ARG local_path=reth
9-
COPY $local_path reth
6+
# Default local client path: clients/reth-gnosis/<reth_gnosis>
7+
ARG local_path=reth_gnosis
8+
COPY $local_path /reth_gnosis
109

1110
RUN apt-get update && apt-get install -y libclang-dev pkg-config build-essential \
12-
&& cd reth && cargo build --release \
11+
&& cd /reth_gnosis && cargo build --release \
1312
&& cp target/release/reth /usr/local/bin/reth
1413

1514
## Final stage: Sets up the environment for running reth
@@ -20,17 +19,21 @@ RUN apt-get update && apt-get install -y bash curl jq \
2019
# Copy compiled binary from builder
2120
COPY --from=builder /usr/local/bin/reth /usr/local/bin/reth
2221

23-
# Add genesis mapper script, startup script, and enode URL retriever script
22+
# Add default genesis file and genesis mapper script
2423
COPY genesis.json /genesis.json
2524
COPY mapper.jq /mapper.jq
25+
26+
# Inject the startup script.
2627
COPY reth.sh /reth.sh
27-
COPY enode.sh /hive-bin/enode.sh
28+
RUN chmod +x /reth.sh
2829

29-
# Set execute permissions for scripts
30-
RUN chmod +x /reth.sh /hive-bin/enode.sh
30+
# Inject the enode id retriever script.
31+
RUN mkdir /hive-bin
32+
COPY enode.sh /hive-bin/enode.sh
33+
RUN chmod +x /hive-bin/enode.sh
3134

3235
# Create version.txt
33-
RUN /usr/local/bin/reth --version | head -1 > /version.txt
36+
RUN /usr/local/bin/reth --version | sed -e 's/reth \(.*\)/\1/' > /version.txt
3437

3538
# Export the usual networking ports
3639
EXPOSE 8545 8546 30303 30303/udp

hive.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Otherwise, it looks for files in the $HOME directory:
8686
"a single client type may be requested with different branches.\n"+
8787
"Example: \"besu_latest,besu_20.10.2\"\n")
8888

89-
clientTimeout = flag.Duration("client.checktimelimit", 3*time.Minute, "The `timeout` of waiting for clients to open up the RPC port.\n"+
89+
clientTimeout = flag.Duration("client.checktimelimit", 10*time.Minute, "The `timeout` of waiting for clients to open up the RPC port.\n"+
9090
"If a very long chain is imported, this timeout may need to be quite large.\n"+
9191
"A lower value means that hive won't wait as long in case the node crashes and\n"+
9292
"never opens the RPC port.")

0 commit comments

Comments
 (0)