Skip to content

Commit 7f0c6a4

Browse files
fix: gateway instructions (#421)
Adds the complete steps for the gateway setup guide
1 parent 1848afb commit 7f0c6a4

File tree

1 file changed

+40
-3
lines changed

1 file changed

+40
-3
lines changed

content/10.zk-stack/20.running/25.gateway-settlement-layer.md

Lines changed: 40 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,40 @@ enhance **interoperability**, provide **proof aggregation**, and offer **cost ef
1111
## Running ZKsync Gateway locally
1212

1313
::callout{icon="i-heroicons-exclamation-triangle" color="amber"}
14-
This guide assumes you already have an ecosystem with a ZKsync chain settling on L1 [as detailed in the quickstart](./quickstart).
14+
This guide assumes you already have `zkstackup` and the required system dependencies installed [as detailed in the quickstart](./quickstart).
1515
::
1616

17+
1. Update `foundry-zksync` to use the version from commit `27360d4c8`:
18+
19+
```bash
20+
foundryup-zksync -C 27360d4c8
21+
```
22+
23+
1. Clone the `zksync-era` repository,
24+
update the `contracts` submodule,
25+
install the latest version of `zkstack`:
26+
27+
```bash
28+
git clone https://github.com/matter-labs/zksync-era.git
29+
cd zksync-era
30+
git submodule update --init --recursive
31+
zkstackup --local
32+
zkstack dev clean all
33+
```
34+
35+
1. Start the containers and initialize the ecosystem:
36+
37+
```bash
38+
zkstack containers
39+
zkstack ecosystem init --deploy-paymaster --deploy-erc20 \
40+
--deploy-ecosystem --l1-rpc-url=http://localhost:8545 \
41+
--server-db-url=postgres://postgres:notsecurepassword@localhost:5432 \
42+
--server-db-name=zksync_server_localhost_era \
43+
--ignore-prerequisites --observability=false \
44+
--chain era \
45+
--update-submodules false
46+
```
47+
1748
1. Create a new ZKsync chain that will become your local gateway chain:
1849

1950
```bash
@@ -53,20 +84,26 @@ This guide assumes you already have an ecosystem with a ZKsync chain settling on
5384
```bash
5485
mkdir zlogs
5586
zkstack server --ignore-prerequisites --chain gateway &> ./zlogs/gateway.log &
87+
zkstack server wait --ignore-prerequisites --verbose --chain gateway
5688
```
5789

5890
1. Migrate existing ZKsync chain to settle on `gateway`:
5991

6092
```bash
61-
zkstack chain gateway migrate-to-gateway --chain YOUR_CHAIN_NAME --gateway-chain-name gateway
93+
zkstack chain gateway migrate-to-gateway --chain era --gateway-chain-name gateway
6294
```
6395

6496
1. Start your chain server:
6597

6698
```bash
67-
zkstack server --ignore-prerequisites --chain YOUR_CHAIN &> ./era.log &
99+
zkstack server --ignore-prerequisites --chain era &> ./era.log &
68100
```
69101

102+
Your chains will be running on the following ports:
103+
104+
- Era (271): `localhost:3050`
105+
- Gateway (506): `localhost:3150`
106+
70107
## Migrate existing ZKsync chain to Gateway on testnet or mainnet
71108

72109
ZKsync chains can be migrated to use ZKsync Gateway as their settlement layer by updating the chain's metadata and

0 commit comments

Comments
 (0)