This solidity project is the backend of our Twitter clone project, made with Hardhat.
Once you have clone the project, install project dependencies using the following command:
npm install
Create a .env
file in the root directory and set your Alchemy API key and Goerli account private key values following this format:
ALCHEMY_API_KEY=<YOUR ALCHEMY API KEY>
GOERLI_PRIVATE_KEY=<YOUR GOERLI API KEY>
Test the project using the following command:
npm run test
Compile the project using the following command:
npm run compile
If you want to test the project using the Ganache testnet, just replace in the file hardhat.config.ts
, the first value of accounts
array with your Ganache account private key:
...
},
ganache: {
url: "http://127.0.0.1:7545", // Default Ganache URL, replace if different
accounts: [
// Replace with your ganache account private key
"<YOUR_GANACHE_ACCOUNT_PRIVATE_KEY>",
],
chainId: 1337,
},
},
...
and deploy to Ganache using this command:
npm run devdeploy
To deploy on Goerli, just compile the project as shown earlier and run this command:
npm run prodeploy
To reformat the entire project files with Prettier, use the following command:
npm run format