This guide provides step-by-step instructions to set up the environment for the Hacktivation-2024 project.
Install Node.js Dependencies: At the root of the project, run the following command to install all required dependencies:
npm installNavigate to the packages/contract directory.
-
Write Your Contract:
- Write your smart contract files in this directory.
-
Create a Deployment Script:
- Write your deployment script in
scripts/deploy.ts.
- Write your deployment script in
-
Start the Local Node:
npm run node
-
Deploy the Contract:
- Deploy the contract to the local network using the following command:
npm run deploy -- --network localhost
- Note down the contract address displayed in the console after deployment.
- Deploy the contract to the local network using the following command:
Navigate to the packages/frontend directory.
-
Import the Local Node Account into MetaMask:
- Open MetaMask and import the private key of the first account displayed by the local node.
-
Add Localhost Network to MetaMask:
- Configure MetaMask to connect to the localhost network.
-
Start the Frontend Application:
npm run dev
Now you have both the backend (smart contract) and frontend environments running for Hacktivation-2024. Happy hacking!