V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
weiruanniubi
V2EX  ›  IPFS

为什么我上传到 IPFS 的文件打不开?

  •  
  •   weiruanniubi · 2019-09-06 08:18:37 +08:00 · 8930 次点击
    这是一个创建于 1665 天前的主题,其中的信息可能已经有所发展或是发生改变。

    使用 IPFS 上传了一张图片,得到这个地址:
    https://ipfs.io/ipfs/Qmd9FJMB7dvkZKu4X5PPaLBCtUEWXWGhZMd9b7ZfH9w2b7
    可是我为什么打不开?确定没有被 Q,ipfs.io 访问正常,而且 FQ 也打不开。

    25 条回复    2023-02-23 17:53:34 +08:00
    imWBB
        1
    imWBB  
       2019-09-06 08:24:35 +08:00 via Android
    估计你上传图片的那个 ipfs 节点没有在线吧
    weiruanniubi
        2
    weiruanniubi  
    OP
       2019-09-06 08:27:12 +08:00
    @imWBB IPFS 不是分布式吗,不可能一个节点关了文件就访问不了,那和中心化网络不一样吗……
    perfectblog
        3
    perfectblog  
       2019-09-06 08:29:51 +08:00
    我这边可以打开
    weiruanniubi
        4
    weiruanniubi  
    OP
       2019-09-06 08:32:59 +08:00
    @perfectblog
    额,因为我打开了端口映射。
    我不明白啊,为什么我上传还需要打开端口映射呢?这样的话要是没有公网 IP 岂不是没法用?
    wweir
        5
    wweir  
       2019-09-06 08:46:11 +08:00 via Android
    还真有人信这种相见不如不见的项目 😂
    好好停留在 PPT 上不好吗?非要实现一下,你看,尴尬了吧
    txx
        6
    txx  
       2019-09-06 08:54:16 +08:00 via Android
    @weiruanniubi ipfs 只是个路由系统。。否则高额的存储费用谁来出?
    weiruanniubi
        7
    weiruanniubi  
    OP
       2019-09-06 09:09:30 +08:00
    @txx 矿工出啊
    niubee1
        8
    niubee1  
       2019-09-06 09:30:41 +08:00
    打不开, 什么取代 http, 当笑话听听吧
    annoy1309
        9
    annoy1309  
       2019-09-06 09:32:21 +08:00   ❤️ 1
    能打开啊,一张 windows 的图片
    SaltyLeo
        10
    SaltyLeo  
       2019-09-06 09:35:38 +08:00
    @weiruanniubi
    #2 你可以查看 ipfs 的白皮书 https://raw.githubusercontent.com/ipfs/papers/master/ipfs-cap2pfs/ipfs-p2p-file-system.pdf ,第一段就写的很清楚了:"IPFS is similar to the Web, but IPFS could be seen as a single BitTorrent swarm" bt 你可以看作是一个非中心化的网络,但是如果数据还没有做种出去,那么源节点关闭数据就消失了。IPFS 同理,数据还没传输到其他节点源节点下线数据丢失。

    #4 因为 IPFS 的 DHT 网络,你在自建节点上传文件,最先传播到的就是这个节点的网关,传播到其他节点需要时间,并且,没有人有义务帮你储存这个文件,你从别的网关访问到的文件只是别的网关从你自建节点的获取到的缓存。

    #7 IPFS 和挖矿是两种东西,因为 IPFS 文件储存需要自建节点上传文件,节点的质量和传输速度完全靠自觉自愿,所以性能不保证,而 filecoin 只是使用 ipfs 底层技术增加了激励机制以维持网络的性能。
    SaltyLeo
        11
    SaltyLeo  
       2019-09-06 09:39:48 +08:00
    ps:我自建节点也是可以访问这个文件的。
    pipixia
        12
    pipixia  
       2019-09-06 09:47:44 +08:00 via Android
    加提子秒开
    weiruanniubi
        13
    weiruanniubi  
    OP
       2019-09-06 09:48:27 +08:00
    @SaltyLeo 意思是我上传的图片,没有直接上传到 IPFS 网络,仅仅是上传到了我自己的节点,而我的节点没有连接公网,所以没法访问,连接公网之后才能访问,同时也同步到其他节点。是这个意思吧。
    Yc1992
        14
    Yc1992  
       2019-09-06 10:00:19 +08:00
    filecoin 还没上线了,目前不能挖矿
    jy02201949
        15
    jy02201949  
       2019-09-06 10:02:02 +08:00
    用我们动作爱情片交流界的话来说就是:“做种没满三天你小子就想跑了,这车还怎么开!!!”
    SaltyLeo
        16
    SaltyLeo  
       2019-09-06 10:06:38 +08:00
    @weiruanniubi IPFS 是一个分布式网络,你上传了一个文件,文件还是在你本地,文件被分块计算 hash,这个时候代表文件的 hash 正在 DHT 网络中飞驰,主要是 hash 在同步,文件本身并没有时时刻刻同步。

    当有人使用任意网关访问这个 hsah,网关就会通过 DHT 网络计算并找到你的节点获取这个文件,这个时候文件就从你的节点传播出来了。但这个传播并不是永久的,还是那句话,任何节点没有义务储存你的文件,只是缓存了一下,时间可以设置默认 12H 删除。
    weiruanniubi
        17
    weiruanniubi  
    OP
       2019-09-06 10:14:20 +08:00
    @SaltyLeo 那就是说和我开没开端口映射没有关系?
    SaltyLeo
        18
    SaltyLeo  
       2019-09-06 10:19:31 +08:00
    @weiruanniubi 只要使用 ipfs stats bitswap 命令有类似以下的输出,别的节点就可以访问你的节点,和端口映射没关系。
    ruxuan1306
        19
    ruxuan1306  
       2019-09-06 11:33:10 +08:00 via iPhone
    上传后,需要在别的网关访问一下,形成缓存,源节点才能离线。

    对于别的网关,如果一个文件长时间没被访问,就会把该文件的缓存清掉。

    所以热的文件永存,冷的文件自动淘汰。
    php01
        20
    php01  
       2019-09-06 12:30:23 +08:00
    这样看来还是 sia 好用点啊
    Pythondr
        21
    Pythondr  
       2019-09-06 12:37:27 +08:00
    ipfs 的官方网关是被 Q 的
    standin000
        22
    standin000  
       2019-09-06 13:51:35 +08:00
    @php01 sia 能免费存储?
    TransAM
        23
    TransAM  
       2020-04-12 23:30:19 +08:00 via Android
    @Pythondr 官方域名是被墙的,官方 ip 你又不直接访问管他干嘛。
    jiaqizhang
        25
    jiaqizhang  
       2023-02-23 17:53:34 +08:00
    Pinning Content on IPFS
    By default, content on IPFS is not pinned. That means when you add a file to IPFS, it will eventually stop being discoverable on the network.

    This problem occurs because IPFS uses garbage collection to free disk space on your IPFS node by deleting data that is no longer needed. Garbage collection is a form of automatic resource management widely used in software development.

    To mitigate this problem you must pin your content to your node to ensure it persists on IPFS. Your options for pinning content are:

    You pin it locally to your own node. Note that if the content is only pinned to your local node, it must be online for peers to get that content.
    You use a pinning service. Some pinning services require payment for their services, others offer a free storage allowance for new users.

    参考: https://curriculum.pl-launchpad.io/curriculum/ipfs/content-addressing/
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   959 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 33ms · UTC 20:33 · PVG 04:33 · LAX 13:33 · JFK 16:33
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.