Skip to content

Commit a4c2415

Browse files
committed
Adding Type-1 prover docs
2 parents 855115d + 374482b commit a4c2415

17 files changed

+415
-1540
lines changed

docs/cdk/get-started/connect-testnet.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,20 @@ The [CDK Stavanger testnet](https://polygon.technology/cdk-stavanger-testnet) is
77
- Bridge assets from Sepolia to Stavanger using the bridge.
88
- Confirm your transactions with the block explorer.
99

10-
| Use case | URL | Usage |
10+
!!! tips "Setting up your wallet"
11+
- Click **Connect wallet** on the [Stavanger explorer](https://sn2-stavanger-blockscout.eu-north-2.gateway.fm/) to auto set up your wallet.
12+
- Check out the latest on [setting up a custom network with MetaMask](https://support.metamask.io/hc/en-us/articles/360043227612-How-to-add-a-custom-network-RPC).
13+
14+
### Stavanger network details
15+
16+
| Name | Value | Usage |
1117
| ------- | ----------- | --------- |
1218
| JSON RPC | https://sn2-stavanger-rpc.eu-north-2.gateway.fm | Make remote procedure calls to the CDK testnet. |
13-
| Faucet | https://sn2-stavanger-faucet.eu-north-2.gateway.fm | Get testnet tokens. |
14-
| Bridge | https://sn2-stavanger-bridge.eu-north-2.gateway.fm | Bridge tokens from Sepolia. |
15-
| Block explorer | https://sn2-stavanger-blockscout.eu-north-2.gateway.fm | Confirm transactions with the explorer. |
19+
| Faucet | https://sn2-stavanger-faucet.eu-north-2.gateway.fm | Get testnet ETH |
20+
| Bridge | https://sn2-stavanger-bridge.eu-north-2.gateway.fm | Bridge tokens from Sepolia |
21+
| Block explorer | https://sn2-stavanger-blockscout.eu-north-2.gateway.fm | Confirm transactions with the explorer |
22+
| Chain id | 686669576 | Chain identification value |
23+
| Currency | ETH | Test token |
24+
25+
26+

docs/cdk/get-started/deploy-rollup/activate-forced-transactions.md

Lines changed: 0 additions & 98 deletions
This file was deleted.
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
## Set up
2+
3+
1. Create some working directories.
4+
5+
!!! info
6+
The following commands take care of directory placements where non-obvious.
7+
8+
```sh
9+
mkdir -p ~/zkevm/data/{statedb,pooldb} ~/zkevm/zkevm-config ~/zkevm/zkevm-node
10+
```
11+
12+
2. Populate the directories by fetching data from latest mainnet node release.
13+
14+
```sh
15+
export ZKEVM_NET="mainnet"
16+
export ZKEVM_DIR="zkevm"
17+
curl -L https://github.com/0xPolygonHermez/zkevm-node/releases/latest/download/$ZKEVM_NET.zip > $ZKEVM_NET.zip && unzip -o $ZKEVM_NET.zip -d $ZKEVM_DIR && rm $ZKEVM_NET.zip
18+
```
19+
20+
3. Go to the `zkevm/zkevm-config` directory and create an `.env` file and open it for editing.
21+
22+
```sh
23+
cd ../zkevm-config/
24+
nano .env
25+
```
26+
27+
4. In the `.env` file, set the following:
28+
29+
```sh
30+
ZKEVM_NODE_ETHERMAN_URL = "" # set valid Goerli RPC endpoint
31+
ZKEVM_NODE_STATEDB_DATA_DIR = "~/zkevm/data/statedb"
32+
ZKEVM_NODE_POOLDB_DATA_DIR = "~/zkevm/data/pooldb"
33+
```
34+
35+
!!! warning
36+
- You may have to hardcode these variables into the `mainnet/docker-compose.yaml` file.
37+
- Also, the `ZKEVM_NETWORK` variable which you can set to `mainnet`.
38+
- Note, there are more than one references to hardcode in.
39+
40+
## Approve MATIC token for sequencer
41+
42+
1. Launch a Hardhat console connected to the Goerli network.
43+
44+
```sh
45+
cd ~/zkevm-contracts
46+
npx hardhat console --network goerli
47+
```
48+
49+
2. Add the missing data as directed and copy/paste the following code into the open console.
50+
51+
```js
52+
const provider = ethers.getDefaultProvider("<GOERLI_RPC_NODE>"); // set Goerli RPC node
53+
const privateKey = "<TRUSTED_SEQUENCER_PK>"; // from wallets.txt
54+
const wallet = new ethers.Wallet(privateKey, provider);
55+
56+
const maticTokenFactory = await ethers.getContractFactory(
57+
"ERC20PermitMock",
58+
provider
59+
);
60+
maticTokenContract = maticTokenFactory.attach("<maticTokenAddress>"); // from ~/zkevm-contracts/deployments/deploy_output.json
61+
maticTokenContractWallet = maticTokenContract.connect(wallet);
62+
await maticTokenContractWallet.approve("<polygonZkEVMAddress>", ethers.utils.parseEther("100.0")); // from ~/zkevm-contracts/deployments/deploy_output.json
63+
```
64+
65+
## Configure genesis
66+
67+
1. Copy the `genesis.json` file into the appropriate location.
68+
69+
```sh
70+
cp ~/zkevm-contracts/deployment/genesis.json ~/zkevm/mainnet/config/environments/mainnet/public.genesis.config.json
71+
```
72+
73+
2. Copy/paste the json below to the head of the `public.genesis.config.json` file inputting the data from `~/zkevm/zkevm-contracts/deployments/deploy_output.json`.
74+
75+
!!! important
76+
The `genesisBlockNumber` is called `deploymentBlockNumber` in `deploy_output.json`.
77+
78+
```json
79+
"l1Config" : {
80+
"chainId": 5,
81+
"polygonZkEVMAddress": "",
82+
"maticTokenAddress": "",
83+
"polygonZkEVMGlobalExitRootAddress": ""
84+
},
85+
"genesisBlockNumber": <number-here>,
86+
```
87+
88+
## Update node config
89+
90+
Add the missing parameters in the `~/zkevm/mainnet/config/environments/mainnet/public.node.config.toml` file.
91+
92+
!!! warning
93+
Rename the file if necessary.
94+
95+
- `ApiKey` # for Etherscan
96+
- `URL` # for Goerli node, under [ETHERMAN]
97+
98+
## Add wallet keystores
99+
100+
Copy/paste the keystore value from `wallets.txt` for the sequencer and aggregator respectively into the following files.
101+
102+
```sh
103+
# paste only the keystore value from wallets.txt in each respective file
104+
nano ~/zkevm/zkevm-config/sequencer.keystore
105+
nano ~/zkevm/zkevm-config/aggregator.keystore
106+
```

0 commit comments

Comments
 (0)