Even the Artist Knows This is Terrible

A talented artist from Homewood, Illinois is either a brilliant satirist or a brilliant satirist who doesn’t know it yet.

Smartphone

独家优惠奖金 100% 高达 1 BTC + 180 免费旋转




How to Run Your Own Codius Host

And get paid for doing so!

In the smart program ecosystem that Codius creates, a relationship is established between hosts and developers that allows for a wealth of hosting options for the developer and allows the host to receive payment for hosting said code. For the aspiring Codius host, this post will explain the steps necessary to launch one for themselves.

You need to have a server to run Codius on, which should meet the following specs:

In addition to the server, you need:

For this tutorial, we’re assuming you are root. If you are logged in as another user, run sudo su to switch to the root user.

Before we start, we need to make sure our system hostname is correctly configured. Run the following command and replace codius.example.com with your Codius hostname.

Now we need to make sure the hostname is set correctly by running uname -n. This should print the hostname you just set:

Please make sure this command returns the correct hostname as we will be using it in some of the scripts later in this tutorial.

A Codius Host is comprised of three main components:

SSH into your CentOS server and install the following packages:

This will install all of our RPM dependencies for NodeJS and hyperd, as well as automatically forward ports from the hyperd pods. It will also launch hyperd and allow you to use the hypercli command line interface.

At this point, you will need your XRP Secret ready.

You can confirm the status of the daemon with systemctl status moneyd-xrp

Finally, create a file called codiusd.service with the following contents in /etc/systemd/system:

Then we need to edit this file to use our actual hostname.

Alternatively you can pull the example file and save in one command:

To start codiusd, you can run the following commands:

Your codiusd server will now be running on port 3000. Manifests can be uploaded via endpoints at this address.

You can check on the status of the server with the command systemctl status codiusd

To set up your domain for use with Codius, you will perform the following steps:

In order to run Codius, we need a primary hostname for our Codius host and we need any subdomains to point to our host also. For example, if your domain is example.com, you need to point codius.example.com to your Codius host, including any subdomains like xyz.codius.example.com.

To achieve that, we create two A records:

Replace codius.example.com with your Codius hostname and 203.0.113.1 with the IP address of your Codius host.

Make sure you can ping your Codius host under its new hostname:

And make sure it can be reached for any arbitrary subdomain as well:

Note that in both cases, the hostname resolved to our Codius host’s IP address, 203.0.113.1.

Now that our host is reachable, we’re ready to request a TLS certificate.

Certificates used to be expensive. Thankfully, these days you can get free certs from Let’s Encrypt. Please consider donating for this awesome service:

I’m going to donate 25$ right now. Meet you back here in a bit.

Ok, back? Let’s get started.

First, we need to download certbot and install some dependencies:

Now we are ready to request our certificate. Just run this command and follow the prompts.

Certbot will:

If you did everything correctly, you should get a message like:

If you got this far, give yourself a pat on the back. The tough part is over!

Note that your certificate is only valid for 90 days. We’ll cover how to set up automatic renewal in a future tutorial.

Now we need to set up Nginx which will act as a reverse proxy for our Codius host. Nginx will receive any incoming traffic and forward it to Codiusd.

The first step for installing Nginx on CentOS 7 is to enable the EPEL repository:

Then we can install Nginx itself.

To configure Nginx as a reverse proxy for Codius, create a file named /etc/nginx/conf.d/codius.conf with the following contents:

Once again, we need to replace example.codius.com with the actual hostname:

We need to make sure that SElinux is set to allow Nginx to act as a proxy:

Don’t worry if it tells you that SElinux is disabled. In that case, the command above isn’t needed but it also doesn’t hurt anything.

Finally, we need to start Nginx:

Your system may or may not come with firewalld preinstalled. If you find that you can’t access https://codius.example.com for your host, try this command to open port 443:

Now you should be able visit https://codius.example.com/version (replace codius.example.com with your hostname) and see output similar to this:

That’s it! Your Codius host is up and running. It will automatically try to connect to the Codius network and tell other hosts about its existence.

If you try to access https://codius.example.com and are getting this error, it means that your nginx is unable to connect to your codiusd. Check for the error in /var/log/nginx/error.log.

If you see a13: Permission denied like shown above, the likely culprit is SElinux. Run the following command:

Another common issue is that Codiusd is not listening:

In this case, check which processes are listening with netstat -tulpn:

If you don’t see 127.0.0.1:7768, that means that Moneyd is not listening. Go to the “Moneyd not listening” section below.

If you see 127.0.0.1:3000, but you don’t see 127.0.0.1:3000, that means that Moneyd is listening but Codiusd is not. Go to the “Codiusd not listening” below.

If you see 127.0.0.1:3000 but are still getting 111: Connection refused, then it is likely a firewall issue. Make sure you run these commands to properly configure your firewall:

Check if your Moneyd is running:

If it is running, try stopping it and running it in debug mode:

Once you’ve got Moneyd working on the command line, stop it (Ctrl+C) and run it as a service again:

In this case, check if Codiusd is running:

You can try restarting it:

Or check the logs for any useful information:

Add a comment

Related posts:

Blitz 2018 Fantasy Football Rankings

While these next couple months may be the slow days of the football year, we are thankful that fantasy football is here to satiate our hunger for the gridiron. I know I personally have been pouring…

Refermate 2020 Scholarship.

The one thing that drives us to learn and adapt in life, is information. Information has become so accessible that even babies have a ability to get their hands on it. With such a vast amount…

As the Wind Blows

Syelow opened the door to see Leo’s body lying and drooped off the couch. His mouth was open, releasing the thunderous snores. The hollow whiskey bottle sat on its side next to the ashtray…