HH110: Invalid JSON-RPC response received: <h1>Not Found</h1><p>The requested resource was not found on this server.</p>

problem try to making deploy or npx hardhat test to rinkeby

error HH110: Invalid JSON-RPC response received:

Not Found

The requested resource was not found on this server.

Code for hardhatconfig.js

const { alchemyApiKey, mnemonic } = require('./secrets.json');

require('@nomiclabs/hardhat-truffle5');
require('@nomiclabs/hardhat-solhint');
require('solidity-coverage');
require('hardhat-gas-reporter');
require('@openzeppelin/hardhat-upgrades');
require("@nomiclabs/hardhat-ethers");
require("@nomiclabs/hardhat-waffle");



const enableGasReport = !!process.env.ENABLE_GAS_REPORT;
const enableProduction = process.env.COMPILE_MODE === 'production';

/**
 * @type import('hardhat/config').HardhatUserConfig
 */


module.exports = {
  defaultNetwork: "rinkeby",
  networks :{
hardhat :{
},
rinkeby:{
  url:"https://eth-rinkeby.alchemyapi.io/v2/${alchemyApiKey}",
    accounts: {mnemonic: mnemonic}
}
  },
  solidity: {
version: '0.8.0',
settings: {
  optimizer: {
    enabled:true,
    enabled: enableGasReport || enableProduction,
    runs: 200,
  },
},
  gasReporter: {
enable: enableGasReport,
currency: 'USD',
outputFile: process.env.CI ? 'gas-report.txt' : undefined,
}
  }
};

// CODE FOR SECRETS.JSON (IF need set aditional things please help me)

{
    "alchemyApiKey":"*****REMOVED********",
    "mnemonic":"*****REMOVED********"
}

and code for deploy.js

async function main() {

  const [deployer] = await ethers.getSigners();

  console.log(
    "Deploying contracts with the account:",
    deployer.address
  );
  
  console.log("Account balance:", (await deployer.getBalance()).toString());

  const Token = await ethers.getContractFactory("Token");
  const token = await Token.deploy();

  console.log("Token address:", token.address);
}

main()
  .then(() => process.exit(0))
  .catch(error => {
    console.error(error);
    process.exit(1);
  });
1 Like

Hi @Guard_Colombia,

:warning: Please don’t post secrets into the forum. I recommend you delete your Alchemy API key and create a new one. I recommend that you don’t use the mnemonic for any purposes again.

Both of these secrets are now vulnerable.


I recommend going through the following Learn guide: https://docs.openzeppelin.com/learn/connecting-to-public-test-networks?pref=hardhat