Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
0443384d
Commit
0443384d
authored
Jun 01, 2022
by
Mark Tyneway
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ops-bedrock: fix devnet build
parent
0bc7d410
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
29 deletions
+34
-29
devnet-up.sh
ops-bedrock/devnet-up.sh
+34
-29
No files found.
ops-bedrock/devnet-up.sh
View file @
0443384d
...
@@ -32,6 +32,8 @@ set -eu
...
@@ -32,6 +32,8 @@ set -eu
L1_URL
=
"http://localhost:8545"
L1_URL
=
"http://localhost:8545"
L2_URL
=
"http://localhost:9545"
L2_URL
=
"http://localhost:9545"
CONTRACTS_BEDROCK
=
./packages/contracts-bedrock
# Helper method that waits for a given URL to be up. Can't use
# Helper method that waits for a given URL to be up. Can't use
# cURL's built-in retry logic because connection reset errors
# cURL's built-in retry logic because connection reset errors
# are ignored unless you're using a very recent version of cURL
# are ignored unless you're using a very recent version of cURL
...
@@ -64,25 +66,27 @@ else
...
@@ -64,25 +66,27 @@ else
fi
fi
# Bring up L1.
# Bring up L1.
cd
ops-bedrock
(
echo
"Bringing up L1..."
cd
ops-bedrock
DOCKER_BUILDKIT
=
1 docker-compose build
echo
"Bringing up L1..."
docker-compose up
-d
l1
DOCKER_BUILDKIT
=
1 docker-compose build
wait_up
$L1_URL
docker-compose up
-d
l1
cd
../
wait_up
$L1_URL
)
# Deploy contracts using Hardhat.
# Deploy contracts using Hardhat.
if
[
!
-f
./contracts-bedrock
/deployments/devnetL1/OptimismPortal.json
]
;
then
if
[
!
-f
$CONTRACTS_BEDROCK
/deployments/devnetL1/OptimismPortal.json
]
;
then
echo
"Deploying contracts."
echo
"Deploying contracts."
cd
./contracts-bedrock
(
L2OO_STARTING_BLOCK_TIMESTAMP
=
$GENESIS_TIMESTAMP
yarn hardhat
--network
devnetL1 deploy
cd
$CONTRACTS_BEDROCK
cd
../
L2OO_STARTING_BLOCK_TIMESTAMP
=
$GENESIS_TIMESTAMP
yarn hardhat
--network
devnetL1 deploy
)
else
else
echo
"Contracts already deployed, skipping."
echo
"Contracts already deployed, skipping."
fi
fi
function
get_deployed_bytecode
()
{
function
get_deployed_bytecode
()
{
echo
$(
jq
-r
.deployedBytecode
./contracts-bedrock
/artifacts/contracts/
$1
)
echo
$(
jq
-r
.deployedBytecode
$CONTRACTS_BEDROCK
/artifacts/contracts/
$1
)
}
}
# Pull out the necessary bytecode/addresses from the artifacts/deployments.
# Pull out the necessary bytecode/addresses from the artifacts/deployments.
...
@@ -92,8 +96,8 @@ OPTIMISM_MINTABLE_TOKEN_FACTORY_BYTECODE=$(get_deployed_bytecode universal/Optim
...
@@ -92,8 +96,8 @@ OPTIMISM_MINTABLE_TOKEN_FACTORY_BYTECODE=$(get_deployed_bytecode universal/Optim
L2_STANDARD_BRIDGE_BYTECODE
=
$(
get_deployed_bytecode L2/L2StandardBridge.sol/L2StandardBridge.json
)
L2_STANDARD_BRIDGE_BYTECODE
=
$(
get_deployed_bytecode L2/L2StandardBridge.sol/L2StandardBridge.json
)
L1_BLOCK_INFO_BYTECODE
=
$(
get_deployed_bytecode L2/L1Block.sol/L1Block.json
)
L1_BLOCK_INFO_BYTECODE
=
$(
get_deployed_bytecode L2/L1Block.sol/L1Block.json
)
DEPOSIT_CONTRACT_ADDRESS
=
$(
jq
-r
.address <
./contracts-bedrock
/deployments/devnetL1/OptimismPortal.json
)
DEPOSIT_CONTRACT_ADDRESS
=
$(
jq
-r
.address <
$CONTRACTS_BEDROCK
/deployments/devnetL1/OptimismPortal.json
)
L2OO_ADDRESS
=
$(
jq
-r
.address <
./contracts-bedrock
/deployments/devnetL1/L2OutputOracle.json
)
L2OO_ADDRESS
=
$(
jq
-r
.address <
$CONTRACTS_BEDROCK
/deployments/devnetL1/L2OutputOracle.json
)
# Replace values in the L2 genesis file. It doesn't matter if this gets run every time,
# Replace values in the L2 genesis file. It doesn't matter if this gets run every time,
# since the replaced values will be the same.
# since the replaced values will be the same.
...
@@ -110,11 +114,12 @@ jq ". | .alloc.\"4200000000000000000000000000000000000015\".code = \"$L1_BLOCK_I
...
@@ -110,11 +114,12 @@ jq ". | .alloc.\"4200000000000000000000000000000000000015\".code = \"$L1_BLOCK_I
jq
". | .timestamp =
\"
$GENESIS_TIMESTAMP
\"
"
>
./.devnet/genesis-l2.json
jq
". | .timestamp =
\"
$GENESIS_TIMESTAMP
\"
"
>
./.devnet/genesis-l2.json
# Bring up L2.
# Bring up L2.
cd
ops-bedrock
(
echo
"Bringing up L2..."
cd
ops-bedrock
docker-compose up
-d
l2
echo
"Bringing up L2..."
wait_up
$L2_URL
docker-compose up
-d
l2
cd
../
wait_up
$L2_URL
)
# Start putting together the rollup config.
# Start putting together the rollup config.
echo
"Building rollup config..."
echo
"Building rollup config..."
...
@@ -154,16 +159,16 @@ SEQUENCER_GENESIS_HASH="$(echo $L2_GENESIS | jq -r '.result.hash')"
...
@@ -154,16 +159,16 @@ SEQUENCER_GENESIS_HASH="$(echo $L2_GENESIS | jq -r '.result.hash')"
SEQUENCER_BATCH_INBOX_ADDRESS
=
"
$(
cat
./ops-bedrock/rollup.json | jq
-r
'.batch_inbox_address'
)
"
SEQUENCER_BATCH_INBOX_ADDRESS
=
"
$(
cat
./ops-bedrock/rollup.json | jq
-r
'.batch_inbox_address'
)
"
# Bring up everything else.
# Bring up everything else.
cd
ops-bedrock
(
echo
"Bringing up devnet..."
cd
ops-bedrock
L2OO_ADDRESS
=
"
$L2OO_ADDRESS
"
\
echo
"Bringing up devnet..."
SEQUENCER_GENESIS_HASH
=
"
$SEQUENCER_GENESIS_HASH
"
\
L2OO_ADDRESS
=
"
$L2OO_ADDRESS
"
\
SEQUENCER_BATCH_INBOX_ADDRESS
=
"
$SEQUENCER_BATCH_INBOX_ADDRESS
"
\
SEQUENCER_GENESIS_HASH
=
"
$SEQUENCER_GENESIS_HASH
"
\
docker-compose up
-d
op-proposer op-batcher
SEQUENCER_BATCH_INBOX_ADDRESS
=
"
$SEQUENCER_BATCH_INBOX_ADDRESS
"
\
docker-compose up
-d
op-proposer op-batcher
echo
"Bringin up stateviz webserver..."
docker-compose up
-d
stateviz
echo
"Bringin up stateviz webserver..."
docker-compose up
-d
stateviz
cd
../
)
echo
"Devnet ready."
echo
"Devnet ready."
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment