@@ -5,9 +5,17 @@ import ./make-test.nix ({ pkgs, ... }: {
55 };
66
77 nodes = {
8+ # Testing the Byzantine Fault Tolerant protocol
89 bft = { ... }: {
910 environment.systemPackages = [ pkgs.jormungandr ];
11+ services.jormungandr.enable = true;
12+ services.jormungandr.genesisBlockFile = "/var/lib/jormungandr/block-0.bin";
13+ services.jormungandr.secretFile = "/etc/secrets/jormungandr.yaml";
14+ };
1015
16+ # Testing the Ouroboros Genesis Praos protocol
17+ genesis = { ... }: {
18+ environment.systemPackages = [ pkgs.jormungandr ];
1119 services.jormungandr.enable = true;
1220 services.jormungandr.genesisBlockFile = "/var/lib/jormungandr/block-0.bin";
1321 services.jormungandr.secretFile = "/etc/secrets/jormungandr.yaml";
@@ -17,6 +25,7 @@ import ./make-test.nix ({ pkgs, ... }: {
1725 testScript = ''
1826 startAll;
1927
28+ ## Testing BFT
2029 # Let's wait for the StateDirectory
2130 $bft->waitForFile("/var/lib/jormungandr/");
2231
@@ -45,5 +54,24 @@ import ./make-test.nix ({ pkgs, ... }: {
4554
4655 # Now we can test if we are able to reach the REST API
4756 $bft->waitUntilSucceeds("curl -L http://localhost:8607/api/v0/node/stats | grep uptime");
57+
58+ ## Testing Genesis
59+ # Let's wait for the StateDirectory
60+ $genesis->waitForFile("/var/lib/jormungandr/");
61+
62+ # Bootstraping the configuration
63+ $genesis->succeed("jormungandr-bootstrap -g -p 8607 -s 1");
64+
65+ # Moving generated files in place
66+ $genesis->succeed("mkdir -p /etc/secrets");
67+ $genesis->succeed("mv pool-secret1.yaml /etc/secrets/jormungandr.yaml");
68+ $genesis->succeed("mv block-0.bin /var/lib/jormungandr/");
69+
70+ # We should have everything to start the service now
71+ $genesis->succeed("systemctl restart jormungandr");
72+ $genesis->waitForUnit("jormungandr.service");
73+
74+ # Now we can create and delegate an account
75+ $genesis->succeed("./create-account-and-delegate.sh | tee -a /tmp/delegate.log");
4876 '';
4977})