Using a local ZK Chain
Funding accounts
The first step to start interacting with your ZK chain is to fund an account (or a few). This means you need some funds on the base layer.
During the zkstack ecosystem create
configuration, you have a choice of what base layer to deploy the ZK chain onto:
a local reth node, or an Ethereum network (e.g., Sepolia).
Base layer is the local reth node
If you choose to deploy on local reth node, you will have a set of addresses that have 100 ETH each. You can find the list of rich wallets on GitHub in the matter-labs/local-setup project and use these addresses to deposit into your ZK chain via the bridge.
Base layer is an Ethereum network (e.g., Sepolia)
If you choose to deploy on an Ethereum network (e.g., Sepolia), you need to have an account on the base layer with ETH. You can use the deployer, governor, or operator wallets setup during the deployment process, or any other wallet with funds, to deposit into your ZK chain via the bridge.
Once you have the accounts with funds on the L1 base layer, you can do a deposit via the bridge to your ZK chain, and start interacting with your ZK chain using the L2 funded account.
Using your chain RPC
Your server contains both HTTPS as well as WebSocket (WS) RPC services that are fully web3 compatible (and contain some extra ZK Stack functionalities). Learn more on the API reference page.
Using zksync-cli
ZKsync CLI allows you to easily interact and develop applications on your ZK chain. When executing any command with ZKsync CLI, you can specify RPC urls for both L1 and L2. Your local server contains RPCs for both. An example deposit command via the bridge would look like:
zksync-cli bridge deposit --rpc=http://localhost:3050 --l1-rpc=http://localhost:8545
You can save the chain configurations for your ZK chain with ZKsync CLI by adding a new configuration.
Using the Portal
The Portal module is a web-app that allows you to:
- Bridge & transfer tokens to your ZK chain.
- View balances.
- Add contacts for quick and easy access.
Once you have at least one chain initialized, you can run the portal app locally:
zkstack portal
This command will start the dockerized portal app using configuration from apps/portal.config.json
file inside your
ecosystem directory. You can edit this file to configure the portal app if needed.
You can now navigate to the portal web-app. By default, portal frontend starts on
http://localhost:3030
, you can configure the port in apps.yaml
file.
Using a Block Explorer
A block explorer is a web-app that lets you view and inspect transactions, blocks, contracts and more. A free open source block explorer is available for your ZK chain.
First, each chain should be initialized:
zkstack explorer init
This command creates a database to store explorer data and generates a docker compose file with explorer services
(explorer-docker-compose.yml
).
Next, for each chain you want to have an explorer, you need to start its backend services:
zkstack explorer backend --chain <chain_name>
This command uses previously created docker compose file to start the services (api, data fetcher, worker) required for the explorer.
Finally, you can run the explorer app:
zkstack explorer run
This command will start the dockerized explorer app using configuration from apps/explorer.config.json
file inside
your ecosystem directory. You can edit this file to configure the app if needed.
You can now navigate to the explorer web-app. By default, explorer frontend starts on
http://localhost:3010
, you can configure the port in apps.yaml
file.