-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: code cleanup Signed-off-by: Jingfu Wang <[email protected]> * chore: formatting Signed-off-by: Jingfu Wang <[email protected]> * refactor: remove rosetta validation related stuff Signed-off-by: Jingfu Wang <[email protected]> --------- Signed-off-by: Jingfu Wang <[email protected]>
- Loading branch information
1 parent
2b6abb0
commit 1e5131d
Showing
20 changed files
with
44 additions
and
971 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
#!/bin/bash | ||
|
||
# Download rosetta-cli | ||
./.github/scripts/cli.sh | ||
|
||
ROSETTA_CONFIGURATION_FILE=configs/optimism/goerli.json ./bin/rosetta-cli check:data configs/optimism/goerli.json | ||
# Run data tests | ||
# echo "starting data tests..." | ||
# ./bin/rosetta-cli check:data --configuration-file configs/config_goerli_eth.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,7 +2,6 @@ name: Rosetta Validation | |
|
||
# on: [push] | ||
|
||
|
||
env: | ||
go_version: 1.19 | ||
GO111MODULE: on | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,4 +15,4 @@ jobs: | |
with: | ||
go-version: ${{ env.go_version }} | ||
- name: run unit tests | ||
run: make unit-tests | ||
run: make test |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,136 +1,21 @@ | ||
############################################################## | ||
## Build golang | ||
############################################################## | ||
FROM ubuntu:20.04 as golang | ||
FROM golang:1.18 as rosetta-builder | ||
|
||
RUN mkdir -p /app && chown -R nobody:nogroup /app | ||
WORKDIR /app | ||
|
||
RUN apt-get update && apt-get install -y curl make gcc g++ git | ||
ENV GOLANG_VERSION 1.16.8 | ||
ENV GOLANG_DOWNLOAD_SHA256 f32501aeb8b7b723bc7215f6c373abb6981bbc7e1c7b44e9f07317e1a300dce2 | ||
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz | ||
ENV REPO=https://github.com/mdehoog/op-rosetta.git | ||
|
||
RUN curl -fsSL "$GOLANG_DOWNLOAD_URL" -o golang.tar.gz \ | ||
&& echo "$GOLANG_DOWNLOAD_SHA256 golang.tar.gz" | sha256sum -c - \ | ||
&& tar -C /usr/local -xzf golang.tar.gz \ | ||
&& rm golang.tar.gz | ||
RUN git clone $REPO src \ | ||
&& src \ | ||
&& make build | ||
|
||
ENV GOPATH /go | ||
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH | ||
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" | ||
|
||
############################################################## | ||
## Build geth | ||
############################################################## | ||
|
||
# TODO: | ||
|
||
############################################################## | ||
## Build op-rosetta | ||
############################################################## | ||
FROM golang as rosetta | ||
|
||
COPY . app | ||
RUN cd app && go build | ||
|
||
# TODO: Only copy necessary files split into various packages | ||
# # Copy necessary files | ||
# RUN mv src/* /app/op-rosetta \ | ||
# && mkdir /app/optimism \ | ||
# && mv utils/call_tracer.js /app/optimism/call_tracer.js \ | ||
# && mv geth.toml /app/optimism/geth.toml \ | ||
# && mv tokenList.json /app/tokenList.json \ | ||
# && rm -rf src | ||
|
||
## Build Final Image | ||
FROM ubuntu:20.04 | ||
RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificates | ||
|
||
# Construct owned directories | ||
RUN mkdir -p /app \ | ||
&& chown -R nobody:nogroup /app \ | ||
&& mkdir -p /data \ | ||
&& chown -R nobody:nogroup /data | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Copy app files from rosetta | ||
COPY --from=rosetta /app/* /app/* | ||
|
||
# TODO: Only copy necessary files | ||
# COPY --from=rosetta /app/rosetta-ethereum /app/rosetta-ethereum | ||
# COPY --from=rosetta /app/tokenList.json /app/tokenList.json | ||
|
||
# Set permissions for everything added to /app | ||
RUN chmod -R 755 /app/* | ||
|
||
# Run the op-rosetta binary | ||
CMD ["/app/op-rosetta", "run"] | ||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
# Compile geth | ||
FROM golang-builder as geth-builder | ||
|
||
# VERSION: go-ethereum v.1.10.16 | ||
RUN git clone https://github.com/ethereum/go-ethereum \ | ||
&& cd go-ethereum \ | ||
&& git checkout 20356e57b119b4e70ce47665a71964434e15200d | ||
|
||
RUN cd go-ethereum \ | ||
&& make geth | ||
|
||
RUN mv go-ethereum/build/bin/geth /app/geth \ | ||
&& rm -rf go-ethereum | ||
|
||
# Compile rosetta-ethereum | ||
FROM golang-builder as rosetta-builder | ||
|
||
# Copy binary from geth-builder | ||
COPY --from=geth-builder /app/geth /app/geth | ||
|
||
# Use native remote build context to build in any directory | ||
COPY . src | ||
|
||
RUN mv src/geth.toml /app/geth.toml \ | ||
&& mv src/entrypoint.sh /app/entrypoint.sh \ | ||
&& rm -rf src | ||
|
||
## Build Final Image | ||
FROM ubuntu:20.04 | ||
|
||
RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificates | ||
|
||
RUN mkdir -p /app \ | ||
&& chown -R nobody:nogroup /app \ | ||
&& mkdir -p /data \ | ||
&& chown -R nobody:nogroup /data | ||
|
||
WORKDIR /app | ||
|
||
# Copy binary from geth-builder | ||
COPY --from=geth-builder /app/geth /app/geth | ||
|
||
# Copy binary from rosetta-builder | ||
COPY --from=rosetta-builder /app /app | ||
|
||
# Set permissions for everything added to /app | ||
RUN chmod -R 755 /app/* | ||
|
||
EXPOSE 8545 8546 30303 30303/udp | ||
COPY --from=rosetta-builder /app/bin/op-rosetta /app/op-rosetta | ||
|
||
ENTRYPOINT ["/app/entrypoint.sh"] | ||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["/app/op-rosetta"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.