IPFS is a thing

The timing of this couldn’t be any better.

Just as VCC is gearing up a round of articles on building distributed applications via ethereum blockchan, progressive web applications, and virtual worlds via janus vr. All of which distributed over pure serverless (not FaaS) systems like IPFS.

This news drops:

Cloudflare, not only does it do DNS, WAF, and web caching. They’re now actually hosting a distributed filesystem that’s the aws s3 killer known as Interplanetary file system

Why use IPFS?

While one still needs a database, gateway server for legacy systems, and search server for applications. The need for application servers is becoming quickly obsolete. Now that we have ReactJS IPFS Etherum Stack which allows one to build full progressive web apps that live on a distributed cloud of p2p nodes much like bittorrent does for media but now for your site, app, or anything else one want’s to produce.

Could one still use a web server or “free hosting” like github pages? Sure but those are subject to outages, malware, and other issues.

Cloudflair’s IPFS

One can now browse files stored on IPFS easily and securely with Cloudflare’s Distributed Web Gateway without downloading software. Serve your own content hosted on IPFS from a custom domain over HTTPs.

All you need is a domain name you own, access to your DNS records, and the hash of the content stored on IPFS. More in-depth instructions, including how to get your content onto IPFS in the first place, can be found later in this series.

Here are the key steps to take:

  1. Go to your DNS settings for your domain. If your website is on Cloudflare, the DNS settings are accessible from your dashboard. If your website is not on Cloudflare, and you need help finding the DNS records, look here .
  2. Add a CNAME record from your domain (e.g. www.example.com) to cloudflare-ipfs.com. Note: if your website is on Cloudflare, the little cloud next to this record will automatically turn gray. Because you’ve CNAME’d to our gateway, you’ll automatically receive Cloudflare’s enterprise-level performance and security enhancements, but you won’t be able to control those settings yourself.
  3. Add a TXT record with the name _dnslink.your.website and value dnslink=/ipfs/<your_ipfs_hash_here>
    Once you have added those records, type your domain name (e.g. www.example.com) into the text box at cloudflare and click Submit.

This will do two things, one setup the needed DNS records for IPFS to know which address to server then generate an SSL certificate, which will allow traffic from your domain to be served securely over HTTPS. Be prepared to wait up to 90 seconds.

You will receive a confirmation message when the certificate has been successfully issued. When you see that message the certificate has been issued, and any request to https://www.example.com will automatically resolve to https://cloudflare-ipfs.com/ipfs/<your_ipfs_hash_here>.

Additional Resources

Related Dockerfiles can be downloaded from our github and the lab article is under draft right now and will be out shortly along with the class on the calendar.

1 Like