Developer-DAO / academy

Deprecated; V2 lives at https://github.com/developer-dao/academy-turbo
https://academy.developerdao.com
110 stars 53 forks source link

Network sepolia doesn't exist #266

Open sandeepV2 opened 12 months ago

sandeepV2 commented 12 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'ProjectNFT'
  2. Build the project as instructed.
  3. Error while deploying NFT.
  4. See error after running below command npx hardhat --network sepolia run scripts/deploy.js

Expected behavior Deploy the NFT on sepolia test net.

Screenshots/ERROR

npx hardhat --network sepolia run scripts/deploy.js --show-stack-traces Error HH100: Network sepolia doesn't exist HardhatError: HH100: Network sepolia doesn't exist

Desktop (please complete the following information):

sandeepV2 commented 12 months ago
defaultNetwork: "sepolia",

networks: { sepolia: { url: RPC_API_KEY, // accounts: [WALLET_PRIVATE_KEY], accounts: [0x${WALLET_PRIVATE_KEY}], chainID: 5, }, },

Following steps helped me to unblock the issue:

  1. Adding defaultNetwork and defining sepolia under networks of hardhat.config.js.
  2. Executing without --network option. (npx hardhat run scripts/deploy.js)

I think this change has to be mentioned in the lesson, when users hit failure.

elPiablo commented 11 months ago

Hey @sandeepV2 Sorry for the very, very long wait. Please be sure to enter your command like so: npx hardhat run scripts/deploy.js --network sepolia Your terminal needs to read the commands in the correct order. Here hardhat will recognise the following run as a command. If followed by --network, it will throw an error because Hardhat won't recognise it as a command. Hope this helps 😃