From 691e91f4b3535669de11a1c746aa1020caf540d9 Mon Sep 17 00:00:00 2001 From: Daniel Main Date: Fri, 1 Apr 2022 13:12:40 +0200 Subject: [PATCH] [DDW-1065] Added new script to start Daedalus in dev mode in Windows and added the needed documentation --- README.md | 70 +++++++++++++++++++++++++++++++--------------------- package.json | 1 + 2 files changed, 43 insertions(+), 28 deletions(-) diff --git a/README.md b/README.md index 58330abddf..70452680c2 100644 --- a/README.md +++ b/README.md @@ -8,13 +8,15 @@ Daedalus - Cryptocurrency Wallet -## Installation +## Setup development environment -### Yarn +### Linux/macOS + +#### Yarn [Yarn](https://yarnpkg.com/lang/en/docs/install) is required to install `npm` dependencies to build Daedalus. -### Nix +#### Nix [Nix](https://nixos.org/nix/) is needed to run Daedalus in `nix-shell`. @@ -57,22 +59,19 @@ If you get SSL error when running `nix-shell` (SSL peer certificate or SSH remot ``` 2. Download certificate from https://docs.certifytheweb.com/docs/kb/kb-202109-letsencrypt/ and import to your keychain. -## Development - -### Running Daedalus with Cardano Node +#### Running Daedalus with Cardano Node -#### Selfnode +##### Selfnode 1. Run `yarn nix:selfnode` from `daedalus`. 2. Run `yarn dev` from the subsequent `nix-shell` (use `KEEP_LOCAL_CLUSTER_RUNNING` environment variable to keep the local cluster running after Daedalus exits: `KEEP_LOCAL_CLUSTER_RUNNING=true yarn dev`) - 1. Alternatively: run `yarn nix:selfnode yarn dev` to achieve the same thing in a single command. Note: after `yarn dev` exits, you will still remain in the `nix-shell`. 3. Once Daedalus has started and has gotten past the loading screen run the following commands from a new terminal window if you wish to import funded wallets: - - Byron wallets: `yarn byron:wallet:importer` - - Shelley wallets: `yarn shelley:wallet:importer` - - Mary wallets: `yarn mary:wallet:importer` (all of which contain native tokens which are visible once selfnode enters Mary era) - - Yoroi Byron wallets: `yarn yoroi:wallet:importer` - - _ITN Byron wallets:_ `yarn itn:byron:wallet:importer` **[Deprecated]** - - _ITN Shelley wallets:_ `yarn itn:shelley:wallet:importer` **[Deprecated]** + - Byron wallets: `yarn byron:wallet:importer` + - Shelley wallets: `yarn shelley:wallet:importer` + - Mary wallets: `yarn mary:wallet:importer` (all of which contain native tokens which are visible once selfnode enters Mary era) + - Yoroi Byron wallets: `yarn yoroi:wallet:importer` + - _ITN Byron wallets:_ `yarn itn:byron:wallet:importer` **[Deprecated]** + - _ITN Shelley wallets:_ `yarn itn:shelley:wallet:importer` **[Deprecated]** These scripts import 3 wallets by default. You can import up to 10 wallets by supplying `WALLET_COUNT` environment variable (e.g. `WALLET_COUNT=10 yarn mary:wallet:importer`). @@ -91,43 +90,37 @@ If you get SSL error when running `nix-shell` (SSL peer certificate or SSH remot | desiredPoolNumber | 3 | minimumUtxoValue | 1 ADA -#### Mainnet +##### Mainnet 1. Run `yarn nix:mainnet` from `daedalus`. 2. Run `yarn dev` from the subsequent `nix-shell` -3. Or in one command: `yarn nix:mainnet yarn dev` -#### Flight +##### Flight 1. Run `yarn nix:flight` from `daedalus`. 2. Run `yarn dev` from the subsequent `nix-shell` -3. Or in one command: `yarn nix:flight yarn dev` -#### Testnet +##### Testnet 1. Run `yarn nix:testnet` from `daedalus`. 2. Run `yarn dev` from the subsequent `nix-shell` -3. Or in one command: `yarn nix:testnet yarn dev` -#### Staging +##### Staging 1. Run `yarn nix:staging` from `daedalus`. 2. Run `yarn dev` from the subsequent `nix-shell` -3. Or in one command: `yarn nix:staging yarn dev` -#### Shelley QA +##### Shelley QA 1. Run `yarn nix:shelley_qa` from `daedalus`. 2. Run `yarn dev` from the subsequent `nix-shell` -3. Or in one command: `yarn nix:shelley_qa yarn dev` -#### Alonzo Purple +##### Alonzo Purple 1. Run `yarn nix:alonzo_purple` from `daedalus`. 2. Run `yarn dev` from the subsequent `nix-shell` -3. Or in one command: `yarn nix:alonzo_purple yarn dev` -#### Native token metadata server +##### Native token metadata server Daedalus, by default, uses the following metadata server for all networks except for the mainnet: `https://metadata.cardano-testnet.iohkdev.io/`. @@ -158,7 +151,28 @@ http://localhost:65432/metadata/query ``` ... and expect a "200 OK" response. -### Updating upstream dependencies (cardano-wallet, cardano-node, and iohk-nix) +### Windows + +This option is only for troubleshooting windows specific issues with hardware wallets. It is not recommended to use Windows as a developer environment. +Most of the commands need `nix` and will run only on Linux or macOS. + +#### Requisites +- Windows 10/11 +- Daedalus testnet installation (similar version used in branch) in `C:\Program Files\Daedalus Testnet` +- NodeJS 16 +- Python2 * +- `yarn global add windows-build-tools` * (if this does not work extract daedalus\nix\windows-usb-libs.zip under daedalus\build folder) +- Microsoft Build Tools 2015 * +- Microsoft Visual Studio 2017 (Include Desktop development with C++) * +- `yarn config set msvsversion 2015 --global` + +*needed for compiling node-sass@4.14.1 on Windows + +#### Steps +- `yarn install` +- `yarn dev:windows` + +#### Updating upstream dependencies (cardano-wallet, cardano-node, and iohk-nix) `Niv` is used to manage the version of upstream dependencies. The versions of these dependencies can be seen in `nix/sources.json`. diff --git a/package.json b/package.json index 63271c3b64..75228e8e65 100644 --- a/package.json +++ b/package.json @@ -11,6 +11,7 @@ "start": "gulp start", "start:dev": "NODE_ENV=development gulp start", "dev": "IS_WATCH_MODE=true gulp dev", + "dev:windows": "cross-env DAEDALUS_INSTALL_DIRECTORY=\"C:\\Program Files\\Daedalus Testnet\" LAUNCHER_CONFIG=\"C:\\Program Files\\Daedalus Testnet\\launcher-config.yaml\" gulp dev", "test": "NODE_ENV=test yarn build && yarn test:unit && yarn test:e2e:fail-fast", "test:jest": "NODE_OPTIONS=--experimental-vm-modules jest", "test:generate:report": "ts-node tests/reporter.ts",