|
16 | 16 |
|
17 | 17 | processes = {
|
18 | 18 | prepare-devnet = {
|
19 |
| - command = "${self}/demo/prepare-devnet.sh"; |
| 19 | + # Run with Nix-provided bash to avoid shebang/env issues in sandboxes |
| 20 | + working_dir = "."; |
| 21 | + command = '' |
| 22 | + ${pkgs.bash}/bin/bash ${self}/demo/prepare-devnet.sh |
| 23 | + ''; |
20 | 24 | };
|
21 | 25 | cardano-node = {
|
| 26 | + # Ensure relative paths resolve against the same directory as prepare-devnet |
| 27 | + working_dir = "."; |
22 | 28 | command = ''
|
23 | 29 | ${pkgs.cardano-node}/bin/cardano-node run \
|
24 | 30 | --config devnet/cardano-node.json \
|
|
33 | 39 | depends_on."prepare-devnet".condition = "process_completed";
|
34 | 40 | };
|
35 | 41 | seed-devnet = {
|
| 42 | + # Needs the same working directory as prepare-devnet to find devnet files |
| 43 | + working_dir = "."; |
36 | 44 | command = ''
|
37 | 45 | ${self}/demo/seed-devnet.sh ${pkgs.cardano-cli}/bin/cardano-cli ${self'.packages.hydra-node}/bin/hydra-node
|
38 | 46 | '';
|
|
45 | 53 | checkPhase = ""; # not shellcheck and choke on sourcing .env
|
46 | 54 | text = ''
|
47 | 55 | # (Re-)Export all variables from .env
|
48 |
| - set -a; source .env; set +a |
| 56 | + set -a; [ -f .env ] && source .env; set +a |
49 | 57 | ${self'.packages.hydra-node}/bin/hydra-node \
|
50 | 58 | --node-id 1 \
|
51 | 59 | --listen 127.0.0.1:5001 \
|
|
67 | 75 | --contestation-period 3s
|
68 | 76 | '';
|
69 | 77 | };
|
| 78 | + working_dir = "."; |
70 | 79 | ready_log_line = "NodeIsLeader";
|
71 | 80 | depends_on."seed-devnet".condition = "process_completed";
|
72 | 81 | };
|
|
77 | 86 | checkPhase = ""; # not shellcheck and choke on sourcing .env
|
78 | 87 | text = ''
|
79 | 88 | # (Re-)Export all variables from .env
|
80 |
| - set -a; source .env; set +a |
| 89 | + set -a; [ -f .env ] && source .env; set +a |
81 | 90 | ${self'.packages.hydra-node}/bin/hydra-node \
|
82 | 91 | --node-id 2 \
|
83 | 92 | --listen 127.0.0.1:5002 \
|
|
99 | 108 | --contestation-period 3s
|
100 | 109 | '';
|
101 | 110 | };
|
| 111 | + working_dir = "."; |
102 | 112 | ready_log_line = "NodeIsLeader";
|
103 | 113 | depends_on."seed-devnet".condition = "process_completed";
|
104 | 114 | };
|
|
109 | 119 | checkPhase = ""; # not shellcheck and choke on sourcing .env
|
110 | 120 | text = ''
|
111 | 121 | # (Re-)Export all variables from .env
|
112 |
| - set -a; source .env; set +a |
| 122 | + set -a; [ -f .env ] && source .env; set +a |
113 | 123 | ${self'.packages.hydra-node}/bin/hydra-node \
|
114 | 124 | --node-id 3 \
|
115 | 125 | --listen 127.0.0.1:5003 \
|
|
131 | 141 | --contestation-period 3s
|
132 | 142 | '';
|
133 | 143 | };
|
| 144 | + working_dir = "."; |
134 | 145 | ready_log_line = "NodeIsLeader";
|
135 | 146 | depends_on."seed-devnet".condition = "process_completed";
|
136 | 147 | };
|
|
187 | 198 | cardano-node --version
|
188 | 199 |
|
189 | 200 | echo "--- Testing demo setup"
|
190 |
| - ${self}/demo/prepare-devnet.sh |
| 201 | + ${pkgs.bash}/bin/bash ${self}/demo/prepare-devnet.sh |
191 | 202 | echo "✅ Demo setup completed successfully"
|
192 | 203 |
|
193 | 204 | echo "--- Testing that devnet files exist"
|
|
0 commit comments