An email came in! Huzzah!!
“Is mrh.io relying on IPFS? If the answer is yes, could you say how is it that fast?”
Omar and I had a nice exchange via e-mail and like a true friend he encouraged me to publish my process on the site. Here goes.
This will be a two-part series. Part 1 will cover the basics, and Part 2 will cover Private IPFS networks.
So, the answer is yes! This site is hosted on IPFS. IPFS is great for hosting static content out of the box, and with tools like OrbitDB, you can work towards creating dynamic, decentralized apps hosted on IPFS.
This guide focuses on the former, and this is accomplished in a few major steps.
ipfs add /path/to/contentThis should be wherever your
It might take a second, but you should be able to more or less immediately view that content on any public gateway. Here are a few:
We could stop here, but IPFS urls can be ugly. Eventually you’ll want to use your own
domain name. This is accomplished via a technique called
_dnslink, which require
two custom DNS records:
Arecord, pointing to the IP address of your domain name, e.g. yourdomain.com.
which contains the content id, like/ipfs/QmdGMhGo8qAv9uxhn2gWfMkM57ubfpM386wNz3GqPatT2H
. Note the/ipfs/` prefix.
You can point the
A record at https://ipfs.io, but you don’t control the garbage
collection on that ndoe, so you can’t guarantee your content will last longer than
When you update your content, you will need to change that
TXT record every time,
since each version of the content will have a different hash. You can avoid this
by using IPNS.
I recommend creating a new key for each domain name you want to publish and using those:
$ ipfs key gen --type=rsa --size=4092 yourdomain.com $ ipfs name publish --key=yourdomain.com QmdGMhGo8qAv9uxhn2gWfMkM57ubfpM386wNz3GqPatT2H
TXT record for
\_dnslink.yourdomain.com might look like
/ipns/QmdGMhGo8qAv9uxhn2gWfMkM57ubfpM386wNz3GqPatT2H (not a real IPNS name)
This tends to be slow - as you are publishing out a name and then resolving it via a consensus network of hundreds, maybe even in the thousands, of peers.
If this is all satisfactory, you can stop. But, if you want instant IPNS publication and resolution, and don’t mind a big trade-off, you can try using a private network.
Read more about private IPFS networks in part 2.