Skip to content

Commit add2d52

Browse files
Merge pull request 0xPolygon#285 from 0xPolygon/cdk/agglayer-howto
CDK: AggLayer how-to
2 parents 9db9159 + 4ac67a5 commit add2d52

File tree

3 files changed

+81
-1
lines changed

3 files changed

+81
-1
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ node_modules/
99
.DS_Store
1010
**/.DS_Store
1111
*.iml
12+
temp_dir/
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
Polygon AggLayer is a web service that receives zero-knowledge proofs from different CDK chains and checks their soundness before sending the proof to L1 for verification.
2+
3+
!!! warning
4+
- The AggLayer is in development and subject to architectural changes.
5+
- The code is still being audited.
6+
7+
## Prerequisites
8+
9+
Make sure you have the following software installations.
10+
11+
- [Docker](https://docs.docker.com/engine/install/)
12+
- [Docker Compose](https://docs.docker.com/compose/install/)
13+
- [Golang](https://go.dev/doc/install)
14+
- [GCloud cli](https://cloud.google.com/sdk/docs/install) - production only.
15+
16+
### Clone the repo.
17+
18+
```sh
19+
git clone https://github.com/0xPolygon/agglayer.git
20+
cd agglayer/
21+
```
22+
23+
## Set up and installation
24+
25+
### Local
26+
27+
Run the following command to bring up a zkEVM node, a prover, and a mock L1 network.
28+
29+
```sh
30+
make run-docker
31+
```
32+
33+
### Production
34+
35+
!!! warning
36+
- Currently only one instance of the AggLayer can run at one time.
37+
- The AggLayer should, therefore, automatically start in the case of failure using a containerized setup or an OS level service manager/monitoring system.
38+
39+
Install the Golang dependencies.
40+
41+
```sh
42+
go install .
43+
```
44+
45+
#### Key-signing configurations
46+
47+
Install polygon-cli:
48+
49+
```sh
50+
go install github.com/maticnetwork/polygon-cli@latest
51+
```
52+
53+
Create a new signature:
54+
55+
```sh
56+
polygon-cli signer create --kms GCP --gcp-project-id gcp-project --key-id mykey-tmp
57+
```
58+
59+
Set up ADC in GCloud:
60+
61+
```sh
62+
gcloud auth application-default login
63+
```
64+
65+
In the `../agglayer/docker/data/agglayer.toml` file, add the `KMSKeyName` from GCloud.
66+
67+
## Setting up the AggLayer
68+
69+
Each CDK chain requires a corresponding RPC node configuration that is synced with the target CDK. This node checks the state root after executions of L2 batches.
70+
71+
!!! info "Storage recommendations"
72+
- Use a durable HA PostgresDB for storage; ideally AWS Aurora PostgreSQL or Cloud SQL for PostgreSQL in GCP.
73+
74+
Add the chain configurations to the `../agglayer/docker/data/agglayer.toml` file by amending the following details to add the required chain(s).
75+
76+
* Configure `[FullNodeRPCs]` to point to the corresponding L2 full node.
77+
* Configure `[L1]` to point to the corresponding L1 chain.
78+
* Configure the `[DB]` section with the managed database details.

docs/cdk/resources/third-party-guides.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ hide:
33
- toc
44
---
55

6-
This page is a catalogue of third-party and partner quick starts and guides that explain how to spin up and deploy validium and rollup CDK stacks, and more.
6+
This page links to full guides that some of [our solution providers](https://ecosystem.polygon.technology/spn/explore/?search=&competency=All&chain=All) have developed, including quick starts and guides that explain how to spin up and deploy validium and rollup CDK stacks.
77

88
<div class="grid-container">
99
<div class="grid-item">
@@ -26,3 +26,4 @@ This page is a catalogue of third-party and partner quick starts and guides that
2626
</div>
2727
</div>
2828

29+
Check out the [solution provider page]((https://ecosystem.polygon.technology/spn/explore/?search=&competency=All&chain=All)) to see more info on our partners.

0 commit comments

Comments
 (0)