installed npm. you can do so by installing Node.js.
installed the metamask extension on your browser of choice.
- clone or download this repository into a directory
- open your terminal and navigate into /contracts by
cd .\contracts - run
npm installin the terminal to download the required packages - run
npx hardhat nodein the terminal. do not close this terminal - open a new terminal on the current directory and run
npx hardhat run scripts/deploy.ts --network localhost - navigate to /dstorage-web
- run
npm installin the terminal to download the required packages - run
npm run devin the terminal to start the webserver. do not close this terminal - the web app should run at http://localhost:5173/
- you need to have finished setting up metamask and import test accounts to use the web app
- if you've already finished the initial setting up of metamask we will have to configure it to interact with our local testnet.
- open metamask and at the top right corner there should be options to choose networks, select it.
- once you've selected it there should be a popup listing networks. at the bottom there should an option to add a network. select it.
- Network name: anything, preferably localnet
- add default rpc URl: http://127.0.0.1:8545
- Chain ID: 3137
- Currency Symbol: ETH
- Block explorer URL: ignore
- select save.
- Use the newly added local testnet by selecting it in the network list.
- when you ran
npx hardhat nodea list of accounts and their private keys should pop up. - open metamask
- ensure that you are currently using the local test net
- on the top centre of the metamask extension window there should be an option to select accounts. select it.
- select the option to add account.
- choose the option to import a private key.
- go to the terminal that lists accounts and private keys and copy a private key.
- paste the private key into metamask and select import.
- the account should be added to metamask.
- Repeat for how much accounts you want to use.