在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:ipfs-shipyard/peer-crdt-ipfs开源软件地址:https://github.com/ipfs-shipyard/peer-crdt-ipfs开源编程语言:JavaScript 100.0%开源软件介绍:peer-crdt-ipfsIPFS network and storage adapter for peer-crdt. Install$ npm install ipfs peer-crdt peer-crdt-ipfs Setupconst IPFS = require('ipfs')
const PeerCRDT = require('peer-crdt')
const PeerCrdtIpfs = require('peer-crdt-ipfs')
// Create an IPFS node
ipfs = new IPFS({
EXPERIMENTAL: {
pubsub: true
},
config: {
Addresses: {
Swarm: [
'/dns4/ws-star.discovery.libp2p.io/tcp/443/wss/p2p-websocket-star',
'/dns4/ws-star-signal-2.servep2p.com/tcp/443/wss/p2p-websocket-star'
]
}
}
})
const signAndEncrypt = async (value) => {
return await somehowSignAndEncrypt(value)
}
const decryptAndVerify = async (buffer) => {
return await somehowDecryptAndVerify(buffer)
}
const options = {
signAndEncrypt,
decryptAndVerify
}
// Create a peer-crdt-ifps config object:
const peerCrdtIpfs = PeerCrdtIpfs(ipfs)
// Use it to configure peer-crdt
const CRDT = PeerCRDT
.defaults(peerCrdtIpfs)
.defaults(options)
// Create and use a CRDT at will
const crdt = CRDT.create(type, id)
// ... OptionsThe constructor exposed in
LicenseMIT |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论