Do you want to build a Skycoin Node?

Come on, let’s go and play!

BigOokie
4 min readSep 10, 2019

--

So you’ve decided you would like to build and host your very own Skycoin Node — but where to start — and how to do it securely?

Hosting a Skycoin Node is easy and very low maintenance – once you know how. By running a Skycoin Node you are also helping to decentralise the Skycoin platform – the more Nodes, the stronger and more decentralised the network becomes.

In this article I will outline a process (it’s not the only one) that I believe is simple and accessible for most.

Pre-requisites and assumptions

First there are a few requirements that I assume you have access to, or are able to get access to:

  1. A Linux Server that you can install software onto using the terminal shell (i.e. via SSH). I used Ubuntu Server. Skycoin Nodes don’t require a lot of power – so a Raspberry Pi is more than adequate.
  2. A Firewall that the Linux Server sits behind. You will need to port-forward ports 80 (HTTP) and 443 (HTTPS)
  3. A Domain that you own.
  4. A Cloudflare account that has been configured to manage the DNS for your domain (The free service is sufficient). The DNS for your Domain needs to point to the public IP of your Caddy Server.

Setup a Skycoin Node

First download, setup and install your own Skycoin Node on a private server that you own. Personally I run mine in a Docker container on the server where I deployed Caddy Server.

I wont go into detail about how to setup the Skycoin Node. The process isn’t difficult and is documented in the official Skycoin Project GitHub repo documentation (readme.md):

Once you have a private Skycoin Node setup and running, move to the next step.

Install Caddy on your Server

Go to the official Caddy Server Download site to create a custom download of Caddy Server including the modules required.

You will need to select:

  • Platform: Linux 64-bit (for Ubuntu)
  • Plugins: tls.dns.cloudflare
  • Telemetry: You decide
  • Plan: Select Personal (free)

At the bottom of the page will be a custom download link and a one-step installer script.

Copy and paste the one-step installer link onto your Caddy Server. This will download and install Caddy Server automatically.

Configure Caddy to proxy your Skycoin Node

Next you need to configure your Caddy to transparently proxy requests to your public domain onto your private Skycoin Node.

Setup the following environment variables to allow Caddy Server to talk with Cloudflare and manage the TLS certificates using LetsEncrypt — you can obtain the details from your Cloudflare account.

export CLOUDFLARE_EMAIL=your@email.comexport CLOUDFLARE_API_KEY={YOUR CLOUDFLARE API KEY}

Now we need to setup the configuration for Caddy — known as a Caddyfile (capitalisation is important). The following is a template for the Caddyfile I used:

node.domain.com {
tls {
dns cloudflare
}
proxy / xxx.xxx.xxx.xxx:6420 {
transparent
}
}

Create a file named Caddyfile and use the template provided above to configure Caddy. Replace the following with your own values:

node.domain.com -> set this to you public domainxxx.xxx.xxx.xxx -> set this to the IP address of your Skycoin Node

Start Caddy

Now start Caddy and start serving you Skycoin Node publicly and using secure TLS provided by LetsEncrypt.

To start the Caddy Server, run the following command in the same folder where the Caddyfile is located:

caddy

Caddy will start, load the configuration contained in the Caddyfile and attempt to obtain a new TLS certificate from LetsEncrypt using Cloudflare as the DNS provider.

All going well Caddy should report that its serving requests on ports 80 and 443.

If you need to run Caddy as a background service you can use the following command:

caddy&

Test access to your Skycoin Node

There are a number of ways you can test access to your Skycoin Node.

  1. Use the skycoin-cli tool. You will need to set the environment variable $RPC_ADDR to the URL of the domain you are serving your Skycoin Node on.
  2. Configure your Skycoin Mobile wallet to use the domain where you are serving your Skycoin Node.
  3. Read the Skycoin Node API documentation and use tools such as PostMan or curl to query the Skycoin Node directly.

Want to know more?

If you would like to find out more about Skycoin, Skywire, CX or any other aspect of these incredible projects, I have compiled a list of links which will help.

Website: https://www.skycoin.com/

Store: https://store.skycoin.com

Skycoin Telegram: https://t.me/Skycoin

Skywire Telegram: https://t.me/Skywire

Skycoin User Group: https://skywug.net/

Twitter: https://twitter.com/Skycoinproject

Skycoin Project GitHub: https://github.com/skycoinproject/

Reddit: https://reddit.com/r/Skycoin

If you found this useful, consider providing a tip of your own!

Skycoin: ES5LccJDhBCK275APmW9tmQNEgiYwTFKQF

--

--

BigOokie

#Skycoin #Skyfleet #WingCommander #Crypto #CX #Go #LearnShareRepeat