Skip to content

Commit d7e8a33

Browse files
Merge branch 'develop' into fix/ddw-1011-fix-stake-pool-list-view-overlap
2 parents e3068fa + 77bcc54 commit d7e8a33

File tree

3 files changed

+47
-7
lines changed

3 files changed

+47
-7
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ If you get SSL error when running `nix-shell` (SSL peer certificate or SSH remot
6565

6666
1. Run `yarn nix:selfnode` from `daedalus`.
6767
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`)
68+
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`.
6869
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:
6970
- Byron wallets: `yarn byron:wallet:importer`
7071
- Shelley wallets: `yarn shelley:wallet:importer`
@@ -94,31 +95,37 @@ If you get SSL error when running `nix-shell` (SSL peer certificate or SSH remot
9495

9596
1. Run `yarn nix:mainnet` from `daedalus`.
9697
2. Run `yarn dev` from the subsequent `nix-shell`
98+
3. Or in one command: `yarn nix:mainnet yarn dev`
9799

98100
#### Flight
99101

100102
1. Run `yarn nix:flight` from `daedalus`.
101103
2. Run `yarn dev` from the subsequent `nix-shell`
104+
3. Or in one command: `yarn nix:flight yarn dev`
102105

103106
#### Testnet
104107

105108
1. Run `yarn nix:testnet` from `daedalus`.
106109
2. Run `yarn dev` from the subsequent `nix-shell`
110+
3. Or in one command: `yarn nix:testnet yarn dev`
107111

108112
#### Staging
109113

110114
1. Run `yarn nix:staging` from `daedalus`.
111115
2. Run `yarn dev` from the subsequent `nix-shell`
116+
3. Or in one command: `yarn nix:staging yarn dev`
112117

113118
#### Shelley QA
114119

115120
1. Run `yarn nix:shelley_qa` from `daedalus`.
116121
2. Run `yarn dev` from the subsequent `nix-shell`
122+
3. Or in one command: `yarn nix:shelley_qa yarn dev`
117123

118124
#### Alonzo Purple
119125

120126
1. Run `yarn nix:alonzo_purple` from `daedalus`.
121127
2. Run `yarn dev` from the subsequent `nix-shell`
128+
3. Or in one command: `yarn nix:alonzo_purple yarn dev`
122129

123130
#### Native token metadata server
124131

nix/yarn-nix-shell.sh

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
#!/usr/bin/env bash
2+
3+
# This small wrapper over `nix-shell`, called from package.json
4+
# (e.g. `yarn nix:testnet`) allows to specify an initial command to be
5+
# run inside the `nix-shell` once its ready, e.g.:
6+
#
7+
# $ yarn nix:testnet yarn dev
8+
#
9+
# After the command finishes, you will still be left inside the
10+
# nix-shell.
11+
12+
if [ $# -lt 2 ] ; then
13+
echo >&2 'fatal: usage: '"$0"' <network> <cluster> [<initial command> ...]'
14+
exit 1
15+
fi
16+
17+
NETWORK="$1" ; shift
18+
cluster="$1" ; shift
19+
20+
# Unfortunately, we need to shell-escape the command:
21+
# cf. <https://github.com/NixOS/nixpkgs/blob/877eb10cfbdb3e3d54bdc7a7f6fd3c4b4e6396da/lib/strings.nix#L310-L328>
22+
command=''
23+
while [ $# -gt 0 ] ; do
24+
command="$command '""${1//\'/\'\\\'\'}""'" ; shift
25+
done
26+
27+
if [ -z "$command" ] ; then
28+
command=':' # no-op, if no command
29+
fi
30+
31+
export NETWORK
32+
# `return` will make the user stay in `nix-shell` after the initial command finishes:
33+
exec nix-shell --argstr nodeImplementation cardano --argstr cluster "$cluster" --command "$command ; return"

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@
4949
"themes:update": "gulp build:themes && ts-node -r esm ./dist/scripts/update.js && yarn prettier --loglevel warn --write source/renderer/app/themes/daedalus/*.ts",
5050
"themes:copy": "ts-node -r @babel/register -r @babel/polyfill source/renderer/app/themes/utils/copyTheme.ts && yarn prettier --loglevel warn --write source/renderer/app/themes/daedalus/*.ts",
5151
"clear:cache": "gulp clear:cache",
52-
"nix:alonzo_purple": "NETWORK=alonzo_purple nix-shell --argstr nodeImplementation cardano --argstr cluster alonzo_purple",
53-
"nix:mainnet": "NETWORK=mainnet nix-shell --argstr nodeImplementation cardano --argstr cluster mainnet",
54-
"nix:flight": "NETWORK=mainnet nix-shell --argstr nodeImplementation cardano --argstr cluster mainnet_flight",
55-
"nix:selfnode": "NETWORK=selfnode nix-shell --argstr nodeImplementation cardano --argstr cluster selfnode",
56-
"nix:shelley_qa": "NETWORK=shelley_qa nix-shell --argstr nodeImplementation cardano --argstr cluster shelley_qa",
57-
"nix:staging": "NETWORK=staging nix-shell --argstr nodeImplementation cardano --argstr cluster staging",
58-
"nix:testnet": "NETWORK=testnet nix-shell --argstr nodeImplementation cardano --argstr cluster testnet",
52+
"nix:alonzo_purple": "./nix/yarn-nix-shell.sh alonzo_purple alonzo_purple",
53+
"nix:mainnet": "./nix/yarn-nix-shell.sh mainnet mainnet",
54+
"nix:flight": "./nix/yarn-nix-shell.sh mainnet mainnet_flight",
55+
"nix:selfnode": "./nix/yarn-nix-shell.sh selfnode selfnode",
56+
"nix:shelley_qa": "./nix/yarn-nix-shell.sh shelley_qa shelley_qa",
57+
"nix:staging": "./nix/yarn-nix-shell.sh staging staging",
58+
"nix:testnet": "./nix/yarn-nix-shell.sh testnet testnet",
5959
"byron:wallet:importer": "ts-node utils/api-importer/byron-wallet-importer.ts",
6060
"shelley:wallet:importer": "ts-node utils/api-importer/shelley-wallet-importer.ts",
6161
"mary:wallet:importer": "ts-node utils/api-importer/mary-wallet-importer.ts",

0 commit comments

Comments
 (0)