@@ -430,7 +430,9 @@ The final component necessary to put all the pieces together is the `op-batcher`
...
@@ -430,7 +430,9 @@ The final component necessary to put all the pieces together is the `op-batcher`
cd ~/optimism/op-batcher
cd ~/optimism/op-batcher
```
```
1. And run the `op-batcher` using the following command. Replace `<RPC>` with your L1 node URL and replace `<BATCHERKEY>` with the private key for the `Batcher` account that you created and funded earlier. It’s best to give the `Batcher` at least 1 Goerli ETH to ensure that it can continue operating without running out of ETH for gas.
1. And run the `op-batcher` using the following command.
Replace `<RPC>` with your L1 node URL and replace `<BATCHERKEY>` with the private key for the `Batcher` account that you created and funded earlier.
It’s best to give the `Batcher` at least 1 Goerli ETH to ensure that it can continue operating without running out of ETH for gas.
```bash
```bash
./bin/op-batcher \
./bin/op-batcher \
...
@@ -443,11 +445,22 @@ The final component necessary to put all the pieces together is the `op-batcher`
...
@@ -443,11 +445,22 @@ The final component necessary to put all the pieces together is the `op-batcher`
--resubmission-timeout=30s \
--resubmission-timeout=30s \
--rpc.addr=0.0.0.0 \
--rpc.addr=0.0.0.0 \
--rpc.port=8548 \
--rpc.port=8548 \
--rpc.enable-admin \
--max-channel-duration=1 \
--target-l1-tx-size-bytes=2048 \
--target-l1-tx-size-bytes=2048 \
--l1-eth-rpc=<RPC> \
--l1-eth-rpc=<RPC> \
--private-key=<BATCHERKEY>
--private-key=<BATCHERKEY>
```
```
::: tip Controlling batcher costs
The `--max-channel-duration=n` setting tells the batcher to write all the data to L1 every `n` L1 blocks.
When it is low, transactions are written to L1 frequently, withdrawals are quick, and other nodes can synchronize from L1 fast.
When it is high, transactions are written to L1 less frequently, and the batcher spends less ETH.
:::
## Get some ETH on your Rollup
## Get some ETH on your Rollup
Once you’ve connected your wallet, you’ll probably notice that you don’t have any ETH on your Rollup. You’ll need some ETH to pay for gas on your Rollup. The easiest way to deposit Goerli ETH into your chain is to send funds directly to the `OptimismPortalProxy` contract. You can find the address of the `OptimismPortalProxy` contract for your chain by looking inside the `deployments` folder in the `contracts-bedrock` package.
Once you’ve connected your wallet, you’ll probably notice that you don’t have any ETH on your Rollup. You’ll need some ETH to pay for gas on your Rollup. The easiest way to deposit Goerli ETH into your chain is to send funds directly to the `OptimismPortalProxy` contract. You can find the address of the `OptimismPortalProxy` contract for your chain by looking inside the `deployments` folder in the `contracts-bedrock` package.
...
@@ -464,18 +477,10 @@ Once you’ve connected your wallet, you’ll probably notice that you don’t h
...
@@ -464,18 +477,10 @@ Once you’ve connected your wallet, you’ll probably notice that you don’t h
1. Grab the L1 bridge proxy contract address and, using the wallet that you want to have ETH on your Rollup, send that address a small amount of ETH on Goerli (0.1 or less is fine). It may take up to 5 minutes for that ETH to appear in your wallet on L2.
1. Grab the L1 bridge proxy contract address and, using the wallet that you want to have ETH on your Rollup, send that address a small amount of ETH on Goerli (0.1 or less is fine). It may take up to 5 minutes for that ETH to appear in your wallet on L2.
...
@@ -566,37 +571,6 @@ ERROR[03-21|14:22:32.844] unable to publish transaction service=batch
...
@@ -566,37 +571,6 @@ ERROR[03-21|14:22:32.844] unable to publish transaction service=batch
Just send more ETH and to the batcher, and the problem will be resolved.
Just send more ETH and to the batcher, and the problem will be resolved.
## Adding nodes
To add nodes to the rollup, you need to initialize `op-node` and `op-geth`, similar to what you did for the first node.
You should *not* add an `op-bathcer`, there should be only one.
1. Configure the OS and prerequisites as you did for the first node.
1. Build the Optimism monorepo and `op-geth` as you did for the first node.
1. Copy from the first node these files:
```bash
~/op-geth/genesis.json
~/optimism/op-node/rollup.json
```
1. Create a new `jwt.txt` file as a shared secret:
1. To enable L2 nodes to synchronize directly, rather than wait until the transactions are written to L1, turn on [peer to peer synchronization](http://localhost:8081/docs/build/getting-started/#run-op-node).
If you already have peer to peer synchronization, add the new node to the `--p2p.static` list so it can synchronize.
1. Start `op-geth` (using the same command line you used on the initial node)
1. Start `op-node` (using the same command line you used on the initial node)