All Projects β†’ JoinColony β†’ pinion

JoinColony / pinion

Licence: MIT license
πŸ“ŒPin orbit-db stores and ipfs hashes

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language
Dockerfile
14818 projects

Projects that are alternatives of or similar to pinion

orbit-db-cli
CLI for orbit-db
Stars: ✭ 60 (+106.9%)
Mutual labels:  ipfs, orbit-db
field-manual
The Offical User's Guide to OrbitDB
Stars: ✭ 178 (+513.79%)
Mutual labels:  ipfs, orbit-db
example-orbitdb-todomvc
TodoMVC with OrbitDB
Stars: ✭ 17 (-41.38%)
Mutual labels:  ipfs, orbit-db
orbitdns
Distributed PKI based DNS
Stars: ✭ 23 (-20.69%)
Mutual labels:  ipfs, orbit-db
pinning-services-api-spec
New vendor-agnostic Pinning Service API for IPFS ecosystem
Stars: ✭ 48 (+65.52%)
Mutual labels:  ipfs, pinning
Vipfs
Vue.js + IPFS = VIPFS. Create unstoppable applications
Stars: ✭ 242 (+734.48%)
Mutual labels:  ipfs
dynamic-data-and-capabilities
[ARCHIVED] Dynamic Data and Capabilities in IPFS Working Group
Stars: ✭ 57 (+96.55%)
Mutual labels:  ipfs
Dweb.page
Your Gateway to the Distributed Web
Stars: ✭ 239 (+724.14%)
Mutual labels:  ipfs
photos
"Fx Fotos" is an opensource gallery app in react native with the same smoothness and features of Google Photos and Apple Photos. It is backend gnostic and connects to decentralized backends like "box", "Dfinity", "Filecoin" and "Crust".
Stars: ✭ 620 (+2037.93%)
Mutual labels:  ipfs
Agregore Browser
A minimal browser for the distributed web
Stars: ✭ 229 (+689.66%)
Mutual labels:  ipfs
insta-share
Instant File Sharing powered by IPFS Networks. Build with Vue 3 and ViteJS
Stars: ✭ 53 (+82.76%)
Mutual labels:  ipfs
trystero
🀝 Serverless WebRTC matchmaking for painless P2P β€” Make any site multiplayer in a few lines β€” Use BitTorrent, IPFS, or Firebase
Stars: ✭ 512 (+1665.52%)
Mutual labels:  ipfs
.com
Digital garden built using Next13, Typescript, and a bunch of goodies
Stars: ✭ 186 (+541.38%)
Mutual labels:  ipfs
Pathephone Desktop
Distributed audio player
Stars: ✭ 240 (+727.59%)
Mutual labels:  ipfs
ipfs-api-mount
Mount IPFS directory as local FS.
Stars: ✭ 16 (-44.83%)
Mutual labels:  ipfs
Photos
[DEPRECATED] Encrypted, secure, decentralized personal data wallet -- technology behind textile.photos
Stars: ✭ 236 (+713.79%)
Mutual labels:  ipfs
go-ipfs-plugin-i2p-gateway
A plugin for presenting an IPFS gateway over i2p
Stars: ✭ 14 (-51.72%)
Mutual labels:  ipfs
qd-messages-ts
No ads, no tracking. Just a lightning fast peer-to-peer cross-platform messenger that doesn’t sell you out.
Stars: ✭ 22 (-24.14%)
Mutual labels:  ipfs
piratcloud
an ipfs-based encrypted backup solution
Stars: ✭ 20 (-31.03%)
Mutual labels:  ipfs
go-ipfs
Ungx-ed fork of go-ipfs
Stars: ✭ 31 (+6.9%)
Mutual labels:  ipfs

Pinion

Pinion is a lightweight pinning service that supports both IPFS content and orbit-db stores. It relies solely on ipfs-pubsub-peer-monitor, orbit-db, and js-ipfs-http-client to communicate with an IPFS node.

