Skip to content
This repository has been archived by the owner on Aug 1, 2023. It is now read-only.

How Daedalus is being launched on each operating system using cardano launcher

Hiroto Shioi edited this page Oct 17, 2019 · 3 revisions

This document describes how Daedalus is being launched on each of the platforms using cardano-launcher.

On darwin and Linux, scripts are used before cardano-launcher is being executed and the content of the script varies slightly depending on the cluster. All the scripts below will be the ones for connecting to the mainnet cluster which is the one our users are using to connect to the mainnet.

Windows

On Windows, all the files that is required to launch Daedalus is located within Daedalus directory including cardano-launcher.exe. Daedalus shorcut that is located on the desktop will execute cardano-launcher.exe. cardano-launcher.exe will be executed without any arguments.

Mac

On MacOS, all the files that is required to launch Daedalus is located within Daedalus.app directory including cardano-launcher. When user launches the Daedalus (i.e. execute Daedalus.app), bash script Daedalus will be executed which will create two directories Secrets-1.0 and pub, then launch cardano-launcher.

#!/usr/bin/env bash
mkdir -p "$HOME/Library/Application Support/Daedalus/Secrets-1.0"
mkdir -p "$HOME/Library/Application Support/Daedalus/Logs/pub"
"$(dirname "$0")/cardano-launcher"

$(dirname $0) in a shell script generally expands to a path to the directory where your script is contained.

Linux

On Linux, it's bit more complicated than other operating system. It is being run withing nix sandbox mode. (i.e They’re isolated from the normal file system hierarchy and will only see their dependencies in the Nix store).

The launcher is being run by shell script daedalus which will perform following tasks:

  1. Set environment variables CLUSTER, DAEDALUS_DIR, and DAEDALUS_CONFIG.
  2. Create two directories pub and Secrets.
  3. cd to mainnet directory.
  4. Execute launcher with argument --config to specify the path to the config file: launcher-config.yaml.
#!/nix/store/mw8i3b8maf9y062m4ny7gibnln8hhx50-bash-4.4-p23/bin/bash

set -xe

test -z "$XDG_DATA_HOME" && { XDG_DATA_HOME="${HOME}/.local/share"; }
export           CLUSTER=mainnet
export      DAEDALUS_DIR="${XDG_DATA_HOME}/Daedalus"
export   DAEDALUS_CONFIG=/nix/var/nix/profiles/profile-mainnet/etc

mkdir -p "${DAEDALUS_DIR}/mainnet/"{Logs/pub,Secrets}
cd "${DAEDALUS_DIR}/mainnet/"

exec /nix/store/y8pc8ynr74h0hlj1m5jshdpnhg7d3ffs-cardano-daedalus-bridge-3.0.3/bin/cardano-launcher \
  --config /nix/var/nix/profiles/profile-mainnet/etc/launcher-config.yaml

Store path is different on every PC so using the script above will not launch Daedalus on your machine.