SiaCDN is a high-quality hosted Skynet node.
This repository is the complete set of scripts that is used to run this high-quality hosted Skynet node in your kubernetes cluster.
This repository can be used to easily deploy a Skynet node of your own on Kubernetes. Here's how:
- Fork this repo on GitHub. It'll just take a second - I'll wait!
- Navigate to your fork and continue reading this README there.
- Clone your fork of the repo and make the following configuration changes, or do it using GitHub's built-in editor.
- You should have Docker installed on your local machine.
- You should have access to a Kubernetes cluster, and have kubectl authenticated to connect to it.
- The Kubernetes cluster should use nginx ingress an installation of cert-manager with a cluster-issuer named
letsencrypt-prod. - You should have a domain configured to point to your Kubernetes cluster.
- Make a copy of
kube/secrets.yaml.templateand save it askube/secrets.yaml, then fill the values ofSIA_WALLET_PASSWORD_Nwith the result ofecho -n "YOUR SEED PHRASE HERE" | base64 -w0for as many viewers and uploaders as you want. - Choose API passwords for each of your nodes (e.g. random UUID) and fill in
SIA_API_PASSWORD_Nwith those values. Useecho -n "YOUR API PASSWORD HERE" | base64 -w0to base64 encode it for the yaml file. - Edit
SKYNET_HOSTNAMEandSKYNET_HOSTNAME_ALTinkube/config.yamlto set it to your domain instead of the defaults. - Edit the number of replicas in
kube/uploader.yamlandkube/viewer.yamlto match the number of secrets you filled in for step 2. - Edit the domains in
kube/ingress.yamlto point to your domain instead of the defaults. - Change the
storageClassNamein bothkube/uploader.yamlandkube/viewer.yamlto match the storage class in your kubernetes cluster. It may be that you want to simply delete thestorageClassNamelines, so that your default storage class will provision the volume claims. - Commit and push all these changes to your fork of this repo.
- Clone your fork of this repository and cd to the directory.
- Create the kubernetes resources from the local kube dir.
cd siacdn
kubectl create -f kube/
- Run siac wallet init and wait for consensus for the uploaders, checking using siac.sh:
kubectl exec -it siacdn-uploader-0 -c sia -- siac.sh wallet init
kubectl exec -it siacdn-uploader-0 -c sia -- siac.sh
Do the same for the viewers:
kubectl exec -it siacdn-viewer-0 -c sia -- siac.sh wallet init
kubectl exec -it siacdn-viewer-0 -c sia -- siac.sh
- Run siac wallet address to get an address for each node, and send that address some siacoins, probably 25K or so.
kubectl exec -it siacdn-uploader-0 -c sia -- siac.sh wallet address
- Run siac renter setallowance twice per viewer and uploader, with parameters detailed by Nebulous at the following link, but use your judgement and adjust limits to your setup:
https://github.com/NebulousLabs/skynet-webportal/tree/master/setup-scripts#portal-setup
kubectl exec -it siacdn-uploader-0 -c sia -- siac.sh renter setallowance
kubectl exec -it siacdn-uploader-0 -c sia -- siac.sh renter setallowance --payment-contract-initial-funding 10SC