Document maintainer: Nikola Glumac
Document status: Active
Daedalus - cryptocurrency wallet
Platform-specific build scripts facilitate building Daedalus the way it is built by the IOHK CI:
This script requires Nix, (optionally) configured with the IOHK binary cache.
scripts/build-installer-unix.sh [OPTIONS..]
The result can be found at installers/csl-daedalus/daedalus-*.pkg
.
This will use nix to build a Linux installer. Using the IOHK binary cache will speed things up.
nix build -f ./release.nix mainnet.installer
The result can be found at ./result/daedalus-*.bin
.
shell.nix
provides a way to load a shell with all the correct versions of all the
required dependencies for development.
- Start the nix-shell with staging environment
yarn nix:staging
- Within the nix-shell run any command like
yarn dev
- Install nix:
curl https://nixos.org/nix/install | sh
- Employ the signed IOHK binary cache:
and then add the following lines:
$ sudo mkdir -p /etc/nix $ sudo vi /etc/nix/nix.conf # ..or any other editor, if you prefer
substituters = https://hydra.iohk.io https://cache.nixos.org/ trusted-substituters = trusted-public-keys = hydra.iohk.io:f/Ea+s+dFdN+3Y/G+FDgSq+a5NEWhJGzdjvKNGv0/EQ= cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspc
- Build and run demo cluster:
scripts/launch/demo-nix.sh
- Start local cardano-sl demo cluster (
./scripts/launch/demo-nix.sh
) - Inspect the terminal output of cardano-sl and copy the timestamp from the message
Using system start time 1537184804
- Start the nix-shell with development environment
yarn nix:dev 1537184804
(timestamp is different each time you restart the cardano-sl demo cluster) - Within the nix-shell run any command like
yarn dev
shell.nix
also provides a script for updating yarn.lock. Run nix-shell -A fixYarnLock
to update yarn.lock
file.
There are three different network options you can run Daedalus in: mainnet
, testnet
and development
(default).
To set desired network option use NETWORK
environment variable:
$ export NETWORK=testnet
$ yarn dev
You can find more details regarding tests setup within Running Daedalus acceptance tests README file.
Notes: Be aware that only a single Daedalus instance can run per state directory. So you have to exit any development instances before running tests!
This batch file requires Node.js and 7zip.
scripts/build-installer-win64.bat
The result will can be found at .\daedalus-*.exe
.
This boilerplate out of the box is configured to use css-modules.
All .css
file extensions will use css-modules unless it has .global.css
.
If you need global styles, stylesheets with .global.css
will not go through the
css-modules loader. e.g. app.global.css
If you use any 3rd party libraries which can't or won't be built with webpack, you must list them in your webpack.config.base.js
:
externals: [
// put your node 3rd party libraries which can't be built with webpack here (mysql, mongodb, and so on..)
]
For a common example, to install Bootstrap, yarn install --save bootstrap
and link them in the head of app.html
<link rel="stylesheet" href="../node_modules/bootstrap/dist/css/bootstrap.css" />
<link rel="image/svg+xml" href="../node_modules/bootstrap/dist/fonts/glyphicons-halflings-regular.eot" />
...
Make sure to list bootstrap in externals in webpack.config.base.js
or the app won't include them in the package:
externals: ['bootstrap']
$ yarn run package
To package apps for all platforms:
$ yarn run package:all
To package apps with options:
$ yarn run package -- --[option]
- --name, -n: Application name (default: ElectronReact)
- --version, -v: Electron version (default: latest version)
- --asar, -a: asar support (default: false)
- --icon, -i: Application icon
- --all: pack for all platforms
Use electron-packager
to pack your app with --all
options for darwin (osx), linux and win32 (windows) platform. After build, you will find them in release
folder. Otherwise, you will only find one for your os.