-
1. Problem DescriptionWhen I ran the
I got this
2. Possible CauseI'm in China, so I guess that's because China Great Firewall (GFW) polluted my DNS. To test if so, I tried to ping the domain name of
and got 100% package loss. But after directly ping its IP address:
I got 0% package loss. Seems like it's caused by 3. New Problem After Solving the CauseTo solve the problem of
then run the
But I haven't found any answer about this error. P.S. The connection problem occured after I ran this cammand 4. Additional InformationMy contract address in rinkeby is: The const { run } = require("hardhat")
async function verify(contractAddress, args) {
try {
await run("verify:verify", {
address: contractAddress,
constructorArgument: args,
})
} catch (e) {
console.log(e)
}
}
verify("0x2A3a6551B251C199De4748F545799c999b291C71", []) The error of running this code is the same to the The proxy I use is PandaVPN, and is in the mode of I've been stuck on the problem for several days, and hope you can help me with some ideas. P.S. Maybe you can verify the contract for me and see if it works. Any reply to this problem is greatly appreciated! |
Beta Was this translation helpful? Give feedback.
Replies: 14 comments 74 replies
-
@eiyen : First Copy paste this verify script in your
|
Beta Was this translation helpful? Give feedback.
-
Hey @eiyen please share your contract code, I need to compile it, get the abi, and see if I am able to verify it myself. |
Beta Was this translation helpful? Give feedback.
-
@eiyen : your deploy script please! |
Beta Was this translation helpful? Give feedback.
-
@eiyen I have noticed you are not using the correct command. Please try |
Beta Was this translation helpful? Give feedback.
-
I also meet this problem and find a way to solve it perfectly.
|
Beta Was this translation helpful? Give feedback.
-
Hi, I ran into similar issue, blocked me for a few days and following is my workaround. Error messages I've met# 1
NomicLabsHardhatPluginError: Failed to send contract verification request.
Endpoint URL: https://api-rinkeby.etherscan.io/api
Reason: Connect Timeout Error
# 2
NomicLabsHardhatPluginError: Failed to send contract verification request.
Endpoint URL: https://api-rinkeby.etherscan.io/api
Reason: Client network socket disconnected before secure TLS connection was established My workaroundJust like you, my first suspicion was on the GFW and I set up my Since there was almost no waiting time when my console emit the error messages,
Luckily yes: I tried the following: etherscan: {
apiKey: {
rinkeby: "<rinkeby-api-key>"
},
customChains: [
{
network: "rinkeby",
chainId: 4,
urls: {
apiURL: "http://api-rinkeby.etherscan.io/api", // https => http
browserURL: "https://rinkeby.etherscan.io"
}
}
]
} Then everything works with and without VPN. Downside of the workaroundIf, one day, FinallyI can see there may be other issues you came across, please try deploy, store and retrieve first, make sure other things works well, then open up your verify function and try above configs. Hope this helps :) |
Beta Was this translation helpful? Give feedback.
-
Thanks,I also solved the problem in your way.It may be necessary to open the proxy during configuration, you can use the global mode of clash and open TUN in the consolel.I solved it this way. |
Beta Was this translation helpful? Give feedback.
-
I tried setting up a terminal proxy and an npm proxy, but both failed. |
Beta Was this translation helpful? Give feedback.
-
你们的讨论是有意义的,感谢。 |
Beta Was this translation helpful? Give feedback.
-
找到了该网络问题解决方法:
按照以上方法,可以顺利部署并测试合约。 |
Beta Was this translation helpful? Give feedback.
-
补一个在mac上的用clash开启LAN的截图 clashx下载: https://repo.trojan-cdn.com/clashX/LatestRelease/ClashX.dmg |
Beta Was this translation helpful? Give feedback.
-
上面都是windows和mc的,这里分享一个win11下的wsl子系统吧,我用的是ubuntu20.4 step1:请记住第五步的名字(vEthernet (WSL (Hyper-V firewall))),请用英文括号,记得不要忘记空格step2:主机之间是有防火墙的, 现在我们要关闭它
step3:clash的配置和上面这位大佬一样 step4:子系统配置## 获取主机 IP
## 主机 IP 保存在 /etc/resolv.conf 中 wsl2需要通过这个ip访问windows
export hostip=$(cat /etc/resolv.conf |grep -oP '(?<=nameserver\ ).*') 然后粘贴下面的脚本并运行 export hostip=$(cat /etc/resolv.conf |grep -oP '(?<=nameserver\ ).*')
alias setss='export https_proxy="http://${hostip}:7890";export http_proxy="http://${hostip}:7890";export all_proxy="socks5://${hostip}:7890";'
alias unsetss='unset all_proxy' 上面的脚本只影响当前会话 不必担心会把wsl的网络搞崩 重新启动个shell这些环境都没了 或保存为任意文件每次运行source <保存的脚本文件名> step5:验证智能合约 ps:***不需要在hardhat.config.js里面配置代理了,这里已经用主机代理,注释掉代码就可以bingo! |
Beta Was this translation helpful? Give feedback.
-
解决问题了,感谢 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Hi,
I ran into similar issue, blocked me for a few days and following is my workaround.
Error messages I've met
My workaround
Just like you, my first suspicion was on the GFW and I set up my
hosts
file like you did.ping
success with and without VPN, which means there is NO connection issue between our computers and …