-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
122 additions
and
52 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,23 @@ | ||
# Generated by Cargo, executables | ||
target | ||
|
||
# GitHub workflows/actions | ||
.github | ||
|
||
# Folder containing files for bundler spec tests | ||
bundler-spec-tests | ||
|
||
# Documentation | ||
docs | ||
|
||
# Dockerfile | ||
Dockerfile | ||
# Scripts | ||
scripts | ||
|
||
# Folder containing files for bundler spec tests | ||
bundler-spec-tests | ||
# Generated by Cargo, executables | ||
target | ||
|
||
# Third party dependencies | ||
crates/contracts/thirdparty/account-abstraction/* | ||
tests/thirdparty/bundler/* | ||
# Other files | ||
.gitignore | ||
CODEOWNERS | ||
CONTRIBUTING.md | ||
docker-compose.yml | ||
Dockerfile | ||
rustfmt.toml | ||
tomlfmt.toml |
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,14 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eo pipefail | ||
|
||
# install geth | ||
|
||
GETH_VERSION="1.12.0-e501b3b0" | ||
|
||
wget -c "https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-$GETH_VERSION.tar.gz" | ||
tar -xf "geth-linux-amd64-$GETH_VERSION.tar.gz" | ||
mv geth-linux-amd64-$GETH_VERSION/geth /usr/local/bin/ | ||
chmod a+x /usr/local/bin/geth | ||
|
||
geth version |
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,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -eo pipefail | ||
|
||
# install solc | ||
|
||
SOLC_VERSION="v0.8.20" | ||
|
||
wget -c "https://github.com/ethereum/solidity/releases/download/$SOLC_VERSION/solc-static-linux" | ||
mv solc-static-linux /usr/local/bin/solc | ||
chmod a+x /usr/local/bin/solc | ||
|
||
solc --version |
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 |
---|---|---|
@@ -1,40 +1,55 @@ | ||
# build | ||
FROM ubuntu:18.04 AS builder | ||
FROM lukemathwalker/cargo-chef:latest-rust-1 AS chef | ||
WORKDIR /app | ||
|
||
RUN apt-get update && apt-get -y upgrade && apt-get install -y build-essential software-properties-common ca-certificates curl gnupg git clang pkg-config libclang-dev libssl-dev | ||
RUN add-apt-repository ppa:ethereum/ethereum && apt-get update && apt-get install -y solc | ||
LABEL org.opencontainers.image.source=https://github.com/silius-rs/silius | ||
LABEL org.opencontainers.image.licenses="MIT OR Apache-2.0" | ||
|
||
# build cargo-chef plan | ||
FROM chef AS planner | ||
COPY . . | ||
RUN cargo chef prepare --recipe-path recipe.json | ||
|
||
FROM chef AS builder | ||
COPY --from=planner /app/recipe.json recipe.json | ||
|
||
RUN mkdir -p /etc/apt/keyrings | ||
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg | ||
RUN echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_16.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list | ||
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - | ||
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list | ||
# Set the build profile to be release | ||
ARG BUILD_PROFILE=release | ||
ENV BUILD_PROFILE $BUILD_PROFILE | ||
|
||
RUN apt-get update && apt-get install -y nodejs yarn | ||
# Install system dependencies | ||
RUN apt-get update && apt-get -y upgrade && apt-get install -y pkg-config libclang-dev libssl-dev | ||
|
||
WORKDIR /rust | ||
# Install solc | ||
RUN wget -c "https://github.com/ethereum/solidity/releases/download/v0.8.20/solc-static-linux" | ||
RUN mv solc-static-linux /usr/local/bin/solc | ||
RUN chmod a+x /usr/local/bin/solc | ||
|
||
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y | ||
ENV PATH="/root/.cargo/bin:$PATH" | ||
# Builds dependencies | ||
RUN cargo chef cook --profile $BUILD_PROFILE --recipe-path recipe.json | ||
|
||
WORKDIR /silius | ||
# Build application | ||
COPY . . | ||
RUN cargo build --profile $BUILD_PROFILE --locked | ||
|
||
RUN make fetch-thirdparty | ||
RUN make setup-thirdparty | ||
RUN make build | ||
# Copy application | ||
RUN cp /app/target/$BUILD_PROFILE/silius /app/silius | ||
|
||
# run | ||
FROM frolvlad/alpine-glibc:alpine-3.17 | ||
# Use alpine as a runtime image | ||
FROM frolvlad/alpine-glibc:alpine-3.17 AS runtime | ||
|
||
# Create data folder | ||
RUN mkdir -p /data/silius | ||
|
||
# Install system dependencies | ||
RUN apk add openssl1.1-compat | ||
|
||
COPY --from=builder /silius/target/release/silius /usr/local/bin/silius | ||
# Copy silus binary | ||
COPY --from=builder /app/silius /usr/local/bin/silius | ||
|
||
# Copy licenses | ||
COPY LICENSE-* ./ | ||
|
||
# Expose ports | ||
EXPOSE 3000 3001 | ||
|
||
ENTRYPOINT ["/usr/local/bin/silius"] | ||
|
||
LABEL org.opencontainers.image.source=https://github.com/silius-rs/silius |