All Projects → ipfs-shipyard → Y Ipfs Connector

ipfs-shipyard / Y Ipfs Connector

Licence: mit
Y.js connector over IPFS

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Y Ipfs Connector

Ipfs Log
Append-only log CRDT on IPFS
Stars: ✭ 269 (+448.98%)
Mutual labels:  crdt, p2p, ipfs
Berty
Berty is a secure peer-to-peer messaging app that works with or without internet access, cellular data or trust in the network
Stars: ✭ 5,101 (+10310.2%)
Mutual labels:  crdt, p2p, ipfs
Peer Pad
📝 Online editor providing collaborative editing in really real-time using CRDTs and IPFS.
Stars: ✭ 564 (+1051.02%)
Mutual labels:  crdt, p2p, ipfs
Orbit Db
Peer-to-Peer Databases for the Decentralized Web
Stars: ✭ 6,381 (+12922.45%)
Mutual labels:  crdt, p2p, ipfs
Ipdr
🐋 IPFS-backed Docker Registry
Stars: ✭ 312 (+536.73%)
Mutual labels:  p2p, ipfs
Yjs
Shared data types for building collaborative software
Stars: ✭ 5,894 (+11928.57%)
Mutual labels:  crdt, p2p
Ipfs
Peer-to-peer hypermedia protocol
Stars: ✭ 20,128 (+40977.55%)
Mutual labels:  p2p, ipfs
hyperhyperspace-core
A library to create p2p applications, using the browser as a full peer.
Stars: ✭ 112 (+128.57%)
Mutual labels:  p2p, crdt
Openbazaar Desktop
OpenBazaar 2.0 Desktop Client (talks to openbazaar-go server daemon)
Stars: ✭ 597 (+1118.37%)
Mutual labels:  p2p, ipfs
Js Ipfs
IPFS implementation in JavaScript
Stars: ✭ 6,129 (+12408.16%)
Mutual labels:  p2p, ipfs
Filenation
The simplest way to send your files around the world using IPFS. ✏️ 🗃
Stars: ✭ 805 (+1542.86%)
Mutual labels:  p2p, ipfs
Rust Ipfs
The InterPlanetary File System (IPFS), implemented in Rust.
Stars: ✭ 739 (+1408.16%)
Mutual labels:  p2p, ipfs
Ipfs Webui
A frontend for an IPFS node.
Stars: ✭ 990 (+1920.41%)
Mutual labels:  p2p, ipfs
Ipfs Desktop
An unobtrusive and user-friendly desktop application for IPFS on Windows, Mac and Linux.
Stars: ✭ 3,710 (+7471.43%)
Mutual labels:  p2p, ipfs
Awesome Decentralized
🕶 Awesome list of distributed, decentralized, p2p apps and tools 👍
Stars: ✭ 358 (+630.61%)
Mutual labels:  p2p, ipfs
orbit-core
Orbit communication protocol and library
Stars: ✭ 70 (+42.86%)
Mutual labels:  ipfs, p2p
mute-structs
MUTE-structs is a Typescript library that provides an implementation of the LogootSplit CRDT algorithm.
Stars: ✭ 14 (-71.43%)
Mutual labels:  p2p, crdt
js-http-client
[DEPRECATED] Official Textile JS HTTP Wrapper Client
Stars: ✭ 29 (-40.82%)
Mutual labels:  ipfs, p2p
Openbazaar Go
OpenBazaar 2.0 Server Daemon in Go
Stars: ✭ 919 (+1775.51%)
Mutual labels:  p2p, ipfs
Peergos
A p2p, secure file storage, social network and application protocol
Stars: ✭ 895 (+1726.53%)
Mutual labels:  p2p, ipfs

y-ipfs-connector

NOT BEING ACTIVELY MAINTAINED

IPFS Connector for Yjs

(Demo video)

Use it!

Retrieve this with npm:

$ npm install y-ipfs-connector --save

Example

// you need to create and inject a IPFS object
const IPFS = require('ipfs')

const Y = require('yjs')
require('y-ipfs-connector')(Y)

// other Yjs deps:
require('y-memory')(Y)
require('y-array')(Y)
require('y-text')(Y)


// create IPFS node
const ipfs = new IPFS({
  EXPERIMENTAL: {
    pubsub: true // need this to work
  }
})

Y({
  db: {
    name: 'memory'
  },
  connector: {
    name: 'ipfs', // use the IPFS connector
    ipfs: ipfs, // inject the IPFS object
    room: 'Textarea-example-dev'
  },
  sourceDir: '/bower_components', // location of the y-* modules
  share: {
    textarea: 'Text' // y.share.textarea is of type Y.Text
  }
}).then(function (y) {
  // bind the textarea to a shared text element
  y.share.textarea.bind(document.getElementById('textfield'))
}

Signature

options.sign

You can sign messages. For that, you have to provide a sign option, which needs to be a function that accepts a message (string) and calls back with a buffer containing the signature for it (string):

Y({
  connector: {
    name: 'ipfs',
    sign: (m, callback) => { ... }
    // ...
  }
  // ...
})

Using this, messages will be sent alongside with a signature, which can be validated.

options.verifySignature

You can also verify a signature for a given message by providing a function like this:

Y({
  connector: {
    name: 'ipfs',
    verifySignature: (peer, message, signature, callback) => { ... }
    // ...
  }
  // ...
})

options.encode

Optional function that receives the message and encodes it. Useful if you want to encrypt the content before sending.

options.encode = (message) => {
  return encrypt(message)
}

options.decode

Optional function that receives the message and decodes it. Useful if you want to decrypt the content after receiving.

options.decode = (message) => {
  return decrypt(message)
}

Debug

Activate y-ipfs-connector on debug to see log messages.

License

MIT

Contribute

Feel free to join in. All welcome. Open an issue!

This repository falls under the IPFS Code of Conduct.

License

MIT

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].