forked from matter-labs/zksync
-
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.
Merge branch 'dev' into lyova-983-refactor-shell-scripts-and-makefile
- Loading branch information
Showing
11 changed files
with
154 additions
and
185 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,16 @@ | ||
#!/bin/bash | ||
cd $ZKSYNC_HOME | ||
. .setup_env | ||
|
||
zksync integration-test || exit 1 | ||
zksync api-test || exit 1 | ||
|
||
# zcli test | ||
yarn --cwd infrastructure/zcli test || exit 1 | ||
|
||
# rust-sdk test | ||
cargo test -p zksync --release -- --ignored --test-threads=1 || exit 1 | ||
|
||
# We have to kill the server before running data-restore | ||
killall zksync_server | ||
zksync data-restore check-existing || exit 1 |
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 @@ | ||
#!/bin/bash | ||
|
||
echo "Server logs:" | ||
echo "============" | ||
cat $ZKSYNC_HOME/server.log | ||
echo "" | ||
|
||
echo "Prover logs:" | ||
echo "============" | ||
cat $ZKSYNC_HOME/dummy_prover.log | ||
echo "" | ||
|
||
# If we're calling this script, previous command failed and we want to exit with an error code | ||
exit 1 |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
|
||
|
||
# Example usage: | ||
# `ci_docker_container.sh COMMAND_TO_RUN`, e.g. `ci_docker_container.sh "zksync integration-simple"` | ||
|
||
# In this command we launch the container `matterlabs/ci-integration-test:latest`, which includes database and geth. | ||
# `entrypoint.sh` prepares database and network for interaction, and also launches `dev-ticker-server`, `server` and `dummy-prover`. | ||
# Note that contracts must be compiled and dummy-prover should be enabled prior to the command launch, as we mount $ZKSYNC_HOME from | ||
# the host system inside of the container, and expect environment to be prepared for the launch. | ||
docker run -v $ZKSYNC_HOME:/usr/src/zksync matterlabs/ci-integration-test:latest bash -c "/usr/local/bin/entrypoint.sh && $1" |
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 |
---|---|---|
@@ -0,0 +1,46 @@ | ||
FROM matterlabs/geth:latest as geth | ||
FROM debian:buster-slim | ||
|
||
WORKDIR /usr/src/zksync | ||
|
||
# Install required dependencies | ||
RUN apt-get update; apt-get install -y make bash git postgresql openssl libssl-dev gcc g++ curl libpq-dev pkg-config software-properties-common jq | ||
|
||
# Install node and yarn | ||
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash - | ||
RUN apt-get install -y nodejs | ||
RUN npm install -g yarn | ||
|
||
# Install Rust and required cargo packages | ||
ENV RUSTUP_HOME=/usr/local/rustup \ | ||
CARGO_HOME=/usr/local/cargo \ | ||
PATH=/usr/local/cargo/bin:$PATH | ||
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y | ||
RUN cargo install diesel_cli --no-default-features --features postgres | ||
RUN cargo install --version=0.1.0-beta.1 sqlx-cli | ||
|
||
# Postgresql: Enable trust authentication to allow any connections. | ||
RUN mkdir -p /etc/postgresql/11/main | ||
RUN echo "host all all 0.0.0.0/0 trust" > /etc/postgresql/11/main/pg_hba.conf | ||
|
||
# Copy geth files | ||
RUN apt-get install -y ca-certificates | ||
RUN mkdir -p /seed/keystore | ||
RUN mkdir -p /var/lib/geth/data | ||
COPY --from=geth /seed/* /seed/ | ||
COPY --from=geth /seed/keystore/* /seed/keystore/ | ||
COPY --from=geth /bin/geth-entry.sh /usr/local/bin/ | ||
RUN curl https://gethstore.blob.core.windows.net/builds/geth-linux-amd64-1.9.22-c71a7e26.tar.gz -o geth-linux-amd64-1.9.22-c71a7e26.tar.gz | ||
RUN tar -xzf geth-linux-amd64-1.9.22-c71a7e26.tar.gz && cp ./geth-linux-amd64-1.9.22-c71a7e26/geth /usr/local/bin | ||
|
||
# Install `solc` | ||
RUN curl -LO https://github.com/ethereum/solidity/releases/download/v0.5.16/solc-static-linux | ||
RUN chmod +x solc-static-linux | ||
RUN mv solc-static-linux /usr/local/bin/solc | ||
|
||
# Copy the setup script | ||
COPY entrypoint.sh /usr/local/bin/ | ||
|
||
# Setup the environment | ||
ENV ZKSYNC_HOME=/usr/src/zksync | ||
ENV PATH="${ZKSYNC_HOME}/bin:${PATH}" |
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,42 @@ | ||
#!/bin/bash -ue | ||
|
||
# Run geth | ||
nohup /usr/local/bin/geth-entry.sh &>/dev/null & | ||
|
||
# Initialize database | ||
service postgresql restart | ||
|
||
# Prepare dummy-prover in the contract (so the redeployed version will be OK) | ||
zksync dummy-prover enable-no-redeploy | ||
|
||
# Initialize the stack (mostly, it's an init command with some steps skipped for docker environment) | ||
zksync verify-keys unpack | ||
zksync yarn || true # It can fail. | ||
zksync db-setup | ||
zksync build-dev-contracts | ||
zksync deploy-erc20 dev | ||
zksync build-contracts | ||
zksync genesis | ||
zksync redeploy | ||
|
||
# Compile required dependencies | ||
f cargo build --bin zksync_server --release | ||
f cargo build --bin dummy_prover --release | ||
f cargo build --bin dev-ticker-server --release | ||
|
||
# Launch binaries | ||
echo "Launching dev-ticker-server..." | ||
nohup f $ZKSYNC_HOME/target/release/dev-ticker-server &>/dev/null & | ||
sleep 1 | ||
|
||
echo "Launching server..." | ||
nohup f $ZKSYNC_HOME/target/release/zksync_server &>$ZKSYNC_HOME/server.log & | ||
sleep 1 | ||
|
||
echo "Launching dummy-prover..." | ||
nohup f $ZKSYNC_HOME/target/release/dummy_prover "dummy-prover-instance" &>$ZKSYNC_HOME/dummy_prover.log & | ||
|
||
# Wait for server to start | ||
sleep 10 | ||
|
||
echo "Done!" |