簡體   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

我正在嘗試使用提供的遠程端點使用 ipfsd-ctl 庫從瀏覽器生成 IPFS 守護程序。

這是我指的鏈接

 // 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()

它顯示“服務器未在瀏覽器中實現”警告和“POST http://localhost:9090/spawn net::ERR_CONNECTION_REFUSED”錯誤

Ctl.createServer 啟動 Ctl.createFactory 將連接到的 HTTP 服務器。 正如警告所說“服務器未在瀏覽器中實現”,您需要在nodejs中運行它,並從瀏覽器使用 Ctl.createFactory 與之交互。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM