ethereum-optimism / batch-submitter

[Optimism] Batches go zoom
12 stars 16 forks source link

[DEPRECATED] This repository is now deprecated in favour of the new development monorepo.

Batch Submitter

Contains an executable batch submitter service which watches L1 and a local L2 node and submits batches to the CanonicalTransactionChain & StateCommitmentChain based on its local information.

Configuration

All configuration is done via environment variables. See all variables at .env.example; copy into a .env file before running.

Building & Running

  1. Make sure dependencies are installed just run yarn in the base directory
  2. Build yarn build
  3. Run yarn start

Controlling log output verbosity

Before running, set the DEBUG environment variable to specify the verbosity level. It must be made up of comma-separated values of patterns to match in debug logs. Here's a few common options:

Examples:

Testing & linting

Local

Submission

You may test a submission locally against a local Hardhat fork.

  1. Follow the instructions here to run a Hardhat node.
  2. Change the Batch Submitter .env field L1_NODE_WEB3_URL to the local Hardhat url. Depending on which network you are using, update ADDRESS_MANAGER_ADDRESS according to the Regenesis repo.
  3. Also check L2_NODE_WEB3_URL is correctly set and has transactions to submit.
  4. Run yarn build to build your changes.
  5. Start Batch Submitter with yarn start. It will automatically start submitting pending transactions from L2.