hardhat deploying application to sepolia testnet
To deploy to a testnet, let's use this endpoint as my testnet -https://eth-sepolia.g.alchemy.com/v2/xxxxxxxxxxxxxxxxxxxxxxxxx. Please register and create a free account
and select all the testnet
And we also need to set the wallet private keys (please do not share actual private key). This account here must have some $$$$. If you don't have you can use sepolia to send this over to your MetaMask or any other wall.
https://cloud.google.com/application/web3/faucet/ethereum/sepolia
Why use google? Others like Alchemy requires atleast some $$$ in your wallet before you can deploy anything.Ensure that we have the followings configurations:-
In the following setups, we need to setup our keystore
pnpm hardhat keystore set SEPOLIA_RPC_URL --force
pnpm hardhat keystore set SEPOLIA_PRIVATE_KEY --force
You will be prompted to enter password to your store. Please set this up before issuing command above. Finally to deploy run the following command
pnpm hardhat ignition deploy ignition/modules/Counter.ts --network sepolia
And if everything goes well, you would get your contract deployed as shown here:
And if you want to verify it, please ensure you use the following configuration:-
And after you run
pnpm hardhat ignition deploy ignition/modules/Counter.ts --network sepolia --verify
If you getting error like "Error HHE10115 in plugin hardhat-ignition: Could not find a module file at the path: "ignition/modules/Apollo.ts". By right this shouldn't happened but if it does, please check your configuration again to ensure it matches something above.
And you can verify your contract by looking at it here:-
Or replace the address with your deployed transaction id you get earlier
https://sepolia.etherscan.io/address/0x62D6a1681e20cB502e85886939CAFA380Dc0d4e6#code
Comments