|
5 | 5 | , runExplorer ? false
|
6 | 6 | , numCoreNodes ? 4
|
7 | 7 | , numRelayNodes ? 1
|
| 8 | +, numImportedWallets ? 11 |
8 | 9 | , assetLockAddresses ? []
|
9 | 10 | , system ? builtins.currentSystem
|
10 | 11 | , pkgs ? import localLib.fetchNixPkgs { inherit system config; }
|
11 | 12 | , gitrev ? localLib.commitIdFromGitRepo ./../../../.git
|
12 | 13 | , ghcRuntimeArgs ? "-N2 -qg -A1m -I0 -T"
|
13 | 14 | , additionalNodeArgs ? ""
|
14 | 15 | , keepAlive ? true
|
| 16 | +, disableClientAuth ? false |
15 | 17 | }:
|
16 | 18 |
|
17 | 19 | with localLib;
|
|
26 | 28 | };
|
27 | 29 | demoClusterDeps = with pkgs; (with iohkPkgs; [ jq coreutils pkgs.curl gnused openssl cardano-sl-tools cardano-sl-wallet-new cardano-sl-node-static ]);
|
28 | 30 | walletConfig = {
|
29 |
| - inherit stateDir; |
| 31 | + inherit stateDir disableClientAuth; |
30 | 32 | topologyFile = walletTopologyFile;
|
| 33 | + environment = "demo"; |
31 | 34 | };
|
32 |
| - demoWallet = pkgs.callPackage ./../connect-to-cluster ({ inherit gitrev; debug = false; environment = "demo"; } // walletConfig); |
| 35 | + demoWallet = pkgs.callPackage ./../connect-to-cluster ({ inherit gitrev; } // walletConfig); |
33 | 36 | ifWallet = localLib.optionalString (runWallet);
|
34 | 37 | ifKeepAlive = localLib.optionalString (keepAlive);
|
35 | 38 | iohkPkgs = import ./../../.. { inherit config system pkgs gitrev; };
|
@@ -137,19 +140,22 @@ in pkgs.writeScript "demo-cluster" ''
|
137 | 140 | done
|
138 | 141 | echo Blockchain Synced: $PERC%
|
139 | 142 | # import keys
|
140 |
| - echo "Importing poor HD keys/wallet..." |
141 | 143 |
|
142 |
| - for i in {0..11} |
143 |
| - do |
144 |
| - echo "Importing key$i.sk ..." |
145 |
| - curl https://localhost:8090/api/wallets/keys \ |
146 |
| - --cacert ${stateDir}/tls/client/ca.crt \ |
147 |
| - --cert ${stateDir}/tls/client/client.pem \ |
148 |
| - -X POST \ |
149 |
| - -H 'cache-control: no-cache' \ |
150 |
| - -H 'content-type: application/json' \ |
151 |
| - -d "\"${stateDir}/genesis-keys/generated-keys/poor/key$i.sk\"" | jq . |
152 |
| - done |
| 144 | + if [ ${builtins.toString numImportedWallets} -gt 0 ] |
| 145 | + then |
| 146 | + echo "Importing ${builtins.toString numImportedWallets} poor HD keys/wallet..." |
| 147 | + for i in {0..${builtins.toString numImportedWallets}} |
| 148 | + do |
| 149 | + echo "Importing key$i.sk ..." |
| 150 | + curl https://localhost:8090/api/wallets/keys \ |
| 151 | + --cacert ${stateDir}/tls/client/ca.crt \ |
| 152 | + --cert ${stateDir}/tls/client/client.pem \ |
| 153 | + -X POST \ |
| 154 | + -H 'cache-control: no-cache' \ |
| 155 | + -H 'content-type: application/json' \ |
| 156 | + -d "\"${stateDir}/genesis-keys/generated-keys/poor/key$i.sk\"" | jq . |
| 157 | + done |
| 158 | + fi |
153 | 159 | ${ifKeepAlive ''
|
154 | 160 | sleep infinity
|
155 | 161 | ''}
|
|
0 commit comments