Pinion can:

  • Pin IPFS content
  • Pin orbit-db store content
  • Keep listening to updates from any given orbit-db store

Installation

To install pinion, run:

yarn add global @colony/pinion

or

npm i -g @colony/pinion

Usage (for the impatient)

And then run pinion passing an IPFS node endpoint and a pinning room:

PINION_ROOM=YOUR_PINNING_ROOM pinion

In this configuration we're assuming some sensible defaults. See below.

Custom configuration

Pinion can be configured by either passing in the configuration programatically to its constructor (with the only required value being the room, see defaults in the example):

import Pinion from 'Pinion';

const pinner = new Pinion('YOUR_PINNING_ROOM', {
  ipfsRepo: './ipfs',
  ipfsPrivateKey: 'CAA...',
  maxOpenStores: 100,
  orbitDBDir: './orbitdb',
});

Or using environment variables when running it from the command line:

PINION_IPFS_CONFIG_FILE=./ipfsConfig.production.json PINION_ROOM=YOUR_PINNING_ROOM PINION_IPFS_REPO=./ipfs PINION_IPFS_PRIVATE_KEY="CAA..." PINION_MAX_OPEN_STORES=100 PINION_ORBIT_DB_DIR=./orbitdb pinion

PINION_ROOM

(required)

The IPFS pubsub room pinion is going to join and listen to new messages to.

PINION_MAX_OPEN_STORES

(optional)

You can also specify the limit of how many stores you wanna keep open simultaneously by passing in an environment variable MAX_OPEN_STORES. The stores will be automatically allocated using a LRU algorithm. The limit is by default set to 100 stores.

PINION_IPFS_CONFIG_FILE

(optional)

Define a config file to use (see ipfsConfig.production.example.json for an example).

PINION_IPFS_PRIVATE_KEY

(optional)

The private key that is used to initialize the IPFS repo. Will generate a random key when omitted.

PINION_IPFS_REPO

(optional)

You can specify the an IPFS repo path of your preference. The default is ./ipfs.

PINION_ORBIT_DB_DIR

(optional)

You can specify the orbit-db path option so stores data are kept in the place of your preference. The default is ./orbitdb

Debug

Pinion is still on its infancy and you might need debug info or a more detailed output to figure out if it misbehaves. To run it on verbose/debug mode, please also set an environment var like so DEBUG='pinner:*'.

API

Requests

REPLICATE

Opens a store, loads it and keep listening to it until it's being cleaned up by the LRU cache.

Parameters
  1. address - An orbit-db-store address.
Payload example
 {
   type: 'REPLICATE',
   payload: { address: '/orbitdb/Qma=/my-store' },
 };

PIN_HASH

Request the IPFS node to pin the content hash.

Parameters
  1. ipfsHash - An IPFS multihash. Emits a pinnedHash event passing the ipfs hash back.
Payload example
 {
   type: 'PIN_HASH',
   payload: { ipfsHash: 'Qma=...' },
 };

Responses

HAVE_HEADS

Published when the pinner has opened a store and it's ready. It will contain the count of heads that the pinner has for this store.

Payload example
 {
   type: 'HAVE_HEADS',
   to: '/orbitdb/Qma=/my-store',
   payload: {
     address: '/orbitdb/Qma=/my-store/<signature>',
     count: 100,
     timestamp: 10010203993
  },
 }
ANNOUNCE_PINNER

Published when the pinner has started, or in response to an ANNOUNCE_CLIENT message.

Payload example
 {
   type: 'ANNOUNCE_PINNER',
   payload: {
     ipfsId: 'Qm...',
  },
 }

Contributing

We welcome all contributions to Pinion. You can help by testing, suggesting new features, improving performance or documentation.

Please read our Contributing Guidelines for how to get started.

To run the tests

Start an ipfs node on localhost on port 4001. You can use the commands provided in the package.json using either yarn ipfsd-go or yarn ipfsd-js (Docker has to be running on your system).

Then, in another terminal window do:

yarn test

License

Pinion is MIT licensed

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].