锚测试未连接到Local主机:8899

发布于 2025-01-25 16:37:40 字数 200 浏览 0 评论 0原文

我运行了一个锚定初始化,锚固,然后部署。

我运行了“锚点运行测试”,即使我的本地验证器正在运行,我也会继续遇到此错误。 什么给?

错误:

初始化!: 错误:无法获得最近的Blockhash:Fetcherror:请求http:// localhost:8899/Failed,原因:Connect Econnrefused :: 1:88899

I ran an anchor init, anchor build, and then deployed.

I ran "anchor run test" I keep getting this error even though my local validator is running.
What gives?

Error:

Is initialized!:
Error: failed to get recent blockhash: FetchError: request to http://localhost:8899/ failed, reason: connect ECONNREFUSED ::1:8899

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

π浅易 2025-02-01 16:37:41

当我有其他运行验证器与测试的外壳时,我发生了同样的问题。该测试无法连接到Localhost:8899如果已经使用了。关闭另一个实例,然后运行“锚测试”,该实例将启动局部验证器并将其用于测试。

The same issue happened to me when I had a different shell running the validator vs the tests. The test can't connect to localhost:8899 if it is already in use. Close the other instance, then run 'anchor test', which will start a local validator and use it for the tests.

一梦等七年七年为一梦 2025-02-01 16:37:41

节点16而不是17。

当您获得“连接econnrefused :: 1:8899”错误时,请尝试使用

锚测试-Skip-local-validator

When you get "connect ECONNREFUSED ::1:8899" error, try using node 16 instead of 17 if you're on 17.

When you get "can't connect to localhost:8899 if it is already in use", try

anchor test --skip-local-validator

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文