By default, this dApp runs on a local testnet, of which parameters are defined in .env, .env.local (priorized when developing) or .env.production (used in npm run build). The local testnet needs to be ran separately, but can be left to run without restarts.
- Clone the repo
vanilladefi/contracts: https://github.com/vanilladefi/contracts - Run
npm installinside the newly cloned contracts repo - Run
cp .secrets.env.example .secrets.envand edit the API_KEYs into.secrets.env - Run
npm run node:mainnet-fork. This runs a local Hardhat testnet inlocalhost:8545with chainid 1 , creates test accounts with 10k ETH each and deploys the Vanilla contracts automatically. - Change the chainid setting in Metamask's
localhost:8545-network, from 1337 to 1
To use the test accounts in Metamask, you need to import one of the accounts by its private key to a wallet of your choosing. These accounts will be the same on every run, so you only need to do this once per machine.
- Run
npm run node:test-accountsto get a list of Hardhat test-accounts - Pick one account, and import it into Metamask by copying the private key
npm install
npm run dev- Create a
env.localwithNEXT_PUBLIC_CHAIN_ID=1 npm run dev
The app should be now accessible at localhost:3000.