Skip to content

Commit 30afa67

Browse files
mac/windows: rename install/data dir to contain Mainnet (#1986)
* mac/windows: rename install/data dir to contain Mainnet * mainnet installer: fix linux application names * also removes creating `daedalus` without a cluster bin * Update Daedalus Mainnet handling * db-converter: remove from bridge as it is not used * fix missing reference to db-converter Co-authored-by: Nikola Glumac <niglumac@gmail.com>
1 parent 50d6bd4 commit 30afa67

File tree

10 files changed

+42
-57
lines changed

10 files changed

+42
-57
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
## 1.0.0
5+
6+
### Chores
7+
8+
- Rename "Daedalus" to "Daedalus Mainnet" and update state directory path ([PR 1986](https://github.com/input-output-hk/daedalus/pull/1986))
9+
410
## 1.0.0-FC5
511

612
### Fixes

default.nix

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ let
5050
cardanoLib = localLib.iohkNix.cardanoLib;
5151
daedalus-bridge = self.bridgeTable.${nodeImplementation};
5252
export-wallets = self.cardano-sl.nix-tools.cexes.cardano-wallet.export-wallets;
53-
db-converter = self.cardano-wallet.db-converter;
5453

5554
nodejs = pkgs.nodejs-12_x;
5655
yarnInfo = {
@@ -342,9 +341,9 @@ let
342341
fi
343342
'';
344343
desktopItem = pkgs.makeDesktopItem {
345-
name = "Daedalus${if cluster != "mainnet" then "-${self.linuxClusterBinName}" else ""}";
344+
name = "Daedalus-${self.linuxClusterBinName}";
346345
exec = "INSERT_PATH_HERE";
347-
desktopName = "Daedalus${if cluster != "mainnet" then " ${self.linuxClusterBinName}" else ""}";
346+
desktopName = "Daedalus ${self.linuxClusterBinName}";
348347
genericName = "Crypto-Currency Wallet";
349348
categories = "Application;Network;";
350349
icon = "INSERT_ICON_PATH_HERE";
@@ -367,13 +366,12 @@ let
367366
cp -f ${self.iconPath.small} $DAEDALUS_DIR/icon.png
368367
cp -Lf ${self.namespaceHelper}/bin/namespaceHelper $DAEDALUS_DIR/namespaceHelper
369368
mkdir -pv ~/.local/bin ''${XDG_DATA_HOME}/applications
370-
${pkgs.lib.optionalString (cluster == "mainnet") "cp -Lf ${self.namespaceHelper}/bin/namespaceHelper ~/.local/bin/daedalus"}
371369
cp -Lf ${self.namespaceHelper}/bin/namespaceHelper ~/.local/bin/daedalus-${self.linuxClusterBinName}
372370
373371
cat ${self.desktopItem}/share/applications/Daedalus*.desktop | sed \
374372
-e "s+INSERT_PATH_HERE+''${DAEDALUS_DIR}/namespaceHelper+g" \
375373
-e "s+INSERT_ICON_PATH_HERE+''${DAEDALUS_DIR}/icon_large.png+g" \
376-
> "''${XDG_DATA_HOME}/applications/Daedalus${if cluster != "mainnet" then "-${self.linuxClusterBinName}" else ""}.desktop"
374+
> "''${XDG_DATA_HOME}/applications/Daedalus-${self.linuxClusterBinName}.desktop"
377375
'';
378376
xdg-open = pkgs.writeScriptBin "xdg-open" ''
379377
#!${pkgs.stdenv.shell}

installers/common/MacInstaller.hs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ makeComponentRoot Options{oBackend,oCluster} appRoot darwinConfig@DarwinConfig{d
261261
Cardano bridge -> do
262262
common bridge
263263
-- Executables (from daedalus-bridge)
264-
forM_ ["cardano-wallet-byron", "cardano-node", "cardano-cli", "export-wallets", "db-converter" ] $ \f ->
264+
forM_ ["cardano-wallet-byron", "cardano-node", "cardano-cli", "export-wallets" ] $ \f ->
265265
cp (bridge </> "bin" </> f) (dir </> f)
266266
forM_ ["config.yaml", "genesis.json", "topology.yaml" ] $ \f ->
267267
cp f (dataDir </> f)
@@ -275,7 +275,7 @@ makeComponentRoot Options{oBackend,oCluster} appRoot darwinConfig@DarwinConfig{d
275275
rmtree $ dataDir </> "app/installers"
276276

277277
-- Rewrite libs paths and bundle them
278-
void $ chain (encodeString dir) $ fmap tt [dir </> "cardano-launcher", dir </> "cardano-wallet-byron", dir </> "cardano-node", dir </> "cardano-cli", dir </> "export-wallets", dir </> "db-converter" ]
278+
void $ chain (encodeString dir) $ fmap tt [dir </> "cardano-launcher", dir </> "cardano-wallet-byron", dir </> "cardano-node", dir </> "cardano-cli", dir </> "export-wallets" ]
279279
Jormungandr bridge -> do
280280
common bridge
281281
-- Executables (from daedalus-bridge)

installers/common/WindowsInstaller.hs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,6 @@ writeInstallerNSIS outName (Version fullVersion') InstallerConfig{hasBlock0,inst
193193
file [] "cardano-node.exe"
194194
file [] "cardano-wallet-byron.exe"
195195
file [] "export-wallets.exe"
196-
file [] "db-converter.exe"
197196
file [] "cardano-cli.exe"
198197
file [] "config.yaml"
199198
file [] "topology.yaml"

nix/cardano-bridge.nix

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ target, pkgs, runCommand, cardano-wallet, cardano-node, cardano-shell, export-wallets, db-converter, cardano-cli }:
1+
{ target, pkgs, runCommand, cardano-wallet, cardano-node, cardano-shell, export-wallets, cardano-cli }:
22

33
let
44
commonLib = import ../lib.nix {};
@@ -16,15 +16,8 @@ in runCommand "daedalus-cardano-bridge" {
1616
cp ${cardano-shell.nix-tools.cexes.cardano-launcher.cardano-launcher}/bin/cardano-launcher* .
1717
cp ${cardano-node}/bin/cardano-node* .
1818
cp ${export-wallets}/bin/export-wallets* .
19-
cp ${db-converter}/bin/db-converter* .
2019
cp ${cardano-cli}/bin/cardano-cli* .
2120
${pkgs.lib.optionalString (target == "x86_64-windows") ''
2221
cp ${pkgsCross.libffi}/bin/libffi-6.dll .
2322
''}
2423
''
25-
#${pkgs.lib.optionalString (target == "x86_64-linux") ''
26-
# for bin in cardano-launcher cardano-wallet-byron cardano-node export-wallets db-converter; do
27-
# ${pkgs.binutils-unwrapped}/bin/strip $bin
28-
# ${pkgs.patchelf}/bin/patchelf --shrink-rpath $bin
29-
# done
30-
#''}

nix/launcher-config.nix

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ let
2727

2828
isDevOrLinux = devShell || os == "linux";
2929

30-
mkSpacedName = network: if network == "mainnet" then "Daedalus" else "Daedalus ${installDirectorySuffix}";
30+
mkSpacedName = network: "Daedalus ${installDirectorySuffix}";
3131
spacedName = mkSpacedName network;
3232

3333
frontendBinPath = let
@@ -57,6 +57,7 @@ let
5757

5858
installDirectorySuffix = let
5959
supportedNetworks = {
60+
mainnet = "Mainnet";
6061
mainnet_flight = "Flight";
6162
qa = "QA";
6263
selfnode = "Selfnode";
@@ -86,10 +87,10 @@ let
8687
in path.${os};
8788

8889
# Used for flight builds to find legacy paths for migration
89-
mainnetDataDir = let
90+
legacyDataDir = let
9091
path.linux = "\${XDG_DATA_HOME}/Daedalus/mainnet";
91-
path.macos64 = "\${HOME}/Library/Application Support/${mkSpacedName "mainnet"}";
92-
path.windows = "\${APPDATA}\\${mkSpacedName "mainnet"}";
92+
path.macos64 = "\${HOME}/Library/Application Support/Daedalus";
93+
path.windows = "\${APPDATA}\\Daedalus";
9394
in path.${os};
9495

9596
logsPrefix = let
@@ -159,7 +160,6 @@ let
159160
mkConfigByron = let
160161
filterMonitoring = config: if devShell then config else builtins.removeAttrs config [ "hasPrometheus" "hasEKG" ];
161162
exportWalletsBin = mkBinPath "export-wallets";
162-
dbConverterBin = mkBinPath "db-converter";
163163
walletBin = mkBinPath "cardano-wallet-byron";
164164
nodeBin = mkBinPath "cardano-node";
165165
cliBin = mkBinPath "cardano-cli";
@@ -191,7 +191,7 @@ let
191191
''}
192192
'';
193193

194-
legacyStateDir = if network == "mainnet_flight" then mainnetDataDir else dataDir;
194+
legacyStateDir = if (network == "mainnet_flight") || (network == "mainnet") then legacyDataDir else dataDir;
195195

196196
legacyWalletDB = let
197197
path.linux = "Wallet";
@@ -211,7 +211,6 @@ let
211211
cliBin
212212
walletBin
213213
exportWalletsBin
214-
dbConverterBin
215214
legacyStateDir
216215
legacyWalletDB
217216
legacySecretKey;
@@ -238,7 +237,7 @@ let
238237
macPackageName = "Daedalus${network}";
239238
dataDir = dataDir;
240239
hasBlock0 = false;
241-
installerWinBinaries = [ "cardano-launcher.exe" "cardano-node.exe" "cardano-wallet-byron.exe" "export-wallets.exe" "db-converter.exe" "cardano-cli.exe" ];
240+
installerWinBinaries = [ "cardano-launcher.exe" "cardano-node.exe" "cardano-wallet-byron.exe" "export-wallets.exe" "cardano-cli.exe" ];
242241
};
243242

244243
in {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "daedalus",
33
"productName": "Daedalus",
4-
"version": "1.0.0-FC5",
4+
"version": "1.0.0",
55
"description": "Cryptocurrency Wallet",
66
"main": "./dist/main/index.js",
77
"scripts": {

release.nix

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,5 +67,4 @@ in {
6767
};
6868
cardano-node = [ "x86_64-linux" "x86_64-darwin" "x86_64-windows" ];
6969
export-wallets = [ "x86_64-linux" "x86_64-darwin" "x86_64-windows" ];
70-
db-converter = [ "x86_64-linux" "x86_64-darwin" "x86_64-windows" ];
7170
})

source/common/utils/environmentCheckers.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,8 @@ export const getBuildLabel = (
4141
isFlight: boolean,
4242
version: string
4343
) => {
44-
const flightLabel = isFlight ? ' Flight' : '';
45-
const networkLabel = checkIsMainnet(network)
46-
? ''
47-
: ` ${networkPrettyNames[network]}`;
48-
let buildLabel = `Daedalus${flightLabel}${networkLabel} (${version}#${build})`;
44+
const networkLabel = isFlight ? 'Flight' : networkPrettyNames[network];
45+
let buildLabel = `Daedalus ${networkLabel} (${version}#${build})`;
4946
if (!checkIsProduction(currentNodeEnv))
5047
buildLabel += ` ${upperFirst(currentNodeEnv)}`;
5148
return buildLabel;

source/main/cardano/utils.js

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -202,28 +202,24 @@ export const exportWallets = async (
202202
legacyWalletDBPath = path.join(exportSourcePath, legacyWalletDB);
203203
}
204204

205-
// In case of Daedalus Flight build we need to copy over
206-
// legacySecretKey and legacyWalletDB from mainnet state dir
207-
// into Daedalus Flight state dir before extracting the wallets
208-
if (isFlight) {
209-
try {
210-
const response = await prepareMigrationData(
211-
mainWindow,
212-
stateDir,
213-
legacySecretKeyPath,
214-
legacyWalletDBPath,
215-
locale
216-
);
217-
legacySecretKeyPath = response.legacySecretKeyPath;
218-
legacyWalletDBPath = response.legacyWalletDBPath;
219-
} catch (error) {
220-
const { code } = error || {};
221-
if (code === 'EBUSY') {
222-
logger.info('ipcMain: Exporting wallets failed', {
223-
errors: error,
224-
});
225-
return Promise.resolve({ wallets: [], errors: error });
226-
}
205+
// Prepare Daedalus migration data
206+
try {
207+
const response = await prepareMigrationData(
208+
mainWindow,
209+
stateDir,
210+
legacySecretKeyPath,
211+
legacyWalletDBPath,
212+
locale
213+
);
214+
legacySecretKeyPath = response.legacySecretKeyPath;
215+
legacyWalletDBPath = response.legacyWalletDBPath;
216+
} catch (error) {
217+
const { code } = error || {};
218+
if (code === 'EBUSY') {
219+
logger.info('ipcMain: Exporting wallets failed', {
220+
errors: error,
221+
});
222+
return Promise.resolve({ wallets: [], errors: error });
227223
}
228224
}
229225

@@ -266,10 +262,8 @@ export const exportWallets = async (
266262
errors,
267263
});
268264

269-
// Remove Daedalus Flight migration data
270-
if (isFlight) {
271-
await removeMigrationData(stateDir);
272-
}
265+
// Remove Daedalus migration data
266+
await removeMigrationData(stateDir);
273267

274268
return Promise.resolve({ wallets, errors });
275269
};

0 commit comments

Comments
 (0)