Skip to content

Commit 1ef3462

Browse files
committed
Merge branch 'develop' into feature/ddw-745-arm-support
# Conflicts: # nix/cardano-bridge.nix
2 parents 60514a8 + 13a7fca commit 1ef3462

File tree

13 files changed

+411
-77
lines changed

13 files changed

+411
-77
lines changed

CHANGELOG.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,14 @@
66

77
- Fixed phrasing of insufficient funds for tokens message ([PR 2966](https://github.com/input-output-hk/daedalus/pull/2966))
88

9-
## 4.10.0
10-
119
### Features
1210

1311
- Added support for Ledger Nano S Plus ([PR 2975](https://github.com/input-output-hk/daedalus/pull/2975))
1412

13+
### Chores
14+
15+
- Published selfnode installers for all 3 platforms ([PR 2971](https://github.com/input-output-hk/daedalus/pull/2971))
16+
1517
## 4.10.0
1618

1719
### Features

README.md

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,21 +105,6 @@ If you get SSL error when running `nix-shell` (SSL peer certificate or SSH remot
105105
1. Run `yarn nix:testnet` from `daedalus`.
106106
2. Run `yarn dev` from the subsequent `nix-shell`
107107

108-
##### Staging
109-
110-
1. Run `yarn nix:staging` from `daedalus`.
111-
2. Run `yarn dev` from the subsequent `nix-shell`
112-
113-
##### Shelley QA
114-
115-
1. Run `yarn nix:shelley_qa` from `daedalus`.
116-
2. Run `yarn dev` from the subsequent `nix-shell`
117-
118-
##### Alonzo Purple
119-
120-
1. Run `yarn nix:alonzo_purple` from `daedalus`.
121-
2. Run `yarn dev` from the subsequent `nix-shell`
122-
123108
##### Native token metadata server
124109

125110
Daedalus, by default, uses the following metadata server for all networks except for the mainnet: `https://metadata.cardano-testnet.iohkdev.io/`.

default.nix

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ let
269269
pushd dlls
270270
${if dummyInstaller then "touch foo" else "unzip ${self.dlls}"}
271271
popd
272-
cp -v ${self.unpackedCardano}/bin/* .
272+
cp -vr ${self.unpackedCardano}/bin/* .
273273
cp -v ${self.nsisFiles}/{*.yaml,*.json,daedalus.nsi,*.key,*.cert} .
274274
cp ${self.uninstaller}/uninstall.exe ../uninstall.exe
275275
if [ -f ${self.nsisFiles}/block-0.bin ]; then

installer-clusters.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mainnet mainnet_flight testnet shelley_qa staging alonzo_purple
1+
mainnet selfnode mainnet_flight testnet

installers/common/MacInstaller.hs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -335,12 +335,19 @@ makeComponentRoot Options{oBackend,oCluster} appRoot darwinConfig@DarwinConfig{d
335335
-- Executables (from daedalus-bridge)
336336
forM_ ["cardano-wallet", "cardano-node", "cardano-cli", "cardano-address" ] $ \f ->
337337
cp (bridge </> "bin" </> f) (dir </> f)
338-
forM_ ["config.yaml", "genesis.json", "genesis-byron.json", "genesis-shelley.json", "genesis-alonzo.json", "topology.yaml" ] $ \f ->
338+
forM_ ["config.yaml", "genesis.json", "topology.yaml" ] $ \f ->
339339
cp f (dataDir </> f)
340+
when (oCluster /= Selfnode) $ do
341+
forM_ ["genesis-byron.json", "genesis-shelley.json", "genesis-alonzo.json" ] $ \f ->
342+
cp f (dataDir </> f)
340343

341344
when (oCluster == Selfnode) $ do
342345
cp "signing.key" (dataDir </> "signing.key")
343346
cp "delegation.cert" (dataDir </> "delegation.cert")
347+
cp (bridge </> "bin" </> "mock-token-metadata-server") (dir </> "mock-token-metadata-server")
348+
cp (bridge </> "bin" </> "token-metadata.json") (dataDir </> "token-metadata.json")
349+
cp (bridge </> "bin" </> "local-cluster--unwrapped") (dir </> "local-cluster")
350+
cptreeL (bridge </> "bin" </> "test" </> "data") (dataDir </> "data")
344351

345352
procs "chmod" ["-R", "+w", tt dir] empty
346353

@@ -367,6 +374,9 @@ makeComponentRoot Options{oBackend,oCluster} appRoot darwinConfig@DarwinConfig{d
367374
mapM_ sortaMove [ "HID.node" ]
368375
void $ chain (encodeString dir) [ tt $ dir </> "HID.node" ]
369376

377+
when (oCluster == Selfnode) $ do
378+
void $ chain (encodeString dir) $ fmap tt [ dir </> "mock-token-metadata-server", dir </> "local-cluster" ]
379+
370380
-- Prepare launcher
371381
de <- testdir (dir </> "Frontend")
372382
unless de $ mv (dir </> (fromString $ T.unpack $ dcAppName)) (dir </> "Frontend")

installers/common/WindowsInstaller.hs

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,23 @@ writeInstallerNSIS outName (Version fullVersion') InstallerConfig{installDirecto
199199
file [] "config.yaml"
200200
file [] "topology.yaml"
201201
file [] "genesis.json"
202-
file [] "genesis-byron.json"
203-
file [] "genesis-shelley.json"
204-
file [] "genesis-alonzo.json"
202+
when (clusterName /= Selfnode) $ do
203+
file [] "genesis-byron.json"
204+
file [] "genesis-shelley.json"
205+
file [] "genesis-alonzo.json"
205206
file [] "libsodium-23.dll"
206207
when (clusterName == Selfnode) $ do
207208
file [] "signing.key"
208209
file [] "delegation.cert"
210+
file [] "local-cluster.exe"
211+
file [] "libgcc_s_seh-1.dll"
212+
file [] "libgmpxx-4.dll"
213+
file [] "libstdc++-6.dll"
214+
file [] "libwinpthread-1.dll"
215+
file [] "mcfgthread-12.dll"
216+
file [] "mock-token-metadata-server.exe"
217+
file [Recursive] "test\\"
218+
file [] "token-metadata.json"
209219
file [] "cardano-launcher.exe"
210220
file [] "libffi-8.dll"
211221
file [] "libgmp-10.dll"

nix/cardano-bridge.nix

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{ target, runCommandCC, cardano-wallet, cardano-node, cardano-shell, cardano-cli, cardano-address, lib, local-cluster ? null, darwin }:
1+
{ target, runCommandCC, cardano-wallet, cardano-node, cardano-shell, cardano-cli, cardano-address, lib, local-cluster ? null, darwin, mock-token-metadata-server }:
22

33
runCommandCC "daedalus-cardano-bridge" {
44
passthru = {
@@ -14,7 +14,30 @@ runCommandCC "daedalus-cardano-bridge" {
1414
cp -f ${cardano-shell.haskellPackages.cardano-launcher.components.exes.cardano-launcher}/bin/* .
1515
cp -f ${cardano-node}/bin/cardano-node* .
1616
cp -f ${cardano-cli}/bin/cardano-cli* .
17-
${lib.optionalString (local-cluster != null) "cp -f ${local-cluster}/bin/local-cluster* ."}
17+
${lib.optionalString (local-cluster != null) ''
18+
19+
${if target == "x86_64-windows" then ''
20+
# Recursive for selfnode shelley test data:
21+
cp -rf ${local-cluster}/bin/* .
22+
23+
'' else if target == "x86_64-linux" then ''
24+
cp -f ${local-cluster}/bin/local-cluster .
25+
26+
'' else if target == "x86_64-darwin" then ''
27+
# For nix-shell:
28+
cp -f ${local-cluster}/bin/local-cluster .
29+
30+
# For selfnode installer:
31+
cp -f ${local-cluster}/bin/.local-cluster-wrapped local-cluster--unwrapped
32+
mkdir -p test/data
33+
test_data_dir=$(cat local-cluster | grep -oP "SHELLEY_TEST_DATA='\K[^']+")
34+
cp -rf $test_data_dir test/data/
35+
36+
'' else abort "Unknown target: ${target}"}
37+
38+
cp -f ${mock-token-metadata-server}/bin/* . || true
39+
cp -f ${./../utils/cardano/selfnode}/token-metadata.json .
40+
''}
1841
${lib.optionalString (target == "x86_64-linux") ''
1942
chmod +w -R .
2043
for x in cardano-address cardano-node cardano-launcher cardano-cli cardano-wallet; do

package.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,9 @@
5050
"themes:update": "gulp build:themes && ts-node -r esm ./dist/scripts/update.js && yarn prettier --loglevel warn --write source/renderer/app/themes/daedalus/*.ts",
5151
"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",
5252
"clear:cache": "gulp clear:cache",
53-
"nix:alonzo_purple": "./nix/yarn-nix-shell.sh alonzo_purple alonzo_purple",
5453
"nix:mainnet": "./nix/yarn-nix-shell.sh mainnet mainnet",
5554
"nix:flight": "./nix/yarn-nix-shell.sh mainnet mainnet_flight",
5655
"nix:selfnode": "./nix/yarn-nix-shell.sh selfnode selfnode",
57-
"nix:shelley_qa": "./nix/yarn-nix-shell.sh shelley_qa shelley_qa",
58-
"nix:staging": "./nix/yarn-nix-shell.sh staging staging",
5956
"nix:testnet": "./nix/yarn-nix-shell.sh testnet testnet",
6057
"byron:wallet:importer": "ts-node utils/api-importer/byron-wallet-importer.ts",
6158
"shelley:wallet:importer": "ts-node utils/api-importer/shelley-wallet-importer.ts",

scripts/filter-logs.sh

Lines changed: 164 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,164 @@
1+
#!/usr/bin/env bash
2+
3+
set -o errexit
4+
set -o pipefail
5+
set -o nounset
6+
7+
myDir=$(dirname "$0")
8+
9+
# --- Where are we?
10+
11+
uname=$(uname)
12+
is_linux=
13+
is_darwin=
14+
if [ "$uname" = "Linux" ] ; then is_linux=1 ; fi
15+
if [ "$uname" = "Darwin" ] ; then is_darwin=1 ; fi
16+
17+
# --- Find `default_logfile`
18+
19+
default_logfile=
20+
if [ -n "$is_darwin" ] ; then
21+
default_logfile="$HOME/Library/Application Support/Daedalus Mainnet/Logs/pub/Daedalus.json"
22+
:
23+
if [ ! -e "$default_logfile" ] ; then
24+
candidate=$(find "$HOME/Library/Application Support" -maxdepth 1 -mindepth 1 -type d -name 'Daedalus*' | head -n 1)
25+
if [ -n "$candidate" ] ; then
26+
default_logfile="$candidate"/Logs/pub/Daedalus.json
27+
fi
28+
fi
29+
elif [ -n "$is_linux" ] ; then
30+
default_logfile="$HOME"/.local/share/Daedalus/mainnet/Logs/pub/Daedalus.json
31+
if [ ! -e "$default_logfile" ] ; then
32+
if [ -e "$HOME"/.local/share/Daedalus/ ] ; then
33+
candidate=$(find "$HOME"/.local/share/Daedalus/ -mindepth 1 -maxdepth 1 -type d | head -n 1)
34+
if [ -n "$candidate" ] ; then
35+
default_logfile="$candidate"/Logs/pub/Daedalus.json
36+
fi
37+
fi
38+
fi
39+
fi
40+
41+
# --- Print usage
42+
43+
print_usage() {
44+
echo "Usage: $0 [OPTION]..."
45+
echo
46+
echo " -h, --help Display help."
47+
echo " -f, --follow Continue processing as the log file grows."
48+
echo " -c, --compact Output compact instead of pretty-printed JSON."
49+
echo " -i, --input <file> Deadalus.json log location (default: $default_logfile)."
50+
echo " -m, --msg-contains <substring> Filter down to entries ‘.msg’ of which contains a <substring>."
51+
echo " --app-contains <string> Filter down to entries ‘.app’ of which contains a <string> element."
52+
echo " -d, --data-key <key> Filter down to entries ‘.data’ of which contains a <key> key."
53+
echo " --data-kv <key> <value> Filter down to entries ‘.data’ of which contains a <key> with value <value>."
54+
}
55+
56+
# --- Parse arguments
57+
58+
follow_mode=
59+
compact_mode=
60+
input="$default_logfile"
61+
filter_msg_contains=
62+
filter_app_contains=
63+
filter_data_key=
64+
filter_data_kv_key=
65+
filter_data_kv_value=
66+
67+
while [ $# -gt 0 ] ; do
68+
case "$1" in
69+
--help | -h ) print_usage ; exit 0 ;;
70+
--follow | -f ) follow_mode=1 ;;
71+
--compact | -c ) compact_mode=1 ;;
72+
--input | -i ) shift ; input="$1" ;;
73+
--msg-contains | -m ) shift ; filter_msg_contains="$1" ;;
74+
--app-contains ) shift ; filter_app_contains="$1" ;;
75+
--data-key | -d ) shift ; filter_data_key="$1" ;;
76+
--data-kv ) shift ; filter_data_kv_key="$1" ; shift ; filter_data_kv_value="$1" ;;
77+
* ) echo >&2 'fatal: unknown arguments:' "$@" ; print_usage ; exit 1 ;;
78+
esac
79+
shift
80+
done
81+
82+
if [ -n "${DEBUG:-}" ] ; then
83+
echo 2>&1 "; follow_mode = $follow_mode"
84+
echo 2>&1 "; compact_mode = $compact_mode"
85+
echo 2>&1 "; input = $input"
86+
echo 2>&1 "; filter_msg_contains = $filter_msg_contains"
87+
echo 2>&1 "; filter_app_contains = $filter_app_contains"
88+
echo 2>&1 "; filter_data_key = $filter_data_key"
89+
echo 2>&1 "; filter_data_kv_key = $filter_data_kv_key"
90+
echo 2>&1 "; filter_data_kv_value = $filter_data_kv_value"
91+
fi
92+
93+
# --- Find jq
94+
95+
if type jq >/dev/null 2>&1 ; then
96+
:
97+
else
98+
echo >&2 "warn: no ‘jq’ found, will use one from Nixpkgs"
99+
default_nix="$myDir"/../default.nix
100+
if [ -e "$default_nix" ] ; then
101+
jq_package=$(nix-build "$default_nix" -A pkgs.jq)
102+
else
103+
jq_package=$(nix-build '<nixpkgs>' -A pkgs.jq)
104+
fi
105+
export PATH="$jq_package/bin:$PATH"
106+
fi
107+
108+
# --- Filters
109+
110+
read_source() {
111+
if [ -n "$follow_mode" ] ; then
112+
# 10¹⁰ ≈ ∞
113+
tail -n 999999999 -F "$input"
114+
else
115+
cat "$input"
116+
fi
117+
}
118+
119+
filter_dev_log_tags() {
120+
sed -r 's/^\[.*\{/\{/'
121+
}
122+
123+
pretty_print() {
124+
if [ -n "$compact_mode" ] ; then
125+
jq --unbuffered -c .
126+
else
127+
# could be just `cat`, but we want colors!
128+
jq --unbuffered .
129+
fi
130+
}
131+
132+
f_msg_contains() {
133+
if [ -n "$filter_msg_contains" ] ; then
134+
jq --unbuffered --arg arg1 "$filter_msg_contains" -c 'select(.msg | contains($arg1))'
135+
else
136+
cat
137+
fi
138+
}
139+
140+
f_app_contains() {
141+
if [ -n "$filter_app_contains" ] ; then
142+
jq --unbuffered --arg arg1 "$filter_app_contains" -c 'select(.app[] | contains($arg1))'
143+
else
144+
cat
145+
fi
146+
}
147+
148+
f_data_key() {
149+
if [ -n "$filter_data_key" ] ; then
150+
jq --unbuffered --arg key1 "$filter_data_key" -c 'select(.data | .[$key1])'
151+
else
152+
cat
153+
fi
154+
}
155+
156+
f_data_kv() {
157+
if [ -n "$filter_data_kv_key" ] ; then
158+
jq --unbuffered --arg key1 "$filter_data_kv_key" --arg value1 "$filter_data_kv_value" -c 'select(.data | .[$key1] == $value1)'
159+
else
160+
cat
161+
fi
162+
}
163+
164+
read_source | filter_dev_log_tags | f_msg_contains | f_app_contains | f_data_key | f_data_kv | pretty_print

0 commit comments

Comments
 (0)