This guide will walk you through setting up, building, and deploying the Liquity application locally.
Before you begin, ensure you have the following tools installed:
Clone the repository:
git clone git@github.com:liquity/bold.git
cd boldInstall the npm dependencies for all the packages in the repo:
pnpm installIf you are developing contracts, install the Foundry dependencies:
cd contracts
forge installTo build the app for production, start by copying the .env file (provided as an example) to .env.local:
cd frontend/app
cp .env .env.localEdit the newly created .env.local to set the app environment variables. The NEXT_PUBLIC_SUBGRAPH_URL need to be set manually. You might want to create a GraphSeer account to get an API key.
Optional: you can generate a set of contract addresses for the .env.local file by running the following command:
cd contracts
# Replace the address file with the one you want to use
pnpm tsx ./utils/deployment-manifest-to-app-env.ts ./addresses/11155111.jsonThis is useful if you want to use a different set of contracts than the ones provided in the default .env file.
You can now build the app for production:
cd frontend/app
pnpm build-deps # only needed the first time
pnpm buildThe app will be built in the out/ directory which can be deployed to any static hosting service.
Note: your server must be configured to serve .html files by default. If you are using Vercel, this is done automatically. If your server does not support this, you can build the app with a separate directory for each route:
NEXT_TRAILING_SLASH=1 pnpm buildFollow these steps to set up your local development environment:
# In a separate terminal window
anvilcd contracts
./deploy local --open-demo-troves # Creates test troves for first 8 anvil accountspnpm tsx utils/deployment-manifest-to-app-env.ts deployment-manifest.jsonNote: Save the output - you’ll need these addresses for the next step.
cd frontend/app
cp .env .env.localEdit .env.local:
- Uncomment the Hardhat / Anvil section
- Add the contract addresses from the previous step
pnpm devYour app should now be running at https://localhost:3000
For more detailed information about app development, refer to the app README.