首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Alchemy Goerli测试网时无效的JSON RPC响应

使用Alchemy Goerli测试网时无效的JSON RPC响应
EN

Stack Overflow用户
提问于 2022-11-26 11:55:36
回答 1查看 40关注 0票数 0

我有一个脚本,它总是连接到,并且一直运行良好。但是,当我今天尝试运行npx硬帽子部署--网络goerli时,我会遇到如下所示的错误消息。以前有人遇到过这个问题吗?

代码语言:javascript
复制
Nothing to compile
failed to get chainId, falling back on net_version...
Error HH110: Invalid JSON-RPC response received: <!DOCTYPE html>
<html lang="en-US">
<head>
    <title>Just a moment...</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge">
    <meta name="robots" content="noindex,nofollow">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <link href="/cdn-cgi/styles/challenges.css" rel="stylesheet">
</head>

下面是我的hardhat.config.js文件。

代码语言:javascript
复制
require("@nomicfoundation/hardhat-toolbox")
require("@nomicfoundation/hardhat-chai-matchers")
require("@nomiclabs/hardhat-etherscan")
require("hardhat-deploy")
require("solidity-coverage")
require("hardhat-gas-reporter")
require("hardhat-contract-sizer")
require("dotenv").config()

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

const GOERLI_RPC_URL = process.env.GOERLI_RPC_URL
const PRIVATE_KEY = process.env.PRIVATE_KEY
const ETHERSCAN_API_KEY = process.env.ETHERSCAN_API_KEY
const COINMARKETCAP_API_KEY = process.env.COINMARKETCAP_API_KEY

module.exports = {
    defaultNetwork: "hardhat",
    networks: {
        localhost: {
            // url: "http://127.0.0.1:8545/",
            //accounts: those 10 fake accounts generated by local
            chainId: 31337,
        },
        hardhat: {
            chainId: 31337,
            // url: "http://127.0.0.1:8545/",
            // blockConfirmations: 1
        },
        goerli: {
            blockConfirmations: 1,
            url: GOERLI_RPC_URL,
            accounts: [PRIVATE_KEY],
            chainId: 5,
        },
    },
    solidity: {
        compilers: [
            {
                version: "0.8.9",
            },
            {
                version: "0.8.0",
            },
        ],
    },
    namedAccounts: {
        deployer: {
            default: 0,
        },
        player: {
            default: 1,
        },
    },
EN

回答 1

Stack Overflow用户

发布于 2022-11-29 17:00:48

尝试重新设置元块,并重新配置ChainID ( 31337除外)。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/74581954

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档