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);
});