(I was actually about to post this under The Gallery until I saw that this category existed)
How to make a CDN using IPFS
Note: You might not want to do this on Glitch, because, well projects sleep after 5m (without boosted) and also this could be considered abusing the platform.
Things you’ll need:
Go-IPFS
Edit: js-ipfs can also work! npm install -g ipfs. It does compile stuff using node-gyp tho.
1+ computers with Go-IPFS installed.
Directions:
Setup the First Server:
Run ipfs daemon to start the IPFS daemon. If you skip this step, the following directions will fail to work.
Change Directions (cd) to the folder where your file/folder is located at.
Type the command ipfs add [File/Folder Name]. The response you get should look something like this.
QmYwAPJzv5CZsnA625s3Xf2nemtYgPpHdWEz79ojWnPbdG
// This is called a hash.
Take that response (hash) and then run ipfs pin [HASH].
Now that you got the file on the network, go to the other servers and run ipfs pin [HASH].
I also noticed that once it is loaded once, it is loaded forever. I had to basic use curl to get all the files to work. But, there are still some loads. This is a video that I upload. And it is like using 3G on YT today.
So, I was able to load it. Ima restart my machine to see if that helps. My console is bricked. So as of rn, best I can do is hope that my machine is not corrupted. Everything else on it works. The commands just have no response.