Skip to content

Commit 13a7fca

Browse files
authored
Merge pull request #2971 from input-output-hk/chore/ddw-1081-selfnode-installers
2 parents 371f705 + 9b7e95a commit 13a7fca

File tree

12 files changed

+247
-75
lines changed

12 files changed

+247
-75
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
- Added support for Ledger Nano S Plus ([PR 2975](https://github.com/input-output-hk/daedalus/pull/2975))
1212

13+
### Chores
14+
15+
- Published selfnode installers for all 3 platforms ([PR 2971](https://github.com/input-output-hk/daedalus/pull/2971))
16+
1317
## 4.10.0
1418

1519
### Features

README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,6 @@ If you get SSL error when running `nix-shell` (SSL peer certificate or SSH remot
105105
1. Run `yarn nix:testnet` from `daedalus`.
106106
2. Run `yarn dev` from the subsequent `nix-shell`
107107

108-
##### Staging
109-
110-
1. Run `yarn nix:staging` from `daedalus`.
111-
2. Run `yarn dev` from the subsequent `nix-shell`
112-
113-
##### Shelley QA
114-
115-
1. Run `yarn nix:shelley_qa` from `daedalus`.
116-
2. Run `yarn dev` from the subsequent `nix-shell`
117-
118-
##### Alonzo Purple
119-
120-
1. Run `yarn nix:alonzo_purple` from `daedalus`.
121-
2. Run `yarn dev` from the subsequent `nix-shell`
122-
123108
##### Native token metadata server
124109

125110
Daedalus, by default, uses the following metadata server for all networks except for the mainnet: `https://metadata.cardano-testnet.iohkdev.io/`.

default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ let
266266
pushd dlls
267267
${if dummyInstaller then "touch foo" else "unzip ${self.dlls}"}
268268
popd
269-
cp -v ${self.unpackedCardano}/bin/* .
269+
cp -vr ${self.unpackedCardano}/bin/* .
270270
cp -v ${self.nsisFiles}/{*.yaml,*.json,daedalus.nsi,*.key,*.cert} .
271271
cp ${self.uninstaller}/uninstall.exe ../uninstall.exe
272272
if [ -f ${self.nsisFiles}/block-0.bin ]; then

installer-clusters.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mainnet mainnet_flight testnet shelley_qa staging alonzo_purple
1+
mainnet selfnode mainnet_flight testnet

installers/common/MacInstaller.hs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,12 +330,19 @@ makeComponentRoot Options{oBackend,oCluster} appRoot darwinConfig@DarwinConfig{d
330330
-- Executables (from daedalus-bridge)
331331
forM_ ["cardano-wallet", "cardano-node", "cardano-cli", "cardano-address" ] $ \f ->
332332
cp (bridge </> "bin" </> f) (dir </> f)
333-
forM_ ["config.yaml", "genesis.json", "genesis-byron.json", "genesis-shelley.json", "genesis-alonzo.json", "topology.yaml" ] $ \f ->
333+
forM_ ["config.yaml", "genesis.json", "topology.yaml" ] $ \f ->
334334
cp f (dataDir </> f)
335+
when (oCluster /= Selfnode) $ do
336+
forM_ ["genesis-byron.json", "genesis-shelley.json", "genesis-alonzo.json" ] $ \f ->
337+
cp f (dataDir </> f)
335338

336339
when (oCluster == Selfnode) $ do
337340
cp "signing.key" (dataDir </> "signing.key")
338341
cp "delegation.cert" (dataDir </> "delegation.cert")
342+
cp (bridge </> "bin" </> "mock-token-metadata-server") (dir </> "mock-token-metadata-server")
343+
cp (bridge </> "bin" </> "token-metadata.json") (dataDir </> "token-metadata.json")
344+
cp (bridge </> "bin" </> "local-cluster--unwrapped") (dir </> "local-cluster")
345+
cptreeL (bridge </> "bin" </> "test" </> "data") (dataDir </> "data")
339346

340347
procs "chmod" ["-R", "+w", tt dir] empty
341348

@@ -362,6 +369,9 @@ makeComponentRoot Options{oBackend,oCluster} appRoot darwinConfig@DarwinConfig{d
362369
mapM_ sortaMove [ "HID.node" ]
363370
void $ chain (encodeString dir) [ tt $ dir </> "HID.node" ]
364371

372+
when (oCluster == Selfnode) $ do
373+
void $ chain (encodeString dir) $ fmap tt [ dir </> "mock-token-metadata-server", dir </> "local-cluster" ]
374+
365375
-- Prepare launcher
366376
de <- testdir (dir </> "Frontend")
367377
unless de $ mv (dir </> (fromString $ T.unpack $ dcAppName)) (dir </> "Frontend")

installers/common/WindowsInstaller.hs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,23 @@ writeInstallerNSIS outName (Version fullVersion') InstallerConfig{installDirecto
199199
file [] "config.yaml"
200200
file [] "topology.yaml"
201201
file [] "genesis.json"
202-
file [] "genesis-byron.json"
203-
file [] "genesis-shelley.json"
204-
file [] "genesis-alonzo.json"
202+
when (clusterName /= Selfnode) $ do
203+
file [] "genesis-byron.json"
204+
file [] "genesis-shelley.json"
205+
file [] "genesis-alonzo.json"
205206
file [] "libsodium-23.dll"
206207
when (clusterName == Selfnode) $ do
207208
file [] "signing.key"
208209
file [] "delegation.cert"
210+
file [] "local-cluster.exe"
211+
file [] "libgcc_s_seh-1.dll"
212+
file [] "libgmpxx-4.dll"
213+
file [] "libstdc++-6.dll"
214+
file [] "libwinpthread-1.dll"
215+
file [] "mcfgthread-12.dll"
216+
file [] "mock-token-metadata-server.exe"
217+
file [Recursive] "test\\"
218+
file [] "token-metadata.json"
209219
file [] "cardano-launcher.exe"
210220
file [] "libffi-7.dll"
211221
file [] "libffi-8.dll"

nix/cardano-bridge.nix

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ target, runCommandCC, cardano-wallet, cardano-node, cardano-shell, cardano-cli, cardano-address, lib, local-cluster ? null }:
1+
{ target, runCommandCC, cardano-wallet, cardano-node, cardano-shell, cardano-cli, cardano-address, lib, local-cluster ? null, mock-token-metadata-server }:
22

33
runCommandCC "daedalus-cardano-bridge" {
44
passthru = {
@@ -14,7 +14,30 @@ runCommandCC "daedalus-cardano-bridge" {
1414
cp -f ${cardano-shell.haskellPackages.cardano-launcher.components.exes.cardano-launcher}/bin/* .
1515
cp -f ${cardano-node}/bin/cardano-node* .
1616
cp -f ${cardano-cli}/bin/cardano-cli* .
17-
${lib.optionalString (local-cluster != null) "cp -f ${local-cluster}/bin/local-cluster* ."}
17+
${lib.optionalString (local-cluster != null) ''
18+
19+
${if target == "x86_64-windows" then ''
20+
# Recursive for selfnode shelley test data:
21+
cp -rf ${local-cluster}/bin/* .
22+
23+
'' else if target == "x86_64-linux" then ''
24+
cp -f ${local-cluster}/bin/local-cluster .
25+
26+
'' else if target == "x86_64-darwin" then ''
27+
# For nix-shell:
28+
cp -f ${local-cluster}/bin/local-cluster .
29+
30+
# For selfnode installer:
31+
cp -f ${local-cluster}/bin/.local-cluster-wrapped local-cluster--unwrapped
32+
mkdir -p test/data
33+
test_data_dir=$(cat local-cluster | grep -oP "SHELLEY_TEST_DATA='\K[^']+")
34+
cp -rf $test_data_dir test/data/
35+
36+
'' else abort "Unknown target: ${target}"}
37+
38+
cp -f ${mock-token-metadata-server}/bin/* . || true
39+
cp -f ${./../utils/cardano/selfnode}/token-metadata.json .
40+
''}
1841
${lib.optionalString (target == "x86_64-linux") ''
1942
chmod +w -R .
2043
for x in cardano-address cardano-node cardano-launcher cardano-cli cardano-wallet; do

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,9 @@
5050
"themes:update": "gulp build:themes && ts-node -r esm ./dist/scripts/update.js && yarn prettier --loglevel warn --write source/renderer/app/themes/daedalus/*.ts",
5151
"themes:copy": "ts-node -r @babel/register -r @babel/polyfill source/renderer/app/themes/utils/copyTheme.ts && yarn prettier --loglevel warn --write source/renderer/app/themes/daedalus/*.ts",
5252
"clear:cache": "gulp clear:cache",
53-
"nix:alonzo_purple": "./nix/yarn-nix-shell.sh alonzo_purple alonzo_purple",
5453
"nix:mainnet": "./nix/yarn-nix-shell.sh mainnet mainnet",
5554
"nix:flight": "./nix/yarn-nix-shell.sh mainnet mainnet_flight",
5655
"nix:selfnode": "./nix/yarn-nix-shell.sh selfnode selfnode",
57-
"nix:shelley_qa": "./nix/yarn-nix-shell.sh shelley_qa shelley_qa",
58-
"nix:staging": "./nix/yarn-nix-shell.sh staging staging",
5956
"nix:testnet": "./nix/yarn-nix-shell.sh testnet testnet",
6057
"byron:wallet:importer": "ts-node utils/api-importer/byron-wallet-importer.ts",
6158
"shelley:wallet:importer": "ts-node utils/api-importer/shelley-wallet-importer.ts",

source/main/cardano/CardanoNode.ts

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,12 @@ export class CardanoNode {
146146
*/
147147
_cardanoWalletLogFile: WriteStream;
148148

149+
/**
150+
* Log file stream for cardano-wallet
151+
* @private
152+
*/
153+
_mockTokenMetadataServerLogFile: WriteStream;
154+
149155
/**
150156
* The TLS config that is generated by the cardano-node
151157
* on each startup and is broadcasted over ipc channel
@@ -305,41 +311,40 @@ export class CardanoNode {
305311
);
306312

307313
return new Promise(async (resolve, reject) => {
308-
const nodeLogFile = rfs(
309-
(time) => {
310-
// The module works by writing to the one file name before it is rotated out.
311-
if (!time) return 'node.log';
312-
const timestamp = moment.utc().format('YYYYMMDDHHmmss');
313-
return `node.log-${timestamp}`;
314-
},
315-
{
316-
size: '5M',
317-
path: this._config.logFilePath,
318-
maxFiles: 4,
319-
}
320-
);
314+
const mkLogFile = (baseName: string): WriteStream => {
315+
return rfs(
316+
(time) => {
317+
// The module works by writing to the one file name before it is rotated out.
318+
if (!time) return baseName;
319+
const timestamp = moment.utc().format('YYYYMMDDHHmmss');
320+
return `${baseName}-${timestamp}`;
321+
},
322+
{
323+
size: '5M',
324+
path: this._config.logFilePath,
325+
maxFiles: 4,
326+
}
327+
);
328+
};
329+
330+
const nodeLogFile = mkLogFile('node.log');
321331
this._cardanoNodeLogFile = nodeLogFile;
322-
const walletLogFile = rfs(
323-
(time) => {
324-
// The module works by writing to the one file name before it is rotated out.
325-
if (!time) return 'cardano-wallet.log';
326-
const timestamp = moment.utc().format('YYYYMMDDHHmmss');
327-
return `cardano-wallet.log-${timestamp}`;
328-
},
329-
{
330-
size: '5M',
331-
path: this._config.logFilePath,
332-
maxFiles: 4,
333-
}
334-
);
332+
const walletLogFile = mkLogFile('cardano-wallet.log');
335333
this._cardanoWalletLogFile = walletLogFile;
336334

337335
if (isSelfnode) {
338336
try {
337+
const mockTokenMetadataServerLogFile = mkLogFile(
338+
'mock-token-metadata-server.log'
339+
);
340+
this._mockTokenMetadataServerLogFile = mockTokenMetadataServerLogFile;
341+
339342
const { selfnodeBin, mockTokenMetadataServerBin } = launcherConfig;
340343
const { node, replyPort } = await CardanoSelfnodeLauncher({
341344
selfnodeBin,
345+
walletLogFile,
342346
mockTokenMetadataServerBin,
347+
mockTokenMetadataServerLogFile,
343348
processName: CARDANO_PROCESS_NAME,
344349
onStop: this._ensureProcessIsNotRunning,
345350
});
@@ -856,6 +861,8 @@ export class CardanoNode {
856861
_reset = () => {
857862
if (this._cardanoNodeLogFile) this._cardanoNodeLogFile.end();
858863
if (this._cardanoWalletLogFile) this._cardanoWalletLogFile.end();
864+
if (this._mockTokenMetadataServerLogFile)
865+
this._mockTokenMetadataServerLogFile.end();
859866
if (this._node) this._node = null;
860867
this._tlsConfig = null;
861868
};

0 commit comments

Comments
 (0)