Microbolt ❤️ Cloud

Ansible is a simple IT automation tool that can make your applications and systems easier to deploy. It is a powerful tool that can be used to automate the deployment and configuration of your Microbolt node(s).

Someone once said,

“Ain’t nobody got time to sit through RaspiBolt more than once. Once you’ve learned how to build a Bitcoin node with your hands the next ones should just build themselves.”

— 1ma (Unhosted Marcellus)

and here we are.

🚫

This guide assumes you have a basic understanding of Proxmox/Debian and can read basic shell commands or scripts, identify variables, and modify them as needed. Default values are provided for all variables, but you can customize them to suit your requirements. You don’t need to be a Proxmox/Debian expert, but you should be able to SSH into your system. Installing Proxmox/Debian is out of scope.

Prerequisites

Variables
VariableDescriptionDefault
blankBlank template ID9000
alpineAlpine template ID9010
storageStorage IDlocal-zfs
ssdSSD flag1
usernameCloud-init usernamesatoshi
ssh_keyfileSSH key file/etc/pve/priv/authorized_keys
passwordCloud-init passwordchangeme
microboltMicrobolt VM ID2140
nameMicrobolt VM namenakamoto01
coresMicrobolt VM cores4
memoryMicrobolt VM memory8192
vlanMicrobolt VM VLAN1
second_storageSecond storage IDlocal-zfs
second_ssdSecond SSD flag1

SSH into your Proxmox/Debian server and run the following commands.

Blank template

It is highly recommended to create a blank Linux template if you are using Proxmox/Debian. You’ll thank me later.

qm create "${blank:-9000}" \
    --name template \
    --ostype l26 \
    --agent enabled=1,fstrim_cloned_disks=1 \
    --cpu host \
    --balloon 0 \
    --vga serial0 \
    --scsihw virtio-scsi-pci \
    --net0 virtio,bridge=vmbr0,firewall=1 \
    --serial0 socket
qm template "${blank:-9000}"

Alpine cloud template

Clone the blank template

qm clone "${blank:-9000}" "${alpine:-9010}" \
    --name alpine-3.20 \
    --full

Download the cloud image

wget https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/cloud/\
nocloud_alpine-3.20.3-x86_64-bios-cloudinit-r0.qcow2

Create the Alpine cloud template

To use your own SSH keys from GitHub, simply replace <username> with your actual GitHub username.

wget -qO- https://github.com/<username>.keys > ./github_keys
export ssh_keyfile=./github_keys
qm set "${alpine:-9010}" \
    --scsi0 "${storage:-local-zfs}:0,import-from=$(pwd)/nocloud_alpine-3.20.3-x86_64-bios-cloudinit-r0.qcow2,iothread=1,discard=on,ssd=${ssd:-1}" \
    --ide0 "${storage:-local-zfs}:cloudinit" \
    --tags alpine \
    --ciuser "${username:-satoshi}" \
    --sshkeys "${ssh_keyfile:-/etc/pve/priv/authorized_keys}" \
    --cipassword "${password:-changeme}" \
    --ipconfig0 "ip6=auto,ip=dhcp" \
    --boot order=scsi0 \
    --ciupgrade 1 \
    --scsihw virtio-scsi-single
qm template "${alpine:-9010}"

Clean up

rm nocloud_alpine-3.20.3-x86_64-bios-cloudinit-r0.qcow2

Microbolt VM

Clone the Alpine cloud template

qm clone "${alpine:-9010}" "${microbolt:-2140}" \
    --name "${name:-nakamoto01}" \
    --full

Set the Microbolt VM

qm set "${microbolt:-2140}" \
    --onboot 1 \
    --cores "${cores:-2}" \
    --memory "${memory:-8192}" \
    --net0 "virtio,bridge=vmbr0,firewall=1,tag=${vlan:-1}" \
    --tags "alpine,microbolt"

Rezise the disk(s)

qm disk resize "${microbolt:-2140}" scsi0 2048G

Start the VM

qm start "${microbolt:-2140}"

Installation

Run the following commands on your main machine.

Install Ansible

apk add ansible

Clone the repository

git clone https://github.com/microbolt-guide/ansible.git && cd ansible

Configure the inventory

cp inventory/hosts.ini.example inventory/hosts.ini

Edit the hosts.ini file

vi inventory/hosts.ini

Configure the variables

Edit the global variables in group_vars/all.yaml file

vi inventory/group_vars/all.yaml

And/or modify for a single host, view examples inside the host_vars directory

cat inventory/host_vars/nakamoto01.yaml.example

Run the playbook

./deploy.sh

Start and enable the services

./services.sh start enable

DONE 🎉