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

Eximua/solid-ipfs: Using Solid to store IPFS Hash privately or publicly

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

开源软件名称:

Eximua/solid-ipfs

开源软件地址:

https://github.com/Eximua/solid-ipfs

开源编程语言:

JavaScript 100.0%

开源软件介绍:

solid-ipfs

Using Solid to store IPFS Hash privately or publicly.

You need to have a solid account to use solid-ipfs. If you don't already have one, please click here to register.

Install

$ npm install solid-ipfs --save

Usage

import SolidIPFS from 'solid-ipfs';

const main = async () => {
    const solidIpfs = new SolidIPFS({
        url: 'YOUR_SOLID_URL', // e.g. https://alicea.solid.authing.cn/inbox/
    });

    const result = await solidIpfs.storeHash({
        hash: 'YOUR_IPFS_HASH',
    });

    console.log(result, result ? '保存成功' : '保存失败');
}

main();

Then you can get IPFS hash list via <YOURL_SOLID_URL>/ipfs/hash/.

If you don't have a solid account, please click here to register.

In Solid, the path with the suffix inbox is a private data storage area. Others are public and profile, all publicly accessible. So if you want to privatize the store, use inbox , otherwise you can choose public or profile.

Private path example

  1. https://alicea.solid.authing.cn/inbox/
import SolidIPFS from 'solid-ipfs';

const main = async () => {
    const solidIpfs = new SolidIPFS({
        url: 'https://alicea.solid.authing.cn/inbox/', // inbox -> private
    });

    const result = await solidIpfs.storeHash({
        hash: 'YOUR_IPFS_HASH',
    });

    console.log(result, result ? '保存成功' : '保存失败');
}

main();

Public path example

  1. https://alicea.solid.authing.cn/profile/
  2. https://alicea.solid.authing.cn/public/
import SolidIPFS from 'solid-ipfs';

const main = async () => {
    const solidIpfs = new SolidIPFS({
        url: 'https://alicea.solid.authing.cn/public/', // public -> public
    });

    const result = await solidIpfs.storeHash({
        hash: 'YOUR_IPFS_HASH',
    });

    console.log(result, result ? '保存成功' : '保存失败');
}

main();

Using with Authing

Authing is an identity for EVERYONE and EVERYTHING, which likes Auth0.

We have integrated authing so that you can see statistics in the Authing dashboard after logging in/registering solid.

import SolidIPFS from 'solid-ipfs';

const main = async () => {
    const solidIpfs = new SolidIPFS({
        url: 'https://alicea.solid.authing.cn/inbox/', // inbox -> private
        clientId: '<YOUR_AUTHING_CLIENT_ID>',
        secret: '<YOUR_AUTHING_CLIENT_SECRET>',
    });

    await solidIpfs.initInstance(); // MUST

    const result = await solidIpfs.storeHash({
        hash: 'YOUR_IPFS_HASH',
    });

    console.log(result, result ? '保存成功' : '保存失败');
}

main();



鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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