Skip to content

Commit

Permalink
Merge pull request input-output-hk#2942 from input-output-hk/chore/dd…
Browse files Browse the repository at this point in the history
…w-1065-run-dev-in-windows
  • Loading branch information
danielmain authored Apr 1, 2022
2 parents 35531f8 + 691e91f commit 32102a0
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 28 deletions.
70 changes: 42 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down Expand Up @@ -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`).

Expand All @@ -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/`.

Expand Down Expand Up @@ -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 [email protected] 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`.

Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 32102a0

Please sign in to comment.