Update L2 genesis generation
This commit is contained in:
parent
16a290c050
commit
384c450f61
@ -19,7 +19,7 @@ echo "Using L1 RPC endpoint ${CERC_L1_RPC}"
|
||||
if [ -d "/l1-deployment/$DEPLOYMENT_CONTEXT" ]; then
|
||||
echo "Deployment directory /l1-deployment/$DEPLOYMENT_CONTEXT, checking OptimismPortal deployment"
|
||||
|
||||
OPTIMISM_PORTAL_ADDRESS=$(cat /l1-deployment/$DEPLOYMENT_CONTEXT/OptimismPortal.json | jq -r .address)
|
||||
OPTIMISM_PORTAL_ADDRESS=$(cat /l1-deployment/$DEPLOYMENT_CONTEXT/.deploy | jq -r .OptimismPortal)
|
||||
contract_code=$(cast code $OPTIMISM_PORTAL_ADDRESS --rpc-url $CERC_L1_RPC)
|
||||
|
||||
if [ -z "${contract_code#0x}" ]; then
|
||||
@ -150,14 +150,21 @@ fi
|
||||
# Writes out artifact to /app/packages/contracts-bedrock/deployments/$DEPLOYMENT_CONTEXT/.deploy
|
||||
echo "Deploying L1 Optimism contracts..."
|
||||
forge script scripts/Deploy.s.sol:Deploy --private-key $ADMIN_KEY --broadcast --rpc-url $CERC_L1_RPC
|
||||
echo "Done deploying contracts."
|
||||
|
||||
echo "Generating L2 genesis allocs..."
|
||||
L2_CHAIN_ID=$(jq ".l2ChainID" $deploy_config_file)
|
||||
CONTRACT_ADDRESSES_PATH=deployments/$DEPLOYMENT_CONTEXT/.deploy forge script --chain-id $L2_CHAIN_ID scripts/L2Genesis.s.sol:L2Genesis --sig 'runWithAllUpgrades()' --private-key $ADMIN_KEY
|
||||
echo "{ \"accounts\": $(jq '.' /app/packages/contracts-bedrock/state-dump-$L2_CHAIN_ID.json) }" > allocs-l2.json
|
||||
echo "Done."
|
||||
|
||||
echo "*************************************"
|
||||
echo "Done deploying contracts."
|
||||
|
||||
# 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"
|
||||
cp -a /app/packages/contracts-bedrock/deployments/$DEPLOYMENT_CONTEXT /l1-deployment
|
||||
cp /app/packages/contracts-bedrock/deploy-config/$DEPLOYMENT_CONTEXT.json /l2-config
|
||||
cp allocs-l2.json /l2-config
|
||||
openssl rand -hex 32 > /l2-config/l2-jwt.txt
|
||||
|
||||
echo "Deployment successful. Exiting"
|
||||
|
@ -9,7 +9,8 @@ CERC_L1_RPC="${CERC_L1_RPC:-${DEFAULT_CERC_L1_RPC}}"
|
||||
DEPLOYMENT_CONTEXT="$CERC_L1_CHAIN_ID"
|
||||
|
||||
deploy_config_file="/l2-config/$DEPLOYMENT_CONTEXT.json"
|
||||
deployment_dir="/l1-deployment/$DEPLOYMENT_CONTEXT"
|
||||
l1_deployment_file="/l1-deployment/$DEPLOYMENT_CONTEXT/.deploy"
|
||||
l2_allocs_file="/l2-config/allocs-l2.json"
|
||||
genesis_outfile="/l2-config/genesis.json"
|
||||
rollup_outfile="/l2-config/rollup.json"
|
||||
|
||||
@ -17,7 +18,8 @@ rollup_outfile="/l2-config/rollup.json"
|
||||
if [ ! -f "$genesis_outfile" ] || [ ! -f "$rollup_outfile" ]; then
|
||||
op-node genesis l2 \
|
||||
--deploy-config $deploy_config_file \
|
||||
--deployment-dir $deployment_dir \
|
||||
--l1-deployments $l1_deployment_file \
|
||||
--l2-allocs $l2_allocs_file \
|
||||
--outfile.l2 $genesis_outfile \
|
||||
--outfile.rollup $rollup_outfile \
|
||||
--l1-rpc $CERC_L1_RPC
|
||||
|
@ -11,7 +11,7 @@ DEPLOYMENT_CONTEXT="$CERC_L1_CHAIN_ID"
|
||||
# Start op-proposer
|
||||
ROLLUP_RPC="http://op-node:8547"
|
||||
PROPOSER_KEY=$(cat /l2-accounts/accounts.json | jq -r .ProposerKey)
|
||||
L2OO_ADDR=$(cat /l1-deployment/$DEPLOYMENT_CONTEXT/L2OutputOracleProxy.json | jq -r .address)
|
||||
L2OO_ADDR=$(cat /l1-deployment/$DEPLOYMENT_CONTEXT/.deploy | jq -r .L2OutputOracleProxy)
|
||||
|
||||
op-proposer \
|
||||
--poll-interval=12s \
|
||||
|
Loading…
Reference in New Issue
Block a user