Message Storage DApp is a decentralized application (DApp) that allows users to store and retrieve messages on the Ethereum blockchain. This project is built using React, Hardhat, and Web3.
To get started with the development and testing of the DApp, follow these steps:
- Clone the repository:
git clone https://github.com/im-shubh/message-storage-dapp.git
cd message-storage-dapp
- Install dependencies:
npm install
npm run ganache
To run the provided tests, use the following command:
npx hardhat test --network ganache
To compile smart contracts, run:
npx hardhat compile
To deploy smart contracts local development blockchain, run:
npx hardhat run --network ganache scripts/deploy.js
This guide will help you set up and configure MetaMask to interact with a Ganache local Ethereum network for development and testing purposes.
-
Open MetaMask:
Launch your web browser and open the MetaMask extension.
-
Access Settings:
- Click on the MetaMask extension icon (usually located at the top right of your browser).
- In the MetaMask popup, click the profile icon (your account icon) at the top right.
- Click "Settings" from the dropdown menu.
-
Networks:
- In the Settings tab, select "Networks" from the left sidebar.
-
Add Custom RPC:
- Under Networks, scroll down to the "Custom RPC" section.
- Click "Add Network" to configure your Ganache network.
-
Fill in Network Details:
- Network Name: Enter a name for your Ganache network (e.g., "Local Ganache").
- New RPC URL: Enter the RPC server URL provided by your running Ganache instance (usually
http://127.0.0.1:8545
or the address where Ganache is running). - Chain ID: Leave this empty or set it to match your Ganache's chain ID (default is usually
1337
). - Currency Symbol: Set this to any preferred currency symbol (e.g., "ETH").
- Block Explorer URL: Leave this empty.
-
Save Configuration:
- Click "Save" to save the configuration for your Ganache network.
-
Switch to Ganache Network:
- Click the MetaMask extension icon.
- In the extension popup, click on the network dropdown.
- Select your "Local Ganache" network.
-
Connect to Ganache:
You should now be connected to your local Ganache network via MetaMask. Ensure that you have accounts and Ether available in your Ganache environment to interact with.
-
Open MetaMask:
Launch your web browser and open the MetaMask extension.
-
Access the Account Menu:
- Click on the MetaMask extension icon in your browser.
- In the extension popup, click your account icon at the top right to access your accounts.
-
Create a New Account:
If you don't already have an account in MetaMask, create a new one. This will serve as the destination for the imported private key.
-
Import the Private Key:
- Click on the three dots (...) next to your newly created account.
- Select "Account Details."
-
Access the Account Details:
In the Account Details page, you will see options to create or import an account. Click "Import Account."
-
Paste the Private Key:
In the "Import Account" section, you will be prompted to enter your private key. Paste the private key you have copied from your Ganache wallet.
-
Import the Account:
Click the "Import" button to import the private key into MetaMask.
-
Access the Imported Account:
You will now see the Ganache account imported into MetaMask. You can switch between accounts as needed.
To Run The Frontend, run:
npm start