-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: update configurations for core
- Loading branch information
1 parent
3867c85
commit f25f973
Showing
40 changed files
with
1,534 additions
and
116,633 deletions.
There are no files selected for viewing
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 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 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 |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# Copyright 2020 Coinbase, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
# Compile golang --platform=linux/amd64 --platform=linux/x86_64 | ||
FROM ubuntu:20.04 as golang-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.19.8 | ||
ENV GOLANG_DOWNLOAD_SHA256 e1a0bf0ab18c8218805a1003fd702a41e2e807710b770e787e5979d1cf947aba | ||
ENV GOLANG_DOWNLOAD_URL https://golang.org/dl/go$GOLANG_VERSION.linux-amd64.tar.gz | ||
|
||
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 | ||
|
||
ENV GOPATH /go | ||
ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH | ||
RUN mkdir -p "$GOPATH/src" "$GOPATH/bin" && chmod -R 777 "$GOPATH" | ||
|
||
# Compile geth | ||
FROM golang-builder as geth-builder | ||
|
||
# VERSION: core-chain v1.0.6 | ||
ARG core_chain_version | ||
RUN git clone https://github.com/coredao-org/core-chain.git \ | ||
&& cd core-chain \ | ||
&& git checkout v1.0.6 | ||
|
||
RUN cd core-chain \ | ||
&& make geth | ||
|
||
RUN mv core-chain/build/bin/geth /app/geth \ | ||
&& rm -rf core-chain | ||
|
||
# Compile rosetta-core | ||
FROM golang-builder as rosetta-builder | ||
|
||
# Use native remote build context to build in any directory | ||
COPY . src | ||
RUN cd src \ | ||
&& go build -o rosetta-core | ||
|
||
RUN mv src/rosetta-core /app/rosetta-core \ | ||
&& mkdir /app/ethereum \ | ||
&& mv src/ethereum/call_tracer.js /app/ethereum/call_tracer.js \ | ||
&& mv src/ethereum/geth.toml.testnet /app/ethereum/geth.toml \ | ||
&& 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/ethereum /app/ethereum | ||
COPY --from=rosetta-builder /app/rosetta-core /app/rosetta-core | ||
|
||
# Set permissions for everything added to /app | ||
RUN chmod -R 755 /app/* | ||
|
||
CMD ["/app/rosetta-core", "run"] |
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 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 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 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.