Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions clients/go-ethereum/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,32 @@ FROM ethereum/client-go:$branch as builder

## ----

## ----
## Uncomment the steps below (and comment out the steps above!) to build
## go-ethereum from a git branch.

# FROM alpine:latest as builder
# ARG user=ethereum
# ARG repo=go-ethereum
# ARG branch=master
# RUN \
# apk add --update bash curl jq go git make gcc musl-dev \
# ca-certificates linux-headers && \
# git clone --depth 1 --branch $branch \
# https://github.com/$user/$repo && \
# (cd go-ethereum && make geth) && \
# (cd go-ethereum && \
# echo "{}" \
# | jq ".+ {\"repo\":\"$(git config --get remote.origin.url)\"}" \
# | jq ".+ {\"branch\":\"$(git rev-parse --abbrev-ref HEAD)\"}" \
# | jq ".+ {\"commit\":\"$(git rev-parse HEAD)\"}" \
# > /version.json) && \
# cp go-ethereum/build/bin/geth /usr/local/bin/geth && \
# apk del go git make gcc musl-dev linux-headers && \
# rm -rf /go-ethereum && rm -rf /var/cache/apk/*

## ----
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wondering why you are adding these lines, since we already have the equivalent steps just above?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one makes it just a tiny bit easier to build from a git branch, instead of having to manually clone inside the folder, and having to checkout to switch branches to compile from a different source.

I've been going to the commit where this was removed and copying this excerpt to do my local testing, I just find it easier to test locally with this code.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

since we already have the equivalent steps just above?

Yeah, no the steps above execute within the ethereum/client-go container as a builder, and is not suitable if you want to clone some non-official repository. LGTM


FROM alpine:latest
RUN apk add --update bash curl jq
COPY --from=builder /usr/local/bin/geth /usr/local/bin/geth
Expand Down
1 change: 1 addition & 0 deletions clients/go-ethereum/mapper.jq
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def to_bool:
"mergeForkBlock": env.HIVE_MERGE_BLOCK_ID|to_int,
"terminalTotalDifficulty": env.HIVE_TERMINAL_TOTAL_DIFFICULTY|to_int,
"shanghaiTime": env.HIVE_SHANGHAI_TIMESTAMP|to_int,
"cancunTime": env.HIVE_CANCUN_TIMESTAMP|to_int,
"terminalTotalDifficultyPassed": true,
}|remove_empty
}