Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
aciceri committed Nov 8, 2024
1 parent dd006ba commit d466639
Show file tree
Hide file tree
Showing 13 changed files with 8,715 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.direnv
**/producer
**/result
**/result
**/*.qcow2
9 changes: 6 additions & 3 deletions modules/block-producer-node/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,9 @@ in
};

configFilesPath = lib.mkOption {
type = lib.types.path;
description = "Path to the network configuration directory";
type = lib.types.nullOr lib.types.path;
default = null;
description = "Path to the network configuration directory. Optional, will use cardano-node service configuration if set to null.";
};
};
};
Expand All @@ -45,9 +46,11 @@ in
services.cardano-node = mkMerge [
{
enable = true;
}
(mkIf (cfg.configFilesPath != null) {
nodeConfigFile = "${cfg.configFilesPath}/configuration.yaml";
topology = "${cfg.configFilesPath}/topology-spo-1.json";
}
})
(mkIf (cfg.block-producer-key-path != null) {
signingKey = "${cfg.block-producer-key-path}/byron-gen-command/delegate-keys.000.key";
delegationCertificate = "${cfg.block-producer-key-path}/byron-gen-command/delegation-cert.000.json";
Expand Down
1 change: 1 addition & 0 deletions modules/install-script/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
# 4. use scp instead
nixos-anywhere \
--debug \
--store-paths ${config.system.build.diskoScript} ${config.system.build.toplevel} \
--kexec ${kexec-installer} \
-i "$ssh_key" \
--copy-host-keys \
Expand Down
9 changes: 9 additions & 0 deletions templates/hetzner/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# SPO-Anywhere on Hetzner Cloud

This Nix flake template installs a Stake Pool on Hetzner cloud using `spo-anywhere`.

## Prerequisites

To get started create an Hetzner cloud machine (tested with Ubuntu) and make sure you are able to connect as `root` with ssh.

You also need to generate a set of stake pool keys, you can follow our documentation section on [generating keys](https://mlabs-haskell.github.io/spo-anywhere/usage/generate-keys/).
24 changes: 24 additions & 0 deletions templates/hetzner/configuration.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{
networking.hostName = "spo-node-hetzner";

system.stateVersion = "24.11";

users.users.root.openssh.authorizedKeys.keys = [
"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCzCmDCtlGscpesHuoiruVWD2IjYEFtaIl9Y2JZGiOAyf3V17KPx0MikcknfmxSHi399SxppiaXQHxo/1wjGxXkXNTTv6h1fBuqwhJE6C8+ZSV+gal81vEnXX+/9w2FQqtVgnG2/mO7oJ0e3FY+6kFpOsGEhYexoGt/UxIpAZoqIN+CWNhJIASUkneaZWtgwiL8Afb59kJQ2E7WbBu+PjYZ/s5lhPobhlkz6s8rkhItvYdiSHT0DPDKvp1oEbxsxd4E4cjJFbahyS8b089NJd9gF5gs0b74H/2lUUymnl63cV37Mp4iXB4rtE69MbjqsGEBKTPumLualmc8pOGBHqWIdhAqGdZQeBajcb6VK0E3hcU0wBB+GJgm7KUzlAHGdC3azY0KlHMrLaZN0pBrgCVR6zBNWtZz2B2qMBZ8Cw+K4vut8GuspdXZscID10U578GxQvJAB9CdxNUtrzSmKX2UtZPB1udWjjIAlejzba4MG73uXgQEdv0NcuHNwaLuCWxTUT5QQF18IwlJ23Mg8aPK8ojUW5A+kGHAu9wtgZVcX1nS5cmYKSgLzcP1LA1l9fTJ1vqBSuy38GTdUzfzz7AbnkRfGPj2ALDgyx17Rc5ommjc1k0gFoeIqiLaxEs5FzDcRyo7YvZXPsGeIqNCYwQWw3+U+yUEJby8bxGb2d/6YQ=="
];

spo-anywhere = {
node = {
enable = true;
block-producer-key-path = "/var/lib/spo";
};
install-script = {
enable = true;
target = "[email protected]";
};
};

services.cardano-node = {
environment = "preview";
};
}
37 changes: 37 additions & 0 deletions templates/hetzner/disko.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
disko.devices = {
disk = {
main = {
type = "disk";
device = "/dev/sda";
content = {
type = "gpt";
partitions = {
boot = {
size = "1M";
type = "EF02";
priority = 1;
};
ESP = {
size = "512M";
type = "EF00";
content = {
type = "filesystem";
format = "vfat";
mountpoint = "/boot";
};
};
root = {
size = "100%";
content = {
type = "filesystem";
format = "ext4";
mountpoint = "/";
};
};
};
};
};
};
};
}
Loading

0 comments on commit d466639

Please sign in to comment.