From 81874df258c53799c46d4f50c6069b648f5d69cb Mon Sep 17 00:00:00 2001 From: Jacob Homanics Date: Tue, 1 Aug 2023 00:29:59 -0500 Subject: [PATCH 1/3] fixed a bug where sequencer.enabled was an unrecognized command and would prevent the script from running --- src/docs/build/getting-started.md | 1 - 1 file changed, 1 deletion(-) diff --git a/src/docs/build/getting-started.md b/src/docs/build/getting-started.md index a105be8..0a8bea7 100644 --- a/src/docs/build/getting-started.md +++ b/src/docs/build/getting-started.md @@ -420,7 +420,6 @@ cd ~/optimism/op-node ./bin/op-node \ --l2=http://localhost:8551 \ --l2.jwt-secret=./jwt.txt \ - --sequencer.enabled \ --sequencer.l1-confs=3 \ --verifier.l1-confs=3 \ --rollup.config=./rollup.json \ From 72fd21f0ee04655512567bb3e5f7c263a0b6c5bb Mon Sep 17 00:00:00 2001 From: Jacob Homanics Date: Tue, 1 Aug 2023 01:10:45 -0500 Subject: [PATCH 2/3] added in additional clarity around direnv usage --- src/docs/build/getting-started.md | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/src/docs/build/getting-started.md b/src/docs/build/getting-started.md index 0a8bea7..b886e1f 100644 --- a/src/docs/build/getting-started.md +++ b/src/docs/build/getting-started.md @@ -210,7 +210,13 @@ Once you’ve built both repositories, you’ll need head back to the Optimism M direnv allow . ``` - If you need to install `direnv`, [make sure you also modify the shell configuration](https://direnv.net/docs/hook.html). + If you need to install `direnv`, then run this command: + + `curl -sfL https://direnv.net/install.sh | bash` + + [make sure you also modify the shell configuration](https://direnv.net/docs/hook.html). + + Reload your terminal. 1. Before we can create our configuration file, we’ll need to pick an L1 block to serve as the starting point for our Rollup. It’s best to use a finalized L1 block as our starting block. You can use the `cast` command provided by Foundry to grab all of the necessary information: @@ -322,6 +328,18 @@ There are four components that need to run for a rollup. The first two, `op-geth` and `op-node`, have to run on every node. The other two, `op-batcher` and `op-proposer`, run only in one place, the sequencer that accepts transactions. + +Create a `.envrc` file (can place it anywhere). + +the file should be setup something like: +```shell +export SEQ_KEY= +export BATCHER_KEY= +export PROPOSER_KEY= +export RPC_KIND= +export L200_ADDR= +``` + Set these environment variables for the configuration | Variable | Value | @@ -414,6 +432,15 @@ This is the reinitialization procedure: Once we’ve got `op-geth` running we’ll need to run `op-node`. Like Ethereum, the OP Stack has a consensus client (the `op-node`) and an execution client (`op-geth`). The consensus client drives the execution client over the Engine API. +Open a terminal wherever you placed the `.envrc` file that contains `SEQ_KEY`, `BATCHER_KEY`, `PROPOSER_KEY`, `L1_RPC`, `RPC_KIND`, and ` L200_ADDR` + +Run the command: `direnv allow .` + +Create a new shell script: `run-op-node.sh` + +Run the command in terminal: `chmod +x run-op-node.sh` + +Fill the contents of `run-op-node.sh` with: ```bash cd ~/optimism/op-node @@ -432,6 +459,8 @@ cd ~/optimism/op-node --l1.rpckind=$RPC_KIND ``` +Run the file: `./run-op-node.sh` + Once you run this command, you should start seeing the `op-node` begin to process all of the L1 information after the starting block number that you picked earlier. Once the `op-node` has enough information, it’ll begin sending Engine API payloads to `op-geth`. At that point, you’ll start to see blocks being created inside of `op-geth`. We’re live! From f437908fa2226c8732d8890e0f65f81db2cdc116 Mon Sep 17 00:00:00 2001 From: Jacob Homanics Date: Tue, 1 Aug 2023 01:22:42 -0500 Subject: [PATCH 3/3] added direnv/.envrc support for op-batcher and op-proposer --- src/docs/build/getting-started.md | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/docs/build/getting-started.md b/src/docs/build/getting-started.md index b886e1f..7a34a1e 100644 --- a/src/docs/build/getting-started.md +++ b/src/docs/build/getting-started.md @@ -459,7 +459,7 @@ cd ~/optimism/op-node --l1.rpckind=$RPC_KIND ``` -Run the file: `./run-op-node.sh` +Run the shell script: `./run-op-node.sh` Once you run this command, you should start seeing the `op-node` begin to process all of the L1 information after the starting block number that you picked earlier. Once the `op-node` has enough information, it’ll begin sending Engine API payloads to `op-geth`. At that point, you’ll start to see blocks being created inside of `op-geth`. We’re live! @@ -490,7 +490,13 @@ The `op-batcher` takes transactions from the Sequencer and publishes those trans It is best to give the `Batcher` at least 1 Goerli ETH to ensure that it can continue operating without running out of ETH for gas. +Setup a terminal the same way you did with `op-node` with the direnv and `.envrc`. +Create a new shell script: `run-op-batcher.sh` + +Run the command in terminal: `chmod +x run-op-batcher.sh` + +Fill the contents of `run-op-batcher.sh` with: ```bash cd ~/optimism/op-batcher @@ -509,6 +515,7 @@ cd ~/optimism/op-batcher --l1-eth-rpc=$L1_RPC \ --private-key=$BATCHER_KEY ``` +Run the shell script: `./run-op-batcher.sh` ::: tip Controlling batcher costs @@ -522,6 +529,14 @@ When it is high, transactions are written to L1 less frequently, and the batcher Now start `op-proposer`, which proposes new state roots. +Setup a terminal the same way you did with `op-node` with the direnv and `.envrc`. + +Create a new shell script: `run-op-proposer.sh` + +Run the command in terminal: `chmod +x run-op-proposer.sh` + +Fill the contents of `run-op-proposer.sh` with: + ```bash cd ~/optimism/op-proposer @@ -533,6 +548,7 @@ cd ~/optimism/op-proposer --private-key=$PROPOSER_KEY \ --l1-eth-rpc=$L1_RPC ``` +Run the shell script: `./run-op-proposer.sh` ## Get some ETH on your Rollup