锚测试未连接到Local主机:8899
我运行了一个锚定初始化,锚固,然后部署。
我运行了“锚点运行测试”,即使我的本地验证器正在运行,我也会继续遇到此错误。 什么给?
错误:
初始化!: 错误:无法获得最近的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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
当我有其他运行验证器与测试的外壳时,我发生了同样的问题。该测试无法连接到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.
节点16而不是17。
当您获得“连接econnrefused :: 1:8899”错误时,请尝试使用
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