-
Notifications
You must be signed in to change notification settings - Fork 269
op-deployer + opcm documentation #934
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
05234fa
adding first draft
sbvegan 2db308b
linting
sbvegan eb9d990
Apply suggestions from code review
sbvegan 55ba456
add more docs
mslipper 6148655
adding tags and fixing link
sbvegan 9b9359b
Update pages/stack/experimental/opcm.mdx
sbvegan d53f6d5
fix installation steps
mslipper 8acc82f
removing problem statement section
sbvegan db530a6
carving out experimental section
sbvegan 0e148df
updates from review
mslipper ee9e13e
fixing internal link
sbvegan 2f9f18a
Apply suggestions from code review
sbvegan 6a41011
Apply suggestions from code review
sbvegan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,5 +1,6 @@ | ||
{ | ||
"op-challenger": "Configure Challenger For Your Chain", | ||
"op-conductor": "op-conductor", | ||
"op-conductor": "Conductor", | ||
"op-deployer": "Deployer", | ||
"explorer": "Block Explorer" | ||
} |
This file contains hidden or 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,127 @@ | ||
--- | ||
title: Deployer | ||
lang: en-US | ||
tags: ["op-deployer","eng-platforms"] | ||
description: Learn how op-deployer can simplify deployment of the OP Stack. | ||
--- | ||
|
||
import {Callout, Steps} from 'nextra/components' | ||
|
||
# Deployer | ||
|
||
`op-deployer` simplifies the process of deploying the OP Stack. It works similarly to [Terraform](https://www.terraform.io). Like Terraform, you define a declarative config file called an "intent," then run a | ||
command to apply the intent to your chain. `op-deployer` will compare the state of your chain against the intent, | ||
and make whatever changes are necessary for them to match. | ||
|
||
## Installation | ||
|
||
`op-deployer` is currently under active development, and must be compiled from source. Assuming you have the Go | ||
toolchain installed, you can install `op-deployer` by following these steps: | ||
|
||
<Steps> | ||
### **Clone the Monorepo**: | ||
|
||
Run the following command to clone the monorepo: | ||
|
||
```bash | ||
git clone https://github.com/ethereum-optimism/optimism.git | ||
``` | ||
|
||
### **Build the Binary**: | ||
|
||
Run the following commands to build the binary: | ||
|
||
```bash | ||
cd op-chain-ops | ||
make op-deployer | ||
``` | ||
|
||
### (Optional) Move `op-deployer` Into `$PATH` | ||
|
||
Run the following command to move the `op-deployer` binary into your `$PATH`. Note that the path for your system | ||
may be different: | ||
|
||
```bash | ||
sudo mv ./bin/op-deployer /usr/local/bin/op-deployer | ||
``` | ||
</Steps> | ||
|
||
## Usage | ||
|
||
### Configuring your Chain | ||
|
||
To get started with `op-deployer`, you need to create an intent file that outlines your desired chain configuration. You can use the built-in `op-deployer` utility to generate this file. Just run the following command to create an example intent file for a development chain: | ||
|
||
``` | ||
op-deployer init --l1-chain-id 11155111 --l2-chain-ids 12345 --workdir .deployer | ||
``` | ||
|
||
This command will create a directory called `.deployer` in your current working directory containing the intent file | ||
mslipper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
and an empty `state.json` file. `state.json` is populated with the results of your deployment, and never needs to | ||
be edited directly. | ||
|
||
Your intent file will look something like this: | ||
mslipper marked this conversation as resolved.
Show resolved
Hide resolved
mslipper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
```toml | ||
l1ChainID = 11155111 # The chain ID of the L1 chain you'll be deploying to | ||
fundDevAccounts = true # Whether or not to fund dev accounts using the test... junk mnemonic on L2. | ||
contractsRelease = "op-contracts/v1.6.0" # The version of the smart contracts to deploy. | ||
|
||
# List of L2s to deploy. op-deployer can deploy multiple L2s at once | ||
[[chains]] | ||
# Your chain's ID, encoded as a 32-byte hex string | ||
id = "0x0000000000000000000000000000000000000000000000000000000000003039" | ||
mslipper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
# Various ownership roles for your chain. When you use op-deployer init, these roles are generated using the | ||
# test... junk mnemonic. You should replace these with your own addresses for production chains. | ||
[chains.roles] | ||
proxyAdminOwner = "0x7759a8a43aa6a7ee9434ddb597beed64180c40fd" | ||
systemConfigOwner = "0x8e35d9523a0c4c9ac537d254079c2398c6f3b35f" | ||
governanceTokenOwner = "0x7759a8a43aa6a7ee9434ddb597beed64180c40fd" | ||
unsafeBlockSigner = "0xbb19dce4ce51f353a98dbab31b5fa3bc80dc7769" | ||
batcher = "0x0e9c62712ab826e06b16b2236ce542f711eaffaf" | ||
proposer = "0x86dfafe0689e20685f7872e0cb264868454627bc" | ||
challenger = "0xf1658da627dd0738c555f9572f658617511c49d5" | ||
``` | ||
|
||
See the code comments above for explanations of each field. By default, `op-deployer` will fill in all other configuration variables | ||
with those that match our standard config. You can override these defaults by adding them to your intent file, but | ||
that won't be covered here. | ||
sbvegan marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
### Applying your Intent | ||
|
||
Now that you've created your intent file, you can apply it to your chain: | ||
|
||
``` | ||
op-deployer apply --workdir .deployer --l1-rpc-url <rpc-url> --private-key <private key hex> | ||
mslipper marked this conversation as resolved.
Show resolved
Hide resolved
mslipper marked this conversation as resolved.
Show resolved
Hide resolved
|
||
``` | ||
|
||
Hardware wallets are not supported, but you can use ephemeral hot wallets since this deployer key has no privileges. | ||
|
||
This command will deploy the OP Stack to L1. It will deploy all L2s specified in the intent file. Superchain | ||
configuration will be set to the Superchain-wide defaults - i.e., your chain will be opted into the [Superchain pause](https://specs.optimism.io/protocol/superchain-configuration.html#pausability) | ||
and will use the same [protocol versions](https://github.com/ethereum-optimism/specs/blob/main/specs/protocol/superchain-upgrades.md) | ||
address as other chains on the Superchain. | ||
|
||
### Generating Genesis Files | ||
|
||
With the contracts deployed, you can generate a genesis file for any of your L2s. Run the following command to do so: | ||
|
||
``` | ||
./bin/op-deployer inspect genesis <l2-chain-id> --outfile genesis.json | ||
``` | ||
|
||
This will write the genesis file to `genesis.json`. You can change the `--outfile` parameter to write it somewhere | ||
else. You can run another member of the `inspect` family, `rollup`, to get the `rollup.json` file: | ||
|
||
``` | ||
./bin/op-deployer inspect rollup <l2-chain-id> --outfile rollup.json | ||
``` | ||
|
||
## More Information | ||
|
||
`op-deployer` uses the OP Contracts Manager (OPCM) under the hood to deploy contracts. | ||
|
||
## Next Steps | ||
|
||
* For more details, check out the tool and documentation in the [op-deployer repository](https://github.com/ethereum-optimism/optimism/tree/develop/op-chain-ops/cmd/op-deployer). | ||
* For more information on OP Contracts Manager, refer to the [OPCM documentation](/stack/opcm). | ||
sbvegan marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or 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 hidden or 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,29 @@ | ||
--- | ||
title: OP Contracts Manager | ||
lang: en-US | ||
tags: ["opcm","eng-security"] | ||
description: Learn how OP Contracts Manager deploys of the OP Stack with one transaction. | ||
--- | ||
|
||
import { Callout, Tabs, Steps } from 'nextra/components' | ||
|
||
# OP Contracts Manager | ||
|
||
The OP Contracts Manager is a contract that deploys the L1 contracts for an OP Stack chain in a single transaction. It provides a minimal set of user-configurable parameters to ensure that the resulting chain meets the standard configuration requirements. | ||
|
||
The version deployed is always a governance-approved contract release. The set of governance approved contract releases can be found on the Optimism Monorepo releases page, and is the set of releases named `op-contracts/vX.Y.Z`. | ||
|
||
## Purpose | ||
|
||
OPCM simplifies the L1 contract deployments for new OP Stack chains. It addresses three aspects of deploying the OP Stack's L1 contracts: | ||
|
||
1. **Deploy Superchain Contracts.** Superchain contracts are shared between many OP chains, so this occurs only occasionally in production. | ||
2. **Deploy Shared Implementation Contracts.** This occurs once per contracts release in production. | ||
3. **Deploy OP Chain Contracts.** This occurs for every OP chain deployment in production. | ||
|
||
In a future iteration, it also is meant to handle upgrading the smart contracts. | ||
|
||
## Learn more | ||
|
||
* Checkout the [OPCM specs](https://specs.optimism.io/experimental/op-contracts-manager.html) | ||
* Checkout the [OPCM design document](https://github.com/ethereum-optimism/design-docs/blob/main/protocol/op-contracts-manager-arch.md) |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.