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.
All configuration is done via environment variables. See all variables at .env.example; copy into a .env
file before running.
- Make sure dependencies are installed just run
yarn
in the base directory - Build
yarn build
- Run
yarn start
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:
debug*
- Will match all debug statements -- very verboseinfo*
- Will match all info statements -- less verbose, useful in most caseswarn*
- Will match all warnings -- recommended at a minimumerror*
- Will match all errors -- would not omit this
Examples:
- Everything but debug:
export DEBUG=info*,error*,warn*
- Most verbose:
export DEBUG=info*,error*,warn*,debug*
- Run unit tests with
yarn test
- See lint errors with
yarn lint
; auto-fix withyarn lint --fix
You may test a submission locally against a local Hardhat fork.
- Follow the instructions here to run a Hardhat node.
- Change the Batch Submitter
.env
fieldL1_NODE_WEB3_URL
to the local Hardhat url. Depending on which network you are using, updateADDRESS_MANAGER_ADDRESS
according to the Regenesis repo. - Also check
L2_NODE_WEB3_URL
is correctly set and has transactions to submit. - Run
yarn build
to build your changes. - Start Batch Submitter with
yarn start
. It will automatically start submitting pending transactions from L2.
When deploying Batch Submitter to production / a live ETH network, populate the environment variables NODE_ENV
(development
, production
, or test
) and ETH_NETWORK_NAME
(mainnet
, kovan
, goerli
). This enables Batch Submitter to capture more context in logs and metrics, and initializes Sentry to track errors.