Code Monkey home page Code Monkey logo

cohosting's Introduction

Experiment in MFS-based cohosting

Exploration around simple tools and conventions for cohosting existing websites with IPFS

Motivation

  • Make it easier for people to contribute storage and bandwidth to sites and datasets they care about
    • Support IPNS (libp2p keys) and DNSLink roots (human-readable)
    • Switch tools like ipfs-cohost and ipfs-companion from raw pins to MFS
  • Periodically detect updates to and preload them to a local node
  • Experiment in userland: make it easy to implement, no new APIs, reuse existing ones

Scope vs. Use Cases

See this analysis.

Specification

See SPEC.md

๐Ÿšง note: this is a draft, an early, exploratory experiment ๐Ÿšง

Feedback is welcome. Fill an issue!

Potential Implementations

This specification is not implemented yet. The following IPFS Shipyard projects could implement it:

๐ŸŽ = Not started
๐ŸŠ = In progress
๐Ÿ = Complete

๐ŸŠ cohosting.sh

MVP bash script that can be used for cli

  • add rm for adding / removing sites to cohosting list via commandline
  • sync a command to run cohosting check (for use in crond etc)
  • gc [n] drop all old snapshots (if n is provided, keeps that many snapshots per site)
  • Lazy cohosting

๐Ÿ ipfs-cohost

NPM-based interactive cli tool

  • switch from pin to MFS-based spec

๐ŸŽ ipfs-companion

browser extension

  • provides UI for adding / removing sites via browser action menu
  • runs cohosting check periodically

๐ŸŽ ipfs-desktop

desktop app and GUI for managing go-ipfs

  • runs cohosting check periodically

๐ŸŽ ipfs-webui

web frontend for IPFS node

  • provides UI for adding / removing sites to cohosting list as an experiment on Settings page

cohosting's People

Contributors

hacdias avatar lidel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cohosting's Issues

ipfs files cp does not ensure recursive content

While working on cohosting.sh and ipfs-cohost, I noticed ipfs files cp does not ensure recursive content. It just links the hash to a certain place in MFS and only fetches it if the user actually goes there.

Even though having a directory on MFS prevents it from being garbage collected, it does not get recursively fetched when copying for the first time.

/cc @lidel @autonome

Lazy cohosting

Technical Background

Things in MFS are implicitly pinned (won't be garbage collected).

Copying IPFS content paths to MFS (ipfs files cp /ipfs/{CID} /path/in/mfs) does not ensure recursive content is fetched and store in local repo. All cp does is to create entry in MFS and only fetches new blocks if the user actually goes there and requested block is not in the local repo.

That is why additional ipfs refs -r call is needed to ensure all blocks are prefetched nad present in the local repo (#4, #5)

Potential Use

Here's an idea: the lack of recursive fetch could be a feature that enables regular people to "cohost" parts of big websites such as https://ipfs.io/ipns/en.wikipedia-on-ipfs.org

Without explicit preload (#5) only the parts that were actually visited are stored in local repo, saving disk space and enabling cohosting of more content overall.

Challenges

The key challenge here is UX. Initial ideas:

  • how to communicate the difference between "full" and "lazy" cohosting?
  • how to enable user to make the decision?
    • when adding website via ipfs-companion user could be prompted if they want to cohost in "full" ("eager") or "lazy" fashion (while showing current total size of a website)
    • for adding website via CLI or programmatic interface, there should be a separate addLazy command that does not run ipfs refs -r

cc @meiqimichelle @hacdias @autonome

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.