IPFS For An Easy P2P Network
Recently I've been working on some software for myself that I've just got around to releasing for tracking Cycling Data, this is able to track data as well as import from the Free Software AAT app.
Besides working on personal tooling I've recently discovered IPFS a peer-to-peer networking tool from some friends on IRC. From that I'm learning about ways people can benefit from IPFS as well as some usecases for it other than just for fun, to which I'll go into more detail on later in the post.
What is IPFS?
IPFS is a distributed approach to the web, allowing networks of people to share resources and host full sites.
Installing And Setting Up IPFS
Follow the instructions on the website to install either desktop or command-line versions.
Accessing a site is simple;
- If you're using the command-line version, start the daemon and then visit the link provided.
- If you're using the desktop version, then just click whatever links you have and you should see it
The Command-Line Version
The Command-Line implementation is easy to understand if you already understand the UNIX filesystem;
- To look into a directory:
$ ipfs ls <hash>
- To see the contents of a file:
$ ipfs cat <hash>
- To Download the file:
$ ipfs get <hash>
- To add a file to the swarm:
$ ipfs add <file/path/locally>
- To add a directory and it's contents:
$ ipfs add -r <hash>
You should start to see the pattern here.
Why Use IPFS?
The question of why comes up any time there's new software to be used and adopted, so I'll list a few cases in which someone could benefit using IPFS.
Sharing Large Files
Let's say you're a game developer or working on some software that requires large assets to swapped fast for review, well something like IPFS would allow you as the developer or 3d sculptor to just upload the files to the swarm and give the hash over to whomever needs it. This is of course assuming everyone has it because when more people use it at the company the faster the network gets.
One of the biggest problems that comes to mind is security, and with things like file sharing that becomes a big concern which IPFS can help with. As long as you create your own swarm, the network is just within people that know about the swarm which means the assets aren't to be reached outside of the network. That example of the game company relates to this as well but also Legal Departments where sharing of files is important to your work and leaks or compromised data can lead to time lost and lawsuits.
If you're cheap, like me, then you probably would want to save money on sending and storing files. IPFS can act as a sort of local CDN that delivers files to people internally fast. If you work on website at a company, you wouldn't have to setup a whole server to test things on, the site and it's assets could be handled within the network with no servers.
Who Uses P2P (Peer-To-Peer) Networks?
Facebook for the longest time used BitTorrent and general P2P for their software deployments as well as for internal projects. Microsoft's Skype used P2P for video calling which allowed for faster connections than the hosted alternative and very little bandwidth for them to manage. A lot of these larger companies utilized P2P realizing it's capabilities so I wouldn't be surprised to it the second-wave of P2P networking in the public sphere.
I think IPFS is worth trying out or at least assessing if your company could benefit from using it.
I've gone ahead and setup a site as well as files within a private swarm with some people I know. It's easy, fun, and overall a good insight into a technology that could really change networking.