Skip to content

Commit d96f68d

Browse files
commiting to ease warnings
1 parent 2a2a230 commit d96f68d

File tree

9 files changed

+1641
-1
lines changed

9 files changed

+1641
-1
lines changed
Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
2+
Continue with the **sixth step** of this deployment-guide where you activate forced transactions, as well as bridging and claiming assets.
3+
4+
## Activate forced transactions
5+
6+
You can check out [this](../../architecture/protocol/malfunction-resistance/sequencer-resistance.md) document to learn more about forced batches of transactions.
7+
8+
```bash
9+
cd ~/zkevm-contracts
10+
npx hardhat console --network goerli
11+
```
12+
13+
```js
14+
const zkevm = await ethers.getContractFactory("PolygonZkEVM");
15+
const zkevmContract = zkevm.attach("_polygonZkEVMAddress_"); // From ~/zkevm-contracts/deployments/goerli_*/deploy_output.json polygonZkEVMAddress
16+
17+
const provider = ethers.getDefaultProvider(""); // set Geth Goerli RPC endpoint
18+
const privateKey = ""; // Deployment Address prvkey from wallet.txt
19+
const wallet = new ethers.Wallet(privateKey, provider);
20+
21+
const zkevmContractWallet = zkevm.connect(wallet);
22+
23+
await zkevmContract.activateForceBatches();
24+
```
25+
26+
## Provide L1 ETH to the bridge
27+
28+
Run the below commands in CLI to **create a bridge transaction** and send L1 Ether to the zkEVM Bridge.
29+
30+
```bash
31+
mkdir -p ~/zkevm/initial-bridge
32+
cd zkevm/initial-bridge
33+
34+
wget https://raw.githubusercontent.com/0xPolygonHermez/zkevm-bridge-service/develop/test/scripts/deposit/main.go
35+
vim main.go
36+
```
37+
38+
Populate the `main.go` file with following variables:
39+
40+
```go
41+
l1BridgeAddr = "" // ~/zkevm-contracts/deployments/goerli_*/deploy_output.json: polygonZkEVMBridgeAddress
42+
43+
l1AccHexAddress = "" // ~/zkevm-contracts/wallets.txt: sequencer address
44+
l1AccHexPrivateKey = "" // ~/zkevm-contracts/wallets.txt: sequencer prvkey
45+
l1NetworkURL = "http://X.X.X.X:8545" // set your public IP
46+
```
47+
48+
Initialize a new Go module with the module path `example.com/deposit`.
49+
50+
```bash
51+
go mod init example.com/deposit
52+
go mod tidy
53+
go run main.go
54+
55+
# 2023-06-07T06:29:14.211Z INFO initial-bridge/main.go:46 Success! {"pid": 776268, "version": "v0.1.0"}
56+
```
57+
58+
## Claim your L2 zkETH
59+
60+
After sending your first bridge transaction to your zkEVM network, create a **forced claim to get the zkETH in L2**.
61+
62+
```bash
63+
mkdir -p ~/zkevm/initial-claim
64+
cd ~/zkevm/initial-claim
65+
66+
wget https://raw.githubusercontent.com/0xPolygonHermez/zkevm-bridge-service/develop/test/scripts/initialClaim/main.go
67+
vim main.go
68+
```
69+
70+
Open `main.go` and update the following parameters:
71+
72+
```go
73+
const (
74+
l2BridgeAddr = "" // ~/zkevm-contracts/deployments/goerli_*/deploy_output.json: polygonZkEVMBridgeAddress
75+
zkevmAddr = "" // ~/zkevm-contracts/deployments/goerli_*/deploy_output.json: polygonZkEVMAddress
76+
77+
accHexAddress = "" // ~/zkevm-contracts/wallets.txt: sequencer address
78+
accHexPrivateKey = "" // ~/zkevm-contracts/wallets.txt: sequencer prvkey
79+
l1NetworkURL = "http://X.X.X.X:8545" // public IP
80+
l2NetworkURL = "http://X.X.X.X:8123" // public IP
81+
bridgeURL = "http://X.X.X.X:8080" // public IP
82+
83+
l2GasLimit = 1000000
84+
85+
mtHeight = 32
86+
miningTimeout = 180
87+
)
88+
```
89+
90+
Time to execute the claim transaction:
91+
92+
```bash
93+
go mod init example.com/claim
94+
go mod tidy
95+
go get github.com/0xPolygonHermez/zkevm-bridge-service@4e1ca558144cac00fe0762329aaf7b3e9482b57a
96+
go run main.go
97+
98+
# 2023-06-07T06:41:50.731Z INFO initial-claim/main.go:196 Success!!!! {"pid": 783804, "version": "v0.1.0"}
99+
```
100+
101+
!!!congratulations
102+
Congratulations on reaching this far in setting up your own zkEVM network.
103+
**Your network is live on the Testnet** and you can send transactions to verify the same. Also, we have provided a Goerli full node setup guide below in case you are looking for one.

0 commit comments

Comments
 (0)