8.0.8 • Published 1 year ago

ipfs-coord v8.0.8

Weekly downloads
60
License
MIT
Repository
github
Last release
1 year ago

ipfs-coord logo

ipfs-coord

This is a JavaScript npm library built on top of js-ipfs. It provides the following high-level features:

  • Subnets - Helps IPFS nodes create an on-the-fly subnetwork, using pubsub channels.
  • Peer Discovery - Allows new peers entering the subnetwork to find the other subnetwork peers.
  • E2EE - Creates end-to-end encrypted (e2ee) communication channels between peers.
  • Censorship Resistance - Allows automatic networking between peers, even if they are behind a firewall.
  • Payments - Allows peers to easily pay one another in cryptocurrency for access to web services.

This library will help IPFS peers discover one another, coordinate around a common interest, and then stay connected around that interest. It's main sub-components are:

  • IPFS pubsub channels for communication
  • OrbitDB for persistence and to prevent 'dropped messages'
  • Circuit Relays for censorship resistance and tunneling through firewalls
  • Bitcoin Cash for end-to-end encryption and payments.

This library will automatically track peers, connects to them through circuit-relays, and end-to-end encrypts all communication with each node. For more details, read the ipfs-coord specification.

Here are some use cases where IPFS node coordination is needed:

  • e2e encrypted chat
  • Circuit-relay as-a-service
  • Creating CoinJoin transactions
  • Decentralized exchange of currencies
  • Compute-as-a-service
  • Storage-as-a-service

The ultimate goal for this library is to be a building block for building a replacement to the conventional REST API. APIs like REST or gRPC are incredibly valuable, but suffer from the same censorship risks as the rest of the web (location-based addressing). An IPFS-based API, in a fully distributed network like IPFS, must have sophisticated coordination in order for it to function properly. ipfs-coord is that coordination library.

Here is some videos and blog posts that preceded this work:

Additional content that preceded this work:

A live demo of using this library to build an e2e encrypted chat app can be interacted with here:

Install

Install the npm library: npm install --save ipfs-coord

This library requires a peer dependency of:

Example in a node.js app:

Here is an example of adding ipfs-coord to your own node.js app:

const IPFS = require('ipfs')
const BCHJS = require('@psf/bch-js')
const IpfsCoord = require('ipfs-coord')

async function start() {
  // Create an instance of bch-js and IPFS.
  const bchjs = new BCHJS()
  const ipfs = await IPFS.create()

  // Pass bch-js and IPFS to ipfs-coord when instantiating it.
  const ipfsCoord = new IpfsCoord({
    ipfs,
    bchjs,
    type: 'node.js'
  })

  await ipfsCoord.start()
  console.log('IPFS and the coordination library is ready.')
}
start()

Example in a browser app:

This example is exactly the same, except when instantiating the ipfs-coord library, you want to specify the type as browser.

import IPFS from 'ipfs'
import BCHJS from '@psf/bch-js'
import IpfsCoord from 'ipfs-coord'

async function start() {
  // Create an instance of bch-js and IPFS.
  const bchjs = new BCHJS()
  const ipfs = await IPFS.create()

  // Pass bch-js and IPFS to ipfs-coord when instantiating it.
  const ipfsCoord = new IpfsCoord({
    ipfs,
    bchjs,
    type: 'browser'
  })

  await ipfsCoord.start()
  console.log('IPFS and the coordination library is ready.')
}
start()

Development Environment

Setup a development environment:

git clone https://github.com/christroutner/ipfs-coord
cd ipfs-coord
npm install
npm test

Licence

MIT

8.0.8

1 year ago

8.0.7

1 year ago

8.0.6

1 year ago

8.0.5

2 years ago

7.1.7

2 years ago

7.1.9

2 years ago

7.1.8

2 years ago

8.0.4

2 years ago

7.1.13

2 years ago

7.1.14

2 years ago

7.1.11

2 years ago

7.1.12

2 years ago

7.1.10

2 years ago

7.1.19

2 years ago

7.1.17

2 years ago

7.1.18

2 years ago

7.1.15

2 years ago

7.1.16

2 years ago

8.0.1

2 years ago

8.0.3

2 years ago

8.0.2

2 years ago

7.1.6

2 years ago

7.1.5

2 years ago

7.1.4

2 years ago

7.1.3

2 years ago

7.1.2

2 years ago

7.1.1

2 years ago

7.1.0

2 years ago

6.7.6

2 years ago

6.7.5

2 years ago

6.8.12

2 years ago

6.8.11

2 years ago

6.8.10

2 years ago

6.8.1

2 years ago

6.8.0

2 years ago

6.8.3

2 years ago

6.8.2

2 years ago

6.8.5

2 years ago

6.8.4

2 years ago

6.8.7

2 years ago

6.8.6

2 years ago

6.8.9

2 years ago

6.8.8

2 years ago

6.7.4

2 years ago

6.7.3

3 years ago

6.7.2

3 years ago

6.7.0

3 years ago

6.7.1

3 years ago

6.6.8

3 years ago

6.6.7

3 years ago

6.6.5

3 years ago

6.6.6

3 years ago

6.6.1

3 years ago

6.6.0

3 years ago

6.6.3

3 years ago

6.6.2

3 years ago

6.6.4

3 years ago

6.5.6

3 years ago

6.5.7

3 years ago

6.5.4

3 years ago

6.5.5

3 years ago

6.5.2

3 years ago

6.5.3

3 years ago

6.5.0

3 years ago

6.5.1

3 years ago

6.4.1

3 years ago

6.4.0

3 years ago

6.3.0

3 years ago

6.1.4

3 years ago

6.1.3

3 years ago

6.2.0

3 years ago

6.1.6

3 years ago

6.1.5

3 years ago

6.1.8

3 years ago

6.1.7

3 years ago

6.1.0

3 years ago

6.1.2

3 years ago

6.1.1

3 years ago

6.0.0

3 years ago

4.0.3

3 years ago

4.0.2

3 years ago

5.0.0

3 years ago

4.0.1

3 years ago

4.0.0

3 years ago

3.2.0

3 years ago

3.1.0

3 years ago

3.0.8

3 years ago

3.0.7

3 years ago

3.0.9

3 years ago

3.0.6

3 years ago

3.0.5

3 years ago

3.0.4

3 years ago

3.0.3

3 years ago

3.0.2

3 years ago

1.0.1

3 years ago

2.2.11

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago

2.2.10

3 years ago

2.2.7

3 years ago

2.2.9

3 years ago

2.2.8

3 years ago

2.2.1

3 years ago

2.2.3

3 years ago

2.2.2

3 years ago

2.2.5

3 years ago

2.2.4

3 years ago

2.2.6

3 years ago

2.2.0

3 years ago

2.1.9

3 years ago

2.1.12

3 years ago

2.1.13

3 years ago

2.1.10

3 years ago

2.1.11

3 years ago

2.1.8

3 years ago

2.1.6

3 years ago

2.1.7

3 years ago

2.1.5

3 years ago

2.1.2

3 years ago

2.1.1

3 years ago

2.1.4

3 years ago

2.1.3

3 years ago

2.0.4

3 years ago

2.1.0

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.3.13

3 years ago

1.3.12

3 years ago

1.3.11

3 years ago

1.3.10

3 years ago

1.3.9

3 years ago

1.3.8

3 years ago

1.3.7

3 years ago

1.3.6

3 years ago

1.3.5

3 years ago

1.3.4

3 years ago

1.3.3

3 years ago

1.3.2

3 years ago

1.3.1

3 years ago

1.3.0

3 years ago

1.2.5

3 years ago

1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago