A dapp frontend template for Vara Network inspired by Scaffold-ETH 2
# install deps
bun i
# start local dev server on http://127.0.0.1:5173
bun dev
# build static assets at ./dist
bun run buildAdd your custom pages under ./src/pages/, and change the route at ./src/App.jsx
Three example apps are included in this template:
- Chat: a simple chatbot interface for AI agents
- Counter: frontend for counter program
- DNS: frontend for dns program
To add your own program and generate the client code from IDL, create a new js file ./src/lib/<app>.js:
export const PROGRAM_ID =
"0x...";
export const IDL = `...`;
And you'll be able to reference it in the useSails hook, which generates the dapp UI automatically
Example usage:
src/pages/DNS.jsx:import { IDL, PROGRAM_ID } from "../lib/dns";
src/pages/DNS.jsx: const { sails, loading, error } = useSails(IDL, PROGRAM_ID);
MIT