mattdf / optimism

Monorepo implementing the Optimistic Ethereum protocol

Home Page:https://optimism.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Optimism Monorepo

Monorepo implementing the Optimistic Ethereum protocol

Github Actions Github Actions Github Actions

Documentation

Extensive documentation is available here

Directory Structure

  • packages: Contains all the typescript packages and contracts
  • l2geth: Fork of go-ethereum v1.9.10 implementing the OVM.
  • integration-tests: Integration tests between a L1 testnet, l2geth,
  • ops: Contains Dockerfiles for containerizing each service involved in the protocol, as well as a docker-compose file for bringing up local testnets easily

Quickstart

Installation

Dependency management is done using yarn.

git clone git@github.com:ethereum-optimism/optimism.git
cd optimism
yarn

After installing the dependencies, you must also build them so that the typescript is compiled down to javascript:

yarn build

Unit tests

All tests are run in parallel using lerna:

yarn test

When you want to run tests only for packages that have changed since master (or any other branch) you can run yarn lerna run test --parallel --since master

Integration Tests

Running the integration tests

The integration tests first require bringing up the Optimism stack. This is done via a Docker Compose network. For better performance, we also recommend enabling Docker BuildKit

cd ops
export COMPOSE_DOCKER_CLI_BUILD=1
export DOCKER_BUILDKIT=1
docker-compose build
docker-compose up -d
cd ../integration-tests
yarn build:integration
yarn test:integration

Locally testing and re-building specific services

If you want to make changes to any of the containers, you'll have to bring one down, rebuild it, and then bring it back up.

For example, if you make a change in l2geth:

cd ops
docker-compose stop -- l2geth
docker-compose build -- l2geth
docker-compose start l2geth

For the typescript services, you'll need to rebuild the builder so that the compiled files are re-generated, and then your service, e.g. for the batch submitter

cd ops
docker-compose stop -- batch_submitter
docker-compose build -- builder batch_submitter
docker-compose start batch_submitter

By default, the docker-compose up command will show logs from all services, and that can be hard to filter through. In order to view the logs from a specific service, you can run:

docker-compose logs --follow <service name>

About

Monorepo implementing the Optimistic Ethereum protocol

https://optimism.io


Languages

Language:Go 75.7%Language:TypeScript 8.7%Language:C 5.5%Language:Solidity 4.4%Language:JavaScript 3.7%Language:Assembly 0.5%Language:Java 0.3%Language:Sage 0.2%Language:M4 0.2%Language:NSIS 0.2%Language:Shell 0.1%Language:Makefile 0.1%Language:HTML 0.1%Language:Python 0.1%Language:C++ 0.1%Language:Ruby 0.0%Language:Dockerfile 0.0%