• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

kf106/ipfs-submarine: Bash commands to submarine folders and files on the IPFS

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

kf106/ipfs-submarine

开源软件地址:

https://github.com/kf106/ipfs-submarine

开源编程语言:

Shell 100.0%

开源软件介绍:

IPFS Submarine

Summary: Bash scripts with commands to submarine folders and files on Ubuntu 20.04.

The following repository contains helper scripts to allow you to submarine folders and files.

Submarining is the process of obtaining and publishing an IPFS folder without publishing the files contained within the folder. This is useful for, for example, an NFT project using the OpenZeppelin ERC721 contract, where images are enumerated using:

ifps://<folder CID>/<token ID>

and the contract deployer only wants to reveal the underlying images over time, rather than all at once.

Some IPFS gateway companies offer this as a paid service, but the following project allows anyone to do this for free.

For more information and a walk-through of how this works, see my article on LinkedIn.

Overview

The scripts set up two instances of the IPFS, one which is kept private, and one which is a public gateway out to the rest of the IPFS. The image folder is added and pinned in the private IPFS swarm, and then commands are avaialbe for copying parts but not all of the files underlying a folder to the public gateway.

To use

Run the IPFS setup script: ./install.sh

This will set up a private IPFS instance which is not running as a background process, but can still be used by the other scripts to submarine and reveal files. It also starts a public IPFS server, the control panel of which is found at http://127.0.0.1/5001.

To submarine a particular folder, run: ./submarine.sh <folder>

To reveal a particular file from the folder, run: ./reveal.sh <folder>/<file>

Example

The installation script provides the option to generate five random files in a folder called file, which you can use to test your setup.

Run ./submarine.sh file to publish the folder but not the files. Then visit the link that is displayed to see the folder and the list of files. Click on 0.json and the browser will hang, because the file is not published.

Then run ./reveal.sh file/0.json and shortly afterwards the browser will display the contents of the file (a short random string of digits).

Known limitations

The system only supports folders containing up to 5697 files. See issue 2 for details.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap