Open up your terminal (or command prompt) and navigate to a directory you would like to store this code on. Once there type in the following command:
git clone https://github.com/filecoin-project/fevm-hardhat-kit.git
cd fevm-hardhat-kit
yarn install
This will clone the hardhat kit onto your computer, switch directories into the newly installed kit, and install the dependencies the kit needs to work.
You can get a private key from a wallet provider such as Metamask.
Add your private key as an environment variable by running this command:
export PRIVATE_KEY='abcdef'
If you use a .env file, don't commit and push any changes to .env files that may contain sensitive information, such as a private key! If this information reaches a public GitHub repository, someone can use it to check if you have any Mainnet funds in that wallet address, and steal them!
Run this command:
yarn hardhat get-address
This will show you the ethereum-style address associated with that private key and the filecoin-style f4 address (also known as t4 address on testnets)! The Ethereum address can now be exclusively used for almost all FEVM tools, including the faucet.
Go to the Hyperspace testnet faucet, and paste in the Ethereum address from the previous step. This will send some hyperspace testnet FIL to the account.
Type in the following command in the terminal to deploy the contracts:
yarn hardhat deploy
This will compile all the contracts in the contracts folder and deploy them to the Hyperspace test network automatically!
Keep note of the deployed contract addresses for the next step.
You can interact with contracts via hardhat tasks, found in the 'tasks' folder. For example, to interact with the SimpleCoin contract:
Type in the following command in the terminal:
yarn hardhat stable-diffusion --contract 'THE DEPLOYED CONTRACT ADDRESS HERE' --prompts 'Awesome Decentralized Storage'