ipfs / apps

Coordinating writing apps on top of ipfs, and their concerns.
60 stars 9 forks source link

ipfs swarm and ipfs-cluster #34

Open aronayne opened 8 years ago

aronayne commented 8 years ago

Is my premise correct :

Given three ipfs installations on same LAN : n1,n2,n3 (node1,node2,node3)

In order to connect these nodes together to form a 3 node 'cluster' I run:

on n1 ipfs swarm connect n2 ipfs swarm connect n3

But I could also have connected the nodes using :

on n2 ipfs swarm connect n1 ipfs swarm connect n3

or

on n3 ipfs swarm connect n1 ipfs swarm connect n2

So ipfs swarm connect is a bi-directional connection.

By 'connect' I mean when I execute 'ipfs add f1' on n1,n2 or n3 where f1 is a 1GB file , f1 will be split into three pieces distributed on nodes n1,n2,n3.

Is my premise correct ?

Is ipfs-cluster then a management tool for nodes connected via ipfs swarm ?

hsanjuan commented 8 years ago

IPFS runs autodiscovery (mDNS), so the nodes in your LAN would probably be autodiscovered first.

You can use ipfs swarm to manually open connections between nodes, but normally your nodes are discoverable to the network anyway as everyone uses the bootstrap nodes which facilitate this. If your nodes were completely isolated and did not connect to bootstrap nodes, then yes, ipfs swarm connect (any of your examples I think) would be the way to manually inform them that they have peers which are undiscoverable in any other way.

When you add your f1 1GB file, f1 is not split into 3 parts. If anything f1 will be chunked into blocks, but those blocks remain in the node you added the file and are only transmitted to a different node when they are requested from that node. There is no clustering/data-partitioning in the way I think you are expecting it.

ipfs-cluster as it is right now is just an idea (there is no tool atm) which we are going to work on. ipfs-cluster should allow to handle data mirroring among different nodes and to compose clusters of ipfs nodes by providing a ipfs api layer on top of them.