-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat : added dockerisation and eth changes
- Loading branch information
ocdbytes
committed
Apr 22, 2024
1 parent
3a50b82
commit b3ac61b
Showing
19 changed files
with
8,986 additions
and
7,494 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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
starkgate-contracts | ||
starkgate-contracts-2-0-1 | ||
target | ||
.github |
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,3 +1,4 @@ | ||
/target | ||
.idea | ||
.env | ||
.env | ||
addresses.json |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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,65 @@ | ||
# ============================================== | ||
# Karnot Bridge Deploy | ||
# ============================================== | ||
FROM rustlang/rust:nightly-slim as builder | ||
LABEL authors="karnot.xyz" | ||
|
||
# Arguments : | ||
ARG APP_CHAIN_ID | ||
ARG ETH_CHAIN_ID | ||
ARG ETH_PRIV_KEY | ||
ARG ETH_RPC | ||
ARG FEE_TOKEN_ADDRESS | ||
ARG L1_DEPLOYER_ADDRESS | ||
ARG L1_WAIT_TIME | ||
ARG L2_DEPLOYER_ADDRESS | ||
ARG ROLLUP_PRIV_KEY | ||
ARG ROLLUP_SEQ_URL | ||
ARG SN_OS_CONFIG_HASH_VERSION | ||
ARG SN_OS_PROGRAM_HASH | ||
ARG CROSS_CHAIN_WAIT_TIME | ||
|
||
# Assigning the env vars | ||
ENV APP_CHAIN_ID=${APP_CHAIN_ID} \ | ||
ETH_CHAIN_ID=${ETH_CHAIN_ID} \ | ||
ETH_PRIV_KEY=${ETH_PRIV_KEY} \ | ||
ETH_RPC=${ETH_RPC} \ | ||
FEE_TOKEN_ADDRESS=${FEE_TOKEN_ADDRESS} \ | ||
L1_DEPLOYER_ADDRESS=${L1_DEPLOYER_ADDRESS} \ | ||
L1_WAIT_TIME=${L1_WAIT_TIME} \ | ||
L2_DEPLOYER_ADDRESS=${L2_DEPLOYER_ADDRESS} \ | ||
ROLLUP_PRIV_KEY=${ROLLUP_PRIV_KEY} \ | ||
SN_OS_CONFIG_HASH_VERSION=${SN_OS_CONFIG_HASH_VERSION} \ | ||
SN_OS_PROGRAM_HASH=${SN_OS_PROGRAM_HASH} \ | ||
CROSS_CHAIN_WAIT_TIME=${CROSS_CHAIN_WAIT_TIME} | ||
|
||
# adding musl (build failing fix) | ||
ENV RUST_TARGET=x86_64-unknown-linux-musl | ||
ENV PKG_CONFIG_ALLOW_CROSS=1 | ||
RUN apt-get update && apt-get install -y musl-tools | ||
RUN rustup target add x86_64-unknown-linux-musl | ||
|
||
RUN USER=root cargo new --bin karnot-bridge-deploy && chmod -R 777 /karnot-bridge-deploy | ||
|
||
WORKDIR /karnot-bridge-deploy | ||
|
||
# Copy your manifests | ||
COPY ./Cargo.lock ./Cargo.lock | ||
COPY ./Cargo.toml ./Cargo.toml | ||
|
||
# Cache dependencies | ||
RUN cargo build --target x86_64-unknown-linux-musl --release | ||
RUN rm src/*.rs | ||
|
||
# Copy source tree | ||
COPY ./src ./src | ||
|
||
# Build for release | ||
RUN rm -rf ./target/x86_64-unknown-linux-musl/release/deps/karnot_bridge_deploy* | ||
RUN cargo build --target x86_64-unknown-linux-musl --release | ||
RUN touch addresses.json | ||
|
||
ENV RUST_LOG=debug | ||
|
||
# Running the program | ||
ENTRYPOINT ["cargo", "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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
version: "3.8" | ||
services: | ||
app: | ||
build: | ||
context: . | ||
args: | ||
APP_CHAIN_ID: ${APP_CHAIN_ID} | ||
ETH_CHAIN_ID: ${ETH_CHAIN_ID} | ||
ETH_PRIV_KEY: ${ETH_PRIV_KEY} | ||
ETH_RPC: ${ETH_RPC} | ||
FEE_TOKEN_ADDRESS: ${FEE_TOKEN_ADDRESS} | ||
L1_DEPLOYER_ADDRESS: ${L1_DEPLOYER_ADDRESS} | ||
L1_WAIT_TIME: ${L1_WAIT_TIME} | ||
L2_DEPLOYER_ADDRESS: ${L2_DEPLOYER_ADDRESS} | ||
ROLLUP_PRIV_KEY: ${ROLLUP_PRIV_KEY} | ||
SN_OS_CONFIG_HASH_VERSION: ${SN_OS_CONFIG_HASH_VERSION} | ||
SN_OS_PROGRAM_HASH: ${SN_OS_PROGRAM_HASH} | ||
CROSS_CHAIN_WAIT_TIME: ${CROSS_CHAIN_WAIT_TIME} | ||
volumes: | ||
- ./addresses.json:/karnot-bridge-deploy/addresses.json:rw |
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.