Note
Running pnpm i
and pnpm build
at the root level in previous steps will have built the webapp for you already.
The Web App uses a Postgres database to store the upgrade data. You can run a Postgres database through Docker running our provided script in the webapp folder:
./scripts/init_db.sh
Before running the Web App, you need to set up the environment keys:
export ALLOW_INDEXING=false
export ALLOW_PRIVATE_ACTIONS="0x"
export DATABASE_URL=postgresql://user:password@localhost:5432/webapp
export ETH_NETWORK="mainnet"
export L1_RPC_URL=":placeholder:"
export LOG_LEVEL=info
export NODE_ENV=development
export TALLY_BASE_URL="https://tally.xyz/gov/zksync"
export UPGRADE_HANDLER_ADDRESS="0x"
export WALLET_CONNECT_PROJECT_ID=:placeholder:
export ZK_ADMIN_ADDRESS="0x"
export ZK_GOV_OPS_GOVERNOR_ADDRESS="0x"
export ZK_PROTOCOL_GOVERNOR_ADDRESS="0x"
export ZK_TOKEN_GOVERNOR_ADDRESS="0x"
ALLOW_INDEXING
: If set tofalse
, the Web App will add headers to prevent indexing by search engines.ALLOW_PRIVATE_ACTIONS
: If true the app allow to do emergency upgrades, freezes and vetos.DATABASE_URL
: The URL to the Postgres database.ETH_NETWORK
: The Ethereum network the Web App is running on, can bemainnet
,sepolia
orlocal
. Local is for development only.L1_RPC_URL
: The RPC URL for the L1 network. A good option with a nice free tier is Tenderly.LOG_LEVEL
: The log level for the Web App, can beinfo
,debug
,warn
,error
.NODE_ENV
: The environment the Web App is running in, can beproduction
,development
,test
.TALLY_BASE_URL
: Tally url for zksync. For example, in mainnet ishttps://tally.xyz/gov/zksync
UPGRADE_HANDLER_ADDRESS
: Address for theProtocolUpgradeHandler
contract.WALLET_CONNECT_PROJECT_ID
: The WalletConnect project ID. You can get one by registering at WalletConnect.ZK_ADMIN_ADDRESS
: List of addresses that can archive proposalsZK_GOV_OPS_GOVERNOR_ADDRESS
: Address for gov ops governor (l2).ZK_PROTOCOL_GOVERNOR_ADDRESS
: Address for protocol governor (l2).ZK_TOKEN_GOVERNOR_ADDRESS
: Address for token governor (l2).
To start using the web app, simply build it and start it:
pnpm install
pnpm build
pnpm start
In order to run the Web App in development mode, you can use the following commands:
pnpm dev
- Component level - verifies logic of react components
- Uses
vitest
testing-library
- End-to-End - hosts the site locally and verifies via browser interactions
- Uses
vitest
playwright
remix
Included is a Dockerfile for making images. A sample stack has been provided, but should be customized for production usecases.
First, build the Docker image using the following command:
pnpm docker:build
Then run the app with:
pnpm docker:run
Tip
Make sure your webapp/.env
file exists and has the values you expect!