Simple decentralized application (dApp) demonstration.
Smart contract is under the blockchain folder and created with Hardhat.
Frontend is under the client folder and created with dApp CRA Template.
You can create your own frontend by simply running the following command in your terminal:
npx create-react-app mydapp --template @huseyindeniz/dapp
- Download Ganache
- Start Ganache, create a new ethereum workspace, start it and leave it as open
- Open the blokchain folder with VSCode
- Open terminal
- Run
npm i
first then runnpx hardhat run scripts/deploy.ts --network ganache
- You will see the address of the HelloWorld contract on the console log. Copy it.
- Open the frontend folder with VSCode
- Open the file src/features/helloWorld/chains/ganache.ts
- Paste the contract address you copied before into the contract address variable and save it.
- Run
npm i
and then runnpm start
, it will open the simple-dapp in your browser - Open Metamask and import any acccount from Ganache
- Click the Connect button in the simple-dapp application