Use optimism contracts image
This commit is contained in:
parent
789ca9d7a9
commit
c38c01ef6f
@ -18,14 +18,15 @@ services:
|
|||||||
CERC_L1_ADDRESS: ${CERC_L1_ADDRESS}
|
CERC_L1_ADDRESS: ${CERC_L1_ADDRESS}
|
||||||
CERC_L1_PRIV_KEY: ${CERC_L1_PRIV_KEY}
|
CERC_L1_PRIV_KEY: ${CERC_L1_PRIV_KEY}
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/network/wait-for-it.sh:/app/packages/contracts-bedrock/wait-for-it.sh
|
- ../config/network/wait-for-it.sh:/wait-for-it.sh
|
||||||
- ../config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh:/app/packages/contracts-bedrock/deploy-contracts.sh
|
- ../config/fixturenet-optimism/optimism-contracts/deploy-contracts.sh:/deploy-contracts.sh
|
||||||
- l2_accounts:/l2-accounts
|
- l2_accounts:/l2-accounts
|
||||||
- l1_deployment:/l1-deployment
|
- l1_deployment:/l1-deployment
|
||||||
- l2_config:/l2-config
|
- l2_config:/l2-config
|
||||||
|
entrypoint: ["sh", "-c"]
|
||||||
# Waits for L1 endpoint to be up before running the contract deploy script
|
# Waits for L1 endpoint to be up before running the contract deploy script
|
||||||
command: |
|
command: |
|
||||||
"./wait-for-it.sh -h ${CERC_L1_HOST:-$${DEFAULT_CERC_L1_HOST}} -p ${CERC_L1_PORT:-$${DEFAULT_CERC_L1_PORT}} -s -t 60 -- ./deploy-contracts.sh"
|
"/wait-for-it.sh -h ${CERC_L1_HOST:-$${DEFAULT_CERC_L1_HOST}} -p ${CERC_L1_PORT:-$${DEFAULT_CERC_L1_PORT}} -s -t 60 -- /deploy-contracts.sh"
|
||||||
extra_hosts:
|
extra_hosts:
|
||||||
- "host.docker.internal:host-gateway"
|
- "host.docker.internal:host-gateway"
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ if [ "$create2CodeSize" -eq 0 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Create the L2 deployment
|
# Create the L2 deployment
|
||||||
# Writes out artifact to /app/packages/contracts-bedrock/deployments/$DEPLOYMENT_CONTEXT-deploy.json
|
# Writes out artifact to $OPTIMISM_ROOT/packages/contracts-bedrock/deployments/$DEPLOYMENT_CONTEXT-deploy.json
|
||||||
echo "Deploying L1 Optimism contracts..."
|
echo "Deploying L1 Optimism contracts..."
|
||||||
DEPLOY_CONFIG_PATH=$deploy_config_file forge script scripts/deploy/Deploy.s.sol:Deploy --private-key $ADMIN_KEY --broadcast --rpc-url $CERC_L1_RPC
|
DEPLOY_CONFIG_PATH=$deploy_config_file forge script scripts/deploy/Deploy.s.sol:Deploy --private-key $ADMIN_KEY --broadcast --rpc-url $CERC_L1_RPC
|
||||||
echo "Done deploying contracts."
|
echo "Done deploying contracts."
|
||||||
@ -166,14 +166,16 @@ DEPLOY_CONFIG_PATH=$deploy_config_file \
|
|||||||
CONTRACT_ADDRESSES_PATH=deployments/$DEPLOYMENT_CONTEXT-deploy.json \
|
CONTRACT_ADDRESSES_PATH=deployments/$DEPLOYMENT_CONTEXT-deploy.json \
|
||||||
forge script --chain-id $L2_CHAIN_ID scripts/L2Genesis.s.sol:L2Genesis --sig 'runWithAllUpgrades()' --private-key $ADMIN_KEY
|
forge script --chain-id $L2_CHAIN_ID scripts/L2Genesis.s.sol:L2Genesis --sig 'runWithAllUpgrades()' --private-key $ADMIN_KEY
|
||||||
|
|
||||||
cp /app/packages/contracts-bedrock/state-dump-$L2_CHAIN_ID.json allocs-l2.json
|
OPTIMISM_ROOT=/opt/optimism
|
||||||
|
|
||||||
|
cp $OPTIMISM_ROOT/contracts-bedrock/state-dump-$L2_CHAIN_ID.json allocs-l2.json
|
||||||
echo "Done."
|
echo "Done."
|
||||||
echo "*************************************"
|
echo "*************************************"
|
||||||
|
|
||||||
# Copy files needed by other containers to the appropriate shared volumes
|
# Copy files needed by other containers to the appropriate shared volumes
|
||||||
echo "Copying deployment artifacts volume l1_deployment and deploy-config to volume l2_config"
|
echo "Copying deployment artifacts volume l1_deployment and deploy-config to volume l2_config"
|
||||||
cp /app/packages/contracts-bedrock/deployments/$DEPLOYMENT_CONTEXT-deploy.json /l1-deployment
|
cp $OPTIMISM_ROOT/packages/contracts-bedrock/deployments/$DEPLOYMENT_CONTEXT-deploy.json /l1-deployment
|
||||||
cp /app/packages/contracts-bedrock/deploy-config/$DEPLOYMENT_CONTEXT.json /l2-config
|
cp $OPTIMISM_ROOT/packages/contracts-bedrock/deploy-config/$DEPLOYMENT_CONTEXT.json /l2-config
|
||||||
cp allocs-l2.json /l2-config
|
cp allocs-l2.json /l2-config
|
||||||
openssl rand -hex 32 > /l2-config/l2-jwt.txt
|
openssl rand -hex 32 > /l2-config/l2-jwt.txt
|
||||||
|
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
# TODO: Make work for arm64/Apple Silicon
|
|
||||||
FROM ghcr.io/foundry-rs/foundry:nightly-c4a984fbf2c48b793c8cd53af84f56009dd1070c
|
|
||||||
|
|
||||||
RUN apk update
|
|
||||||
|
|
||||||
# Install node (use edge repo to get latest version)
|
|
||||||
RUN apk add --update --no-cache curl wget bash git busybox jq openssl \
|
|
||||||
&& apk add nodejs --update-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/main --allow-untrusted \
|
|
||||||
&& apk add npm \
|
|
||||||
&& node -v
|
|
||||||
|
|
||||||
# Add corepack for yarn and pnpm
|
|
||||||
RUN npm install -g corepack && corepack enable \
|
|
||||||
&& yarn --version
|
|
||||||
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Copy optimism repo contents
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
RUN echo "Building optimism" && \
|
|
||||||
pnpm install && pnpm build
|
|
||||||
|
|
||||||
WORKDIR /app/packages/contracts-bedrock
|
|
@ -6,4 +6,10 @@ source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
|||||||
# See: https://stackoverflow.com/a/246128/1701505
|
# See: https://stackoverflow.com/a/246128/1701505
|
||||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||||
|
|
||||||
docker build -t cerc/optimism-contracts:local -f ${SCRIPT_DIR}/Dockerfile ${build_command_args} ${CERC_REPO_BASE_DIR}/optimism
|
# The optimism contracts image has dependencies with no aarch64 support, so on aarch64 use an
|
||||||
|
# emulated amd64 image
|
||||||
|
if [[ $(docker info --format='{{ .Architecture }}') == "aarch64" ]]; then
|
||||||
|
PLATFORM_ARG="--platform linux/amd64"
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker build -t cerc/optimism-contracts:local -f ${CERC_REPO_BASE_DIR}/optimism/ops/docker/Dockerfile.packages ${build_command_args} ${CERC_REPO_BASE_DIR}/optimism $PLATFORM_ARG
|
||||||
|
Loading…
Reference in New Issue
Block a user