Summary
When I run yarn hardhat run scripts/deploy.js --network goerli
, the following error is displayed in my terminal:
HardhatError: HH110: Invalid JSON-RPC response received: missing token
at parseJsonResponse (/home/parallels/workspace/hardhat-simple-storage/node_modules/hardhat/src/internal/util/jsonrpc.ts:47:11)
at HttpProvider._fetchJsonRpcResponse (/home/parallels/workspace/hardhat-simple-storage/node_modules/hardhat/src/internal/core/providers/http.ts:206:31)
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at HttpProvider.request (/home/parallels/workspace/hardhat-simple-storage/node_modules/hardhat/src/internal/core/providers/http.ts:84:29)
at ChainIdValidatorProvider._getChainIdFromEthNetVersion (/home/parallels/workspace/hardhat-simple-storage/node_modules/hardhat/src/internal/core/providers/chainId.ts:33:17)
at ChainIdValidatorProvider._getChainId (/home/parallels/workspace/hardhat-simple-storage/node_modules/hardhat/src/internal/core/providers/chainId.ts:17:25)
at ChainIdValidatorProvider.request (/home/parallels/workspace/hardhat-simple-storage/node_modules/hardhat/src/internal/core/providers/chainId.ts:55:29)
at EthersProviderWrapper.send (/home/parallels/workspace/hardhat-simple-storage/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)
at getSigners (/home/parallels/workspace/hardhat-simple-storage/node_modules/@nomiclabs/hardhat-ethers/src/internal/helpers.ts:45:20)
at getContractFactoryByAbiAndBytecode (/home/parallels/workspace/hardhat-simple-storage/node_modules/@nomiclabs/hardhat-ethers/src/internal/helpers.ts:288:21)
error Command failed with exit code 1.
Details
I am currently running a node by following the instructions outlined in go-ethereum
's README file:
INFO [TIMESTAMP] IPC endpoint opened url=/home/parallels/.ethereum/goerli/geth.ipc
INFO [TIMESTAMP] Generated JWT secret path=/home/parallels/.ethereum/goerli/geth/jwtsecret
INFO [TIMESTAMP] WebSocket enabled url=ws://123.4.5.6:7890
INFO [TIMESTAMP] HTTP server started endpoint=123.4.5.6:7890 auth=true prefix= cors=localhost vhosts=localhost
Next, I have added this to my hardhat.config.js
as follows and already have GOERLI_RPC_URL
defined in my .env
file, and just for kicks, tried to adjust the URL to the different values shared above (i.e. tried the IPC endpoint, the HTTP endpoint with and without prepending http://
).
const GOERLI_RPC_URL = process.env.GOERLI_RPC_URL
const PRIVATE_KEY = process.env.PRIVATE_KEY
module.exports = {
defaultNetwork: "hardhat",
networks: {
goerli: {
url: GOERLI_RPC_URL,
accounts: [PRIVATE_KEY],
chainId: 5,
},
},
solidity: "0.8.17",
}
Any suggestions on what I could be doing wrong here? yarn hardhat run scripts/deploy.js --network hardhat
runs just fine, and I have yet to see a similar question asked regarding this specific issue.