How to use Cloud-init to deploy pool servers in minutes

I created a tool that helps you to deploy a Cardano node server in minutes with no configuration. It works by generating a Cloud-init YAML file that can then be used to launch a new server instance. This does all the setup of the node while the server boots for the first time.

What is Cloud-init?

Cloud-init is the industry standard method for cloud instance initialization. It allows users to provide their own YAML template which will run on a server’s initial boot. This template can provide instructions to the server, telling it to create users, write files, and run commands.

How does it work?

The tool will generate Cloud-init YAML files based on the configuration you choose. These files are then used when initializing your block and relay servers. You simply generate a config, paste that YAML into the ‘User Data’ section when creating a new server with nearly any cloud provider, and within minutes you’ll be up and running - no need to install anything further.

Initial node installation - runs on first boot

  • Updates all packages on the server and installs a handful of useful packages like jq, rsync, curl, zip, etc.

  • Creates a user on the server named cardano. This user can login using only the SSH key you provided.

  • Writes a new SSH config which disables passwords, disables root, and changes SSH port.

  • Installs and configures fail2ban.

  • Writes aliases and environment variables to an environment file, which get loaded into bashrc for the cardano user.

  • Downloads Cardano config files from hydra.iohk.io.

  • Downloads and install cardano-node and cardano-cli binaries from hydra.iohk.io.

  • Creates cardano-node system service, enables and starts.

  • Sets initial firewall settings and enables firewall.

Once the initial node installation step is complete, cardano-node is all setup and the blockchain should be syncing. This first step takes less than 5 minutes and happens entirely in the background when the server boots.

Setup Scripts (optional)

  • Provides a few simple helpers/utility scripts for node management.

  • Provides a step-by-step walk through of setting up block and relay nodes.

  • Relay nodes will prompt for the block’s IP, then set the topology & firewall respectively, and add topology update/pull scripts.

  • Block node will prompt through registering the pool and then set topology & firewall.

No commands need to be run on either node to setup. You’ll only need to download and execute a file for each step on your cold machine (its all zipped for you).

I’m still working to improve documentation and have a few items on my ‘coming soon’ list - but I am interested in hearing any feedback and/or suggestions from experienced SPO’s and the rest of the community.

Check out this video demo, it probably does a better job showing what I am trying to explain here - Install and Setup Cardano Stake Pool Node Using Cloud-init in Less Than 15 mins - YouTube

GitHub for the script that generates the Cloud-init YAML - GitHub - gregreindel/cardano-node-cloud-init: Generate Cloud-init files for creating Cardano node servers

Web UI for generating the Cloud-init files - https://app.cardanocloudinit.com/

1 Like

It is just amazing!
Allow me some time/days to try it.

Quick question , Can we think doing the same with ansible?

I’m not familiar with ansible, but from a quick look it seems possible. It is also a YAML format, so i expect you can create something pretty similar.

The site cardanocloudinit.com doesn’t work now. when you click generate, it doesn’t Generate. it stays on the same form page.

Sorry about that. It should be back up now. I have been making some updates this week, and seem to have knocked it down.

Let me know if you have and issues or questions. Any feedback is appreciated!

1 Like

Thanks GregR Working great, Side question, the Monitor script for a monitor node, it was very clear to me on its purpose and how it should be used! can you shed some light, possibly add something in the description page, its not mentioned on the video.

Glad it worked!

I am working on updated documentation. I’ll try to push some today - there has been a ton of updates since its initial release.

Its a good guide, helps a lot, even though I set on up Manually a few months back, this allowed me to get up and running in a more uniformed fashion, I think moving forward, there is a couple of things that I am still struggling with.

  1. Monitoring, IE Prometheus or other option.
  2. Connecting the BP to the Relay after sync, Though I know this one, would make sense to complete the documentation.
  3. How to read the View, so we can know its a healthy up to sync node. (For example, in my case. Chain density is 4.8% which is healthy. but the Epoch number is stationary at 217, which makes me question, is the node up to date or not.
  4. Including gLiveView in the build would be useful. at the moment I am working on getting this working, but on digital ocean, its not connecting for some reason, and the port 6000 is not open to the outside, just another issue that may be due to DO setup.
    These last 2 items i am looking into, if I get clarity on my issue here, ill add a note below.

Further, I notice the UFC set to 3001 but the start up node is setting the port to 6000, what makes sense is on the Relay set the ufc and start up to 3001, and the BP to 6000 for the saperation.
Possible options to put into the Web page would be to add, Relay IP and Port, BP IP and Port, then you can apply those to the ufw rules.
on BP:
sudo ufw allow from ${relay-ip} to any port ${BP-Port}
Adding an update Script cold really come in handy. I think from the current 1.30.0 I tried the gLiveView, and it bawks at the version difference.

@Geoffrey_Tipy thanks for the suggestions about configurable relay/block ports and the update script. I’m working on both of those now.

Meanwhile, I did update the scripts for generating the dashboard, and added some more documentation.

https://app.cardanocloudinit.com/help