Skip to content
This repository was archived by the owner on Dec 12, 2023. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 46 additions & 2 deletions src/docs/build/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down Expand Up @@ -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 |
Expand Down Expand Up @@ -414,13 +432,21 @@ 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

./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 \
Expand All @@ -433,6 +459,8 @@ cd ~/optimism/op-node
--l1.rpckind=$RPC_KIND
```

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!


Expand Down Expand Up @@ -462,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

Expand All @@ -481,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

Expand All @@ -494,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

Expand All @@ -505,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
Expand Down