mirror of
https://github.com/scroll-tech/scroll.git
synced 2026-01-14 08:28:02 -05:00
76 lines
4.1 KiB
Markdown
76 lines
4.1 KiB
Markdown
# Scroll Monorepo
|
|
|
|
[](https://github.com/scroll-tech/scroll/actions/workflows/rollup.yml)
|
|
[](https://github.com/scroll-tech/scroll/actions/workflows/contracts.yml)
|
|
[](https://github.com/scroll-tech/scroll/actions/workflows/bridge_history_api.yml)
|
|
[](https://github.com/scroll-tech/scroll/actions/workflows/coordinator.yml)
|
|
[](https://github.com/scroll-tech/scroll/actions/workflows/prover.yml)
|
|
[](https://github.com/scroll-tech/scroll/actions/workflows/integration.yml)
|
|
[](https://codecov.io/gh/scroll-tech/scroll)
|
|
|
|
<a href="https://scroll.io">Scroll</a> is a zkRollup Layer 2 dedicated to enhance Ethereum scalability through a bytecode-equivalent [zkEVM](https://github.com/scroll-tech/zkevm-circuits) circuit. This monorepo encompasses essential infrastructure components of the Scroll protocol. It contains the L1 and L2 contracts, the rollup node, the prover client, and the prover coordinator.
|
|
|
|
## Directory Structure
|
|
|
|
<pre>
|
|
├── <a href="./bridge-history-api/">bridge-history-api</a>: Bridge history service that collects deposit and withdraw events from both L1 and L2 chains and generates withdrawal proofs
|
|
├── <a href="./common/">common</a>: Common libraries and types
|
|
├── <a href="./coordinator/">coordinator</a>: Prover coordinator service that dispatches proving tasks to provers
|
|
├── <a href="./database">database</a>: Database client and schema definition
|
|
├── <a href="./src">l2geth</a>: Scroll execution node
|
|
├── <a href="./prover">prover</a>: Prover client that runs proof generation for zkEVM circuit and aggregation circuit
|
|
├── <a href="./rollup">rollup</a>: Rollup-related services
|
|
├── <a href="./rpc-gateway">rpc-gateway</a>: RPC gateway external repo
|
|
└── <a href="./tests">tests</a>: Integration tests
|
|
</pre>
|
|
|
|
## Contributing
|
|
|
|
We welcome community contributions to this repository. Before you submit any issues or PRs, please read the [Code of Conduct](CODE_OF_CONDUCT.md) and the [Contribution Guideline](CONTRIBUTING.md).
|
|
|
|
## Prerequisites
|
|
+ Go 1.21
|
|
+ Rust (for version, see [rust-toolchain](./common/libzkp/impl/rust-toolchain))
|
|
+ Hardhat / Foundry
|
|
+ Docker
|
|
|
|
To run the tests, it is essential to first pull or build the required Docker images. Execute the following commands in the root directory of the repository to do this:
|
|
|
|
```bash
|
|
docker pull postgres
|
|
make dev_docker
|
|
```
|
|
|
|
## Unit Tests
|
|
|
|
Run the tests using the following commands:
|
|
|
|
```bash
|
|
export LIBSCROLL_ZSTD_VERSION=v0.0.0-rc0-ubuntu20.04
|
|
export SCROLL_LIB_PATH=/scroll/lib
|
|
|
|
sudo mkdir -p $SCROLL_LIB_PATH
|
|
|
|
sudo wget -O $SCROLL_LIB_PATH/libzktrie.so https://github.com/scroll-tech/da-codec/releases/download/$LIBSCROLL_ZSTD_VERSION/libzktrie.so
|
|
sudo wget -O $SCROLL_LIB_PATH/libscroll_zstd.so https://github.com/scroll-tech/da-codec/releases/download/$LIBSCROLL_ZSTD_VERSION/libscroll_zstd.so
|
|
|
|
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SCROLL_LIB_PATH
|
|
export CGO_LDFLAGS="-L$SCROLL_LIB_PATH -Wl,-rpath,$SCROLL_LIB_PATH"
|
|
|
|
go test -v -race -covermode=atomic scroll-tech/rollup/...
|
|
|
|
go test -tags="mock_verifier" -v -race -covermode=atomic scroll-tech/coordinator/...
|
|
go test -v -race -covermode=atomic scroll-tech/database/...
|
|
go test -v -race -covermode=atomic scroll-tech/common/...
|
|
```
|
|
|
|
## Testing Contracts
|
|
|
|
You can find the unit tests in [`contracts/src/test/`](/contracts/src/test/), and integration tests in [`contracts/integration-test/`](/contracts/integration-test/).
|
|
|
|
See [`contracts`](/contracts) for more details on the contracts.
|
|
|
|
## License
|
|
|
|
Scroll Monorepo is licensed under the [MIT](./LICENSE) license.
|