I made this when I was very new to blockchain development and programming in general. Drizzle sucks (imo) so instead I recommend useDApp. I also recommend you look at Hardhat as an alternative to Truffle. I've kept this repository in case someone still wants to use it but mainly just since I don't like deleting things.
Note: this is not an actual truffle box. You can not use truffle unbox to download it
This also includes:
- Prettier support for solidity
- gh-pages
- @drizzle/react-components types
- xDai and Ganache support
- Example greeter contract
The greeter contract is live on xDai and viewable here
- Press the green Use this template button (next to the code download button) and create a repository
- Download your repository onto your computer
- Run
npm install - Create a
.envfile in the root directory and writeMNEMONIC=YOUR MNEMONIC HERE- For example,
MNEMONIC=word1 word2 word3 word4 you get the point - This is only necessary if you are deploying to a non-local network
- For example,
- Change the package.json name to your repo name and the author name to your github username
If you want to run the app, setup Ganache and run the following:
truffle migratenpm run dev
Then go to localhost:3000 in your browser
This is everything I did to get this setup
npx create-next-app --example with-chakra-ui-typescripttruffle init- delete test folder
- Change truffle-config.js:
- Add
contracts_build_directory: "./src/artifacts/", - Uncomment the development network and change the port to
7545
- Add
- change
buildscript in package.json tonext build && next export npm install --save-dev prettier prettier-plugin-soliditynpm install @drizzle/store @drizzle/react-plugin @drizzle/react-components- Changed/added a bunch of the default example files
npm install @truffle/hdwallet-provider dotenv- Add xDai support
npm i gh-pages