Skip to content

Latest commit

 

History

History
114 lines (65 loc) · 4.21 KB

build-from-source.md

File metadata and controls

114 lines (65 loc) · 4.21 KB

Build components

This doc introduces how to build all components from source code.

Architecture

For the overall architecture, please refer to mach-avs#architecture

BLS Signature Aggregation Mode

The following components is required

  1. Run as an operator

    1. mach-operator-node
    2. mach-operator-verifier
  2. Run whole system in local testnet

    1. mach-operator-node
    2. mach-operator-verifier
    3. mach-operator-aggregator
    4. mach-avs-contracts

ZK Proof Mode

Comming soon

Code Repositories

  1. mach-avs: https://github.com/alt-research/mach-avs

    In this repo, we have following components:

    1. mach-operator-node

    2. mach-operator-aggregator

      Notice: mach-operator-aggregator will migrate to other respository soon.

    3. mach-avs-contracts

Compile

  1. mach-avs

    For mach-avs, it is mainly written in solidity and go.

    For the steps to compile this repo, please check mach-avs#build-and-run

Run

Supported technology stack:

Opstack(Optimism) Orbit(arbitrum)
BLS Signature Aggregation Mode supported comming soon
ZK Proof Mode comming soon not supported

OP Stack (BLS Signature Aggregation Mode)

Run as Operator

For OP Stack based rollup, user needs to prepare the genesis.json file and the endpoint of this rollup.

  1. genesis.json:

    1. If this chain is an "op superchain", and has existed in superchain-registry, you can use the latest to op-geth (op-geth/releases) to get the genesis.json file.

      ./geth  dumpgenesis  --op-network=<network name, e.g. op-mainnet>  > genesis.json
    2. If this rollup is not part of OP Superchain or cannot be located in superchain-registry, please ask the project team for help to get the genesis.json file

    3. For op-mach, this genesis.json does not need to field alloc, thus, if the field is empty in this file is also ok.

  2. endpoint of this rollup:

    1. The chain id from this endpoint must need to match the chain id in the genesis.json. i.e., This endpoint must belong to this rollup.

    2. We highly recommend that you run op-mach and this rollup fullnode within the same network as it reduces network latency, especially when you set safe or strict in the config.toml file for op-mach. (refer to mach#configuration)

Prepare
  1. mach-operator-node: mach-operator can be found in the mach-avs repo.
Run
  1. Run mach-operator-verifier

    1. To prepare the config.toml, please refer to mach#configuration

      Please notice the url must be pointing to the RPC endpoint of this rollup.

    2. Run mach-operator-verifier please refer to the docker-compose file in ethereum/mach-avs/optimism/docker-compose.yml.

  2. Run mach-operator-node

    Please refer to the doc: RunOperator

Run the whole system in local testnet

For the setup of operator, It is the same process as "Run as Operator"

Before you run the operator, you need to deploy the contract and run tthe aggregator.

  1. Deploy the contracts in local network:

    Script For Testing AVS Contracts

  2. Run the aggregator:

    RunAggregator

  3. Run mach-operator-verifier is same as above

  4. Run mach-operator-node

    Please set the corrent the aggregator endpoint and related info from 1 step.