SPK CDN setup step by step

2021-12-21T01:06:15
Greetings everyone. In this tutorial I will be going over the steps involved in setting up a SPK CDN node.

Step 1

Choosing your hosting provider

You'll need to pick out a good server hosting provider for your node. A couple of factors to keep in mind: cost, popularity/how much traffic you are expecting, and how performant you want it to be.
I will be using Kimsufi as an example here. I've used it many times before and for the price/performance they offer they are almost unbeatable.
NOTE: I'd strongly recommend renting a server as the software makes assumptions that might not work for self hosting or an already existing server. Specifically, the auto provisioning of letsencrypt and nginx. For anyone who is not doing advanced stuff, renting a server is what you will want to do.
Kimsufi offers two different regions: France and Canada. I'd suggest picking which ever is geographically closest to you. If you are in Asia there are other more regional providers to pick from, but it should still work regardless. Keep in mind the cheapest hosting providers I've used are typically located in Canada/EU.

I am going to be picking the KS-16. It has a good processer, good ram and plenty of storage space. And of course for a cheap price of $23/month!

Step 2: Initial setup

Generally speaking the hosting provider you go with will handle the installation of the OS and provisioning any necessary services for you. Once that is complete you will need to login via ssh to install the CDN software.
For Kimsufi you should see an email similar to the one below
You will use the above information to access the server. Most important things here are the username, IP address and link to retrieval your password. Make sure to make a safe copy of your server password as the link expires after a period of time.

Step 3a

Next up is actually logging in.
First you must open CMD (on windows), if you are on Linux I assume you are familiar with the terminal atleast a little bit ;)
You should see a prompt similar to this

Step 3b

Next type in your server's ssh info
NOTE: you need to replace the above IP address with the IP address of your server and retrieve the corresponding password from your hosting provider. In the case of Kimsufi the password can be retrieved from the email containing all the info about the server.

Step 3c

After that, press enter to login...

Step 4

Now you're actually going to do something useful!
bash <(curl -s https://raw.githubusercontent.com/3speaknetwork/cdn-daemon/main/scripts/install.sh)
Enter in the above command like shown in the image below, then press enter to initiate the installation. Note: this will install everything in the current folder. So whatever folder you are in a folder labeled "cdn-daemon" will show up after the installation is complete. For more advanced users you might want to run the install script in another folder more specific to your setup.
Quick run through of what the installation looks like in practice...
Finally, once finished, you should see something like this..
You should be able to access your node from the url after hostname:
Available endpoints:
  • /ipfs/ - standard ipfs endpoint for accessing files
  • /ipns/ - standard ipfs endpoint for accessing ipns files
  • /api - ipfs api endpoints
  • /thumb/<ipfs hash>?res=WidthxHeight - image proxy/resizer (wip), currently doesn't work on my server

Final comments

If you do decide to setup a node, please comment below how it it went and what your domain name is.
Later on, I will be making a tutorial on how to update your cdn node once that becomes applicable. Another tutorial for earning rewards as well (once available)
Happy hacking! Cheers!
181
12
567.73
12 Replies