This project is a decentralized application (DApp) where users can "buy chai" by sending a small amount of cryptocurrency (ETH) along with a message. This DApp showcases a simple way to send Ethereum transactions and messages on the blockchain.
- Users can send ETH to "buy chai" and leave a message.
- Each transaction is stored on the blockchain.
- Displays a list of recent messages and chai purchases.
- Shows the account of the user making the transaction.
- Solidity: For writing the smart contract.
- React: For the frontend interface.
- Ethers.js: To interact with the Ethereum blockchain from the frontend.
- Hardhat: For smart contract development and deployment.
- Metamask: Wallet integration for Ethereum transactions.
- Clone the repository:
git clone https://github.com/Yashkrit-Singh/hardhat_Project_ChaiDapp.git cd your-repo-name
- Install dependencies:
npm install
- Navigate to the client folder and install dependencies for the frontend:
cd client npm install
-
Start the Hardhat Node:
npx hardhat node
-
Deploy the Contract:
-
In a new terminal, deploy the contract on the local Hardhat network:
npx hardhat run scripts/deploy.js --network localhost
-
To deploy the contract to a testnet (like Sepolia), update the hardhat.config.cjs file with your API keys and deploy it:
npx hardhat run scripts/deploy.js --network sepolia
-
-
Run the Frontend:
cd client npm start
- Connect Wallet: Open the DApp and connect your Metamask wallet.
- Buy Chai: Enter your name, message, and click "Pay" to send ETH along with your message.
- View Memos: All messages and transactions are displayed in the "Memos" section.
This project is licensed under the MIT License - see the LICENSE file for details.