简体   繁体   English

使用 ipfsd-ctl 生成 IPFS 守护程序时出现“POST http://localhost:9090/spawn ERR_CONNECTION_REFUSED”错误

[英]“POST http://localhost:9090/spawn ERR_CONNECTION_REFUSED” error while spawning an IPFS daemon using ipfsd-ctl

I'm trying to Spawn an IPFS daemon from the Browser using the provided remote endpoint using the ipfsd-ctl library.我正在尝试使用提供的远程端点使用 ipfsd-ctl 库从浏览器生成 IPFS 守护程序。

This is the link I'm referring这是我指的链接

 // Start a remote disposable node, and get access to the api // print the node id, and stop the temporary daemon const Ctl = require('ipfsd-ctl') const port = 9090 const server = Ctl.createServer(port, { ipfsModule: require('ipfs'), ipfsHttpModule: require('ipfs-http-client') }, { js: { ipfsBin: 'path/js/ipfs/bin' }, go: { ipfsBin: 'path/go/ipfs/bin' }, }) const factory = Ctl.createFactory({ ipfsHttpModule: require('ipfs-http-client'), remote: true, endpoint: `http://localhost:${port}` // or you can set process.env.IPFSD_CTL_SERVER to http://localhost:9090 }) await server.start() const ipfsd = await factory.spawn() const id = await ipfsd.api.id() console.log(id) await ipfsd.stop() await server.stop()

It shows a "Server not implemented in the browser" warning and "POST http://localhost:9090/spawn net::ERR_CONNECTION_REFUSED" error它显示“服务器未在浏览器中实现”警告和“POST http://localhost:9090/spawn net::ERR_CONNECTION_REFUSED”错误

Ctl.createServer starts an HTTP Server that Ctl.createFactory will connect to. Ctl.createServer 启动 Ctl.createFactory 将连接到的 HTTP 服务器。 As the warning says "Server not implemented in the browser", you need to run it in nodejs and from the browser use Ctl.createFactory to interact with it.正如警告所说“服务器未在浏览器中实现”,您需要在nodejs中运行它,并从浏览器使用 Ctl.createFactory 与之交互。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 chrome 扩展 WebSocket 连接到“ws://localhost:9090/”失败:连接建立错误:net::ERR_CONNECTION_REFUSED - chrome extension WebSocket connection to 'ws://localhost:9090/' failed: Error in connection establishment: net::ERR_CONNECTION_REFUSED POST http://localhost:9000/ net::ERR_CONNECTION_REFUSED - POST http://localhost:9000/ net::ERR_CONNECTION_REFUSED GET http://localhost:5000/user net::ERR_CONNECTION_REFUSED - GET http://localhost:5000/user net::ERR_CONNECTION_REFUSED $ http获取捕获ERR_CONNECTION_REFUSED错误 - $http get catch ERR_CONNECTION_REFUSED error Javascript HTTP服务器:ERR_CONNECTION_REFUSED - Javascript http server: ERR_CONNECTION_REFUSED 向“http://localhost:3000/”发出 GET 请求时出错“加载资源失败:net::ERR_CONNECTION_REFUSED ... delete.js” - error when making GET request to 'http://localhost:3000/' “Failed to load resource: net::ERR_CONNECTION_REFUSED … delete.js” 发布请求 net::ERR_CONNECTION_REFUSED - Post Request net::ERR_CONNECTION_REFUSED 捕获nodejs ERR_CONNECTION_REFUSED错误 - catch nodejs ERR_CONNECTION_REFUSED error 什么是 error.net::ERR_CONNECTION_REFUSED? - What is error net::ERR_CONNECTION_REFUSED? ERR_CONNECTION_REFUSED http://localhost:3000/socket.io/socket.io.js - ERR_CONNECTION_REFUSED http://localhost:3000/socket.io/socket.io.js
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM