Skip to content

Spinning up a new custom cluster

Jean-Baptiste Giraudeau edited this page Oct 14, 2020 · 6 revisions

First checkout cardano-ops, from there:

Create globals topology files from templates.

cp globals-shelley-dev.nix globals-<my env>.nix
ln -s globals-<my env>.nix globals.nix

cp topologies/shelley-dev.nix topologies/<my env>.nix

Then customize globals-<my env>.nix (at least environmentName to match <my env>) and topology/<my env>.nix as needed.

Enter the nix-shell

run

nix-shell

which will provides the correct environnement for deployment and also cardano-cli bash completion.

Generate Genesis and keys

create-shelley-genesis-and-keys

Deploy locally (libvirtd) or on AWS

For AWS deployment

./scripts/create-aws.sh

For libvirtd deployment:

First enable libvirtd for you system. On NixOS:

{ pkgs, lib, ... }:
{
  virtualisation.libvirtd.enable             = true;
  systemd.services.libvirtd.restartIfChanged = lib.mkForce true;
  networking.firewall.checkReversePath       = false;
  environment.systemPackages                 = with pkgs; [ virtmanager ];
}

Check that the default pool is available. Under root user:

# virsh pool-list
 Name                 State      Autostart 
-------------------------------------------
 default              active     yes

If default pool is not setup yet, run under root:

# virsh pool-define /dev/stdin <<EOF
<pool type='dir'>
  <name>default</name>
  <target>
    <path>/var/lib/libvirt/images</path>
  </target>
</pool>
EOF
# virsh pool-start default
# virsh pool-autostart default

Then:

./scripts/create-libvirtd.sh

After that, using the nixops deploy command directly is enough (cf. https://nixos.org/nixops/manual/).