IPFS模块无法与Firebase功能一起使用 [英] Ipfs module not working with firebase functions

查看:108
本文介绍了IPFS模块无法与Firebase功能一起使用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Firebase云功能将数据存储在IPFS上.我能够安装ipfs-mini软件包.

I am trying to use firebase cloud functions to store data on IPFS. I was able to install ipfs-mini package.

const IPFS = require('ipfs-mini');
const ipfs = new IPFS({ host: 'ipfs.infura.io', port: 5001, protocol: 'https' });

ipfs.add("testdata")
    .then(function(result){               
      response.send(result);
    })  
    .catch(function (err) {            
      response.send(err)
    })

但是我在屏幕截图中出现了错误

However I get error as in screenshot

推荐答案

基于错误getaddrinfo ENOTFOUND ...,可能是因为您正在使用免费的"Spark"计划.您需要采用火焰"或烈火"定价计划.

Based on your error getaddrinfo ENOTFOUND ..., it is probably because you are on the free "Spark" plan. You need to be on the "Flame" or "Blaze" pricing plan.

事实上,免费的"Spark"计划仅允许对Google拥有的服务的出站网络请求".请参见 https://firebase.google.com/pricing/(将鼠标悬停在问号上位于云功能"标题之后)

As a matter of fact, the free "Spark" plan "allows outbound network requests only to Google-owned services". See https://firebase.google.com/pricing/ (hover your mouse on the question mark located after the "Cloud Functions" title)

由于IPFS不是Google拥有的服务,因此您需要切换到火焰"或火焰"计划.

Since IPFS is not a Google-owned service, you need to switch to the "Flame" or "Blaze" plan.

请注意,如果您采用"Blaze"计划,则仍然可以利用免费的"Spark"计划提供的免费套餐(请参见顶部的包括Spark计划的免费使用"注释,定价表的右侧单元格

Note that if you take the "Blaze" plan, you will still be able to take advantage of the free tier offered by the free "Spark" plan (See the "Free usage from Spark plan included" remark in the top-right cell of the pricing table)

这篇关于IPFS模块无法与Firebase功能一起使用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