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

mcrider/dcap-node: Convenient REST API for managing optionally encrypted decentr ...

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

开源软件名称:

mcrider/dcap-node

开源软件地址:

https://github.com/mcrider/dcap-node

开源编程语言:

TypeScript 100.0%

开源软件介绍:

DCAP

ᴅᴇᴄᴇɴᴛʀᴀʟɪᴢᴇᴅ ᴄᴏɴᴛᴇɴᴛ ᴀɢɢʀᴇɢᴀᴛɪᴏɴ ᴩʟᴀᴛꜰᴏʀᴍ

DCAP allows you to easily create and manage well-structured documents that are stored on IPFS. A simple user account system tied to a PGP keypair allows you to encrypt and decrypt your documents over an easy-to-use REST API.

With DCAP you can create document types for things such as notes, todos, chat messages, web page data, social network updates and more. These documents will be stored on the decentralized IPFS network and pinned by the API to ensure accessibility. You can choose to store your documents in plaintext for all to see or encrypt them for privacy. DCAP's API makes it easier to create and retrieve these decentralized documents in your website and apps.

Setup

Requirements

  • Node.js

Installation

Clone this repository and run npm install. Copy the sample configuration file (.env.example) to .env and edit it to match your desired configuration (you should change the TOKEN_SECRET and SERVER_KEY_PASS values to different hard-to-guess passwords). Run npm start to start DCAP on http://localhost:5000. Please use this with SSL on production environments.

Configuration

The main configuration is loaded from .env. You can change the security behavior and whether DCAP should pin IPFS documents from these settings.

In the /src/config/types directory are the type definitions that DCAP uses to validate the content you post. These must be written in JSON Schema to be validated by DCAP. You can use the example types that come bundled with DCAP but will probably want to add some more attributes to make them useful.

Example type configuration

{
  "$schema": "http://json-schema.org/draft-06/schema#",
  "title": "note", // Type name as referenced in API requests
  "description": "Simple note content type",
  "type": "object",
  "encrypted": true, // Set to false to make document publicly readable
  "properties": {
    "text": {
      "type": "string"
    },
    "public": {
      "type": "string"
    }
  },
  "public": [ // Array of properties that should appear in the public index
    "public"
  ],
  "required": [ // Required field names
    "text"
  ]
}

User Storage

Users are stored encrypted on IPFS. If you don't want public access to your list of usernames, you can use MongoDB as a user storage solution. Ensure a mongo daemon is running and in .env comment out USER_STORAGE=ipfs and uncomment USER_STORAGE=mongo and MONGODB_URI and point it to your mongo instance.

API Reference

POST /user/create: Create New User

POST /user/login: Login User


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
zippiehq/ipfs-webpack-plugin发布时间:2022-06-23
下一篇:
INFURA/ipfs-copy: Pin your existing IPFS files stored in Infura in 3 steps.发布时间:2022-06-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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