@cardano-sdk/e2e 0.33.2 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,7 +22,8 @@ services:
22
22
  ports:
23
23
  - 3001:3001
24
24
  volumes:
25
- - ./local-network/network-files/node-sp1/:/root/network-files/node-sp1
25
+ # This breaks running in Docker Desktop for macOS, is it *really* needed? I see no usage of cardano-cli in the repo
26
+ #- ./local-network/network-files/node-sp1/:/root/network-files/node-sp1
26
27
  - ./local-network/config:/root/config
27
28
  - sdk-ipc:/sdk-ipc
28
29
 
@@ -37,7 +38,9 @@ services:
37
38
  NGINX_PORT: 80
38
39
  healthcheck:
39
40
  test: ['CMD-SHELL', 'wget -O /dev/null http://localhost || exit 1']
40
- timeout: 10s
41
+ start_period: 5s
42
+ interval: 5s
43
+ timeout: 2s
41
44
 
42
45
  cardano-node:
43
46
  depends_on:
@@ -65,6 +68,9 @@ services:
65
68
  - ./local-network/config/network:/config
66
69
 
67
70
  cardano-submit-api:
71
+ depends_on:
72
+ local-testnet:
73
+ condition: service_healthy
68
74
  volumes:
69
75
  - ./local-network/config/network:/config
70
76
 
@@ -0,0 +1 @@
1
+ bin/
@@ -6,27 +6,41 @@ ENV DEBIAN_FRONTEND=nonintercative
6
6
 
7
7
  WORKDIR /build
8
8
  ARG CARDANO_NODE_BUILD_URL=https://update-cardano-mainnet.iohk.io/cardano-node-releases/cardano-node-1.35.4-linux.tar.gz
9
+ ARG CARDANO_NODE_BUILD_URL_ARM64=https://github.com/input-output-hk/ogmios-tracker/releases/download/0.1.0/cardano-node-1.35.4-aarch64-linux.tar.gz
10
+
9
11
  RUN apt-get update -y && \
10
- apt-get install -y wget tar && \
11
- wget $CARDANO_NODE_BUILD_URL -O cardano-node.tar.gz && \
12
- mkdir -p bin && \
13
- tar -xzf cardano-node.tar.gz -C bin
12
+ apt-get install -y wget tar curl && \
13
+ if [ "$(uname -m)" = "aarch64" ] ; then \
14
+ curl -fsSL "$CARDANO_NODE_BUILD_URL_ARM64" >cardano-node.tar.gz && \
15
+ mkdir -p cardano-node && \
16
+ tar -xzf cardano-node.tar.gz -C cardano-node ;\
17
+ else \
18
+ curl -fsSL "$CARDANO_NODE_BUILD_URL" >cardano-node.tar.gz && \
19
+ mkdir -p cardano-node/bin && \
20
+ tar -xzf cardano-node.tar.gz -C cardano-node/bin ;\
21
+ fi
14
22
 
15
23
  FROM ubuntu:${UBUNTU_VERSION}
16
24
 
17
- ENV TINI_VERSION v0.19.0
18
-
19
25
  WORKDIR /root
20
26
  RUN apt-get update -y && \
21
- apt-get install -y tzdata ca-certificates jq coreutils curl
27
+ apt-get install -y tzdata ca-certificates jq coreutils curl wget
22
28
 
23
29
  HEALTHCHECK --interval=5s --timeout=1s --retries=200 --start-period=100ms \
24
30
  CMD /root/scripts/get-epoch.sh | awk '{ if ($0 >= "3") exit 0; else exit 1}'
25
31
 
26
32
  STOPSIGNAL SIGINT
27
- COPY --from=builder /build/bin ./bin
28
- ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-static /tini
29
- RUN chmod +x /tini
30
-
31
- COPY . .
33
+ COPY --from=builder /build/cardano-node /opt/cardano-node
34
+ ARG TINI_VERSION=v0.19.0
35
+ RUN mkdir -p ./bin && ln -s /opt/cardano-node/bin/* ./bin/ &&\
36
+ if [ "$(uname -m)" = "aarch64" ] ; then \
37
+ TINI_VARIANT=static-arm64 ;\
38
+ else \
39
+ TINI_VARIANT=static-amd64 ;\
40
+ fi &&\
41
+ curl -fsSL >/tini https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini-${TINI_VARIANT} &&\
42
+ chmod +x /tini
43
+
44
+ COPY scripts scripts
45
+ COPY templates templates
32
46
  ENTRYPOINT ["/tini", "-g", "--", "/root/scripts/start.sh" ]
@@ -14,11 +14,29 @@ export PATH=$PWD/bin:$PATH
14
14
 
15
15
  source ./scripts/nodes-configuration.sh
16
16
 
17
- UNAME=$(uname -s) SED=
18
- case $UNAME in
19
- Darwin) SED="gsed" ;;
20
- Linux) SED="sed" ;;
21
- esac
17
+ # We need this when running in Docker Desktop on macOS. `sed -i` doesn’t work well with VOLUMEs
18
+ # there, unless it can create its temporary files outside of a VOLUME, which requires $TMPDIR.
19
+ export TMPDIR="${TMPDIR:-/tmp}"
20
+ export TMP="${TMP:-/tmp}"
21
+
22
+ UNAME=$(uname -s)
23
+
24
+ # Normal `sed -i` is a bit stubborn, and really wants to create its temporary files in the
25
+ # directory of the target file. It is not a true in-place edit, and often braks permissions.
26
+ # Let’s use this wrapper instead.
27
+ sed_i() {
28
+ local tmpfile=$(mktemp)
29
+ local sed_bin=sed
30
+ if [ "$UNAME" == "Darwin" ] ; then sed_bin=gsed ; fi
31
+ if $sed_bin "$@" >"$tmpfile"; then
32
+ cat "$tmpfile" >"${@: -1}" # Replace the last argument file (in-place file) with tmpfile content
33
+ rm "$tmpfile"
34
+ else
35
+ echo "sed failed." >&2
36
+ rm "$tmpfile"
37
+ return 1
38
+ fi
39
+ }
22
40
 
23
41
  case $(uname) in
24
42
  Darwin) date='gdate' ;;
@@ -108,7 +126,7 @@ cardano-cli byron genesis genesis \
108
126
  cp templates/babbage/alonzo-babbage-test-genesis.json "${ROOT}/genesis.alonzo.spec.json"
109
127
  cp templates/babbage/byron-configuration.yaml "${ROOT}/configuration.yaml"
110
128
 
111
- $SED -i "${ROOT}/configuration.yaml" \
129
+ sed_i \
112
130
  -e 's/Protocol: RealPBFT/Protocol: Cardano/' \
113
131
  -e 's|GenesisFile: genesis.json|ByronGenesisFile: genesis/byron/genesis.json|' \
114
132
  -e '/ByronGenesisFile/ aShelleyGenesisFile: genesis/shelley/genesis.json' \
@@ -117,7 +135,8 @@ $SED -i "${ROOT}/configuration.yaml" \
117
135
  -e 's/LastKnownBlockVersion-Major: 0/LastKnownBlockVersion-Major: 6/' \
118
136
  -e 's/LastKnownBlockVersion-Minor: 2/LastKnownBlockVersion-Minor: 0/' \
119
137
  -e "s/minSeverity: Info/minSeverity: ${CARDANO_NODE_LOG_LEVEL}/" \
120
- -e "s/cardano.node.ChainDB: Notice/cardano.node.ChainDB: ${CARDANO_NODE_CHAINDB_LOG_LEVEL}/"
138
+ -e "s/cardano.node.ChainDB: Notice/cardano.node.ChainDB: ${CARDANO_NODE_CHAINDB_LOG_LEVEL}/" \
139
+ "${ROOT}/configuration.yaml"
121
140
 
122
141
  echo "" >>"${ROOT}/configuration.yaml"
123
142
  echo "PBftSignatureThreshold: 0.6" >>"${ROOT}/configuration.yaml"
@@ -159,7 +178,7 @@ jq --raw-output ".protocolConsts.protocolMagic = ${NETWORK_MAGIC}" "${ROOT}/gene
159
178
 
160
179
  rm "${ROOT}/genesis/byron/genesis-wrong.json"
161
180
 
162
- $SED -i "${ROOT}/genesis/shelley/genesis.json" \
181
+ sed_i \
163
182
  -e 's/"slotLength": 1/"slotLength": 0.2/' \
164
183
  -e 's/"activeSlotsCoeff": 5.0e-2/"activeSlotsCoeff": 0.1/' \
165
184
  -e 's/"securityParam": 2160/"securityParam": 10/' \
@@ -172,7 +191,8 @@ $SED -i "${ROOT}/genesis/shelley/genesis.json" \
172
191
  -e 's/"major": 0/"major": 7/' \
173
192
  -e 's/"rho": 0.0/"rho": 0.1/' \
174
193
  -e 's/"tau": 0.0/"tau": 0.1/' \
175
- -e 's/"updateQuorum": 5/"updateQuorum": 2/'
194
+ -e 's/"updateQuorum": 5/"updateQuorum": 2/' \
195
+ "${ROOT}/genesis/shelley/genesis.json"
176
196
 
177
197
  for NODE_ID in ${SP_NODES_ID}; do
178
198
  TARGET="${ROOT}/node-sp${NODE_ID}"
@@ -248,8 +268,8 @@ for NODE in ${SP_NODES}; do
248
268
  done
249
269
 
250
270
  echo "Update start time in genesis files"
251
- $SED -i -E "s/\"startTime\": [0-9]+/\"startTime\": ${timeUnix}/" ${ROOT}/genesis/byron/genesis.json
252
- $SED -i -E "s/\"systemStart\": \".*\"/\"systemStart\": \"${timeISO}\"/" ${ROOT}/genesis/shelley/genesis.json
271
+ sed_i -E "s/\"startTime\": [0-9]+/\"startTime\": ${timeUnix}/" ${ROOT}/genesis/byron/genesis.json
272
+ sed_i -E "s/\"systemStart\": \".*\"/\"systemStart\": \"${timeISO}\"/" ${ROOT}/genesis/shelley/genesis.json
253
273
 
254
274
  byronGenesisHash=$(cardano-cli byron genesis print-genesis-hash --genesis-json ${ROOT}/genesis/byron/genesis.json)
255
275
  shelleyGenesisHash=$(cardano-cli genesis hash --genesis ${ROOT}/genesis/shelley/genesis.json)
@@ -259,9 +279,9 @@ echo "Byron genesis hash: $byronGenesisHash"
259
279
  echo "Shelley genesis hash: $shelleyGenesisHash"
260
280
  echo "Alonzo genesis hash: $alonzoGenesisHash"
261
281
 
262
- $SED -i -E "s/ByronGenesisHash: '.*'/ByronGenesisHash: '${byronGenesisHash}'/" ${ROOT}/configuration.yaml
263
- $SED -i -E "s/ShelleyGenesisHash: '.*'/ShelleyGenesisHash: '${shelleyGenesisHash}'/" ${ROOT}/configuration.yaml
264
- $SED -i -E "s/AlonzoGenesisHash: '.*'/AlonzoGenesisHash: '${alonzoGenesisHash}'/" ${ROOT}/configuration.yaml
282
+ sed_i -E "s/ByronGenesisHash: '.*'/ByronGenesisHash: '${byronGenesisHash}'/" ${ROOT}/configuration.yaml
283
+ sed_i -E "s/ShelleyGenesisHash: '.*'/ShelleyGenesisHash: '${shelleyGenesisHash}'/" ${ROOT}/configuration.yaml
284
+ sed_i -E "s/AlonzoGenesisHash: '.*'/AlonzoGenesisHash: '${alonzoGenesisHash}'/" ${ROOT}/configuration.yaml
265
285
 
266
286
  # Create config folder
267
287
  rm -rf ./config/*
@@ -274,14 +294,16 @@ cp ./templates/babbage/db-sync-config.json ./config/network/cardano-db-sync/conf
274
294
  cp ./templates/babbage/node-config.json ./config/network/cardano-node/config.json
275
295
  cp ./templates/babbage/submit-api-config.json ./config/network/cardano-submit-api/config.json
276
296
 
277
- $SED -i -E "s/\"ByronGenesisHash\": \".*\"/\"ByronGenesisHash\": \"${byronGenesisHash}\"/" ./config/network/cardano-node/config.json
278
- $SED -i -E "s/\"ShelleyGenesisHash\": \".*\"/\"ShelleyGenesisHash\": \"${shelleyGenesisHash}\"/" ./config/network/cardano-node/config.json
279
- $SED -i -E "s/\"AlonzoGenesisHash\": \".*\"/\"AlonzoGenesisHash\": \"${alonzoGenesisHash}\"/" ./config/network/cardano-node/config.json
297
+ sed_i -E "s/\"ByronGenesisHash\": \".*\"/\"ByronGenesisHash\": \"${byronGenesisHash}\"/" ./config/network/cardano-node/config.json
298
+ sed_i -E "s/\"ShelleyGenesisHash\": \".*\"/\"ShelleyGenesisHash\": \"${shelleyGenesisHash}\"/" ./config/network/cardano-node/config.json
299
+ sed_i -E "s/\"AlonzoGenesisHash\": \".*\"/\"AlonzoGenesisHash\": \"${alonzoGenesisHash}\"/" ./config/network/cardano-node/config.json
280
300
 
281
301
  cp ./templates/babbage/topology.json ./config/network/cardano-node/topology.json
282
302
  # docker hostname in topology.json isn't working, so need to specify ip of local network
283
303
  CONTAINER_IP=$(hostname -I | xargs)
284
- $SED -i "s/172.17.0.1/$CONTAINER_IP/g" ./config/network/cardano-node/topology.json
304
+ sed_i "s/172.17.0.1/$CONTAINER_IP/g" ./config/network/cardano-node/topology.json
305
+ # Note: for some reason, the first cardano-node (on port 3001) isn’t immediately responsive to the outside world, so:
306
+ sed_i "s/3001/3002/g" ./config/network/cardano-node/topology.json
285
307
 
286
308
  cp "${ROOT}"/genesis/byron/genesis.json ./config/network/cardano-node/genesis/byron.json
287
309
  cp "${ROOT}"/genesis/byron/genesis.json ./config/network/genesis/byron.json
@@ -10,4 +10,4 @@
10
10
  while [ -f /sdk-ipc/prevent_ogmios ]; do sleep 10; done
11
11
 
12
12
  # Start the ogmios as normal
13
- /bin/ogmios "$@"
13
+ exec /bin/ogmios "$@"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cardano-sdk/e2e",
3
- "version": "0.33.2",
3
+ "version": "0.34.0",
4
4
  "description": "End to end tests for the cardano-js-sdk packages.",
5
5
  "engines": {
6
6
  "node": ">=16.20.2"
@@ -44,7 +44,7 @@
44
44
  "test:web-extension:watch:run": "yarn test:web-extension:run --watch",
45
45
  "test:web-extension:watch": "run-s test:web-extension:build test:web-extension:watch:bg",
46
46
  "test:web-extension:watch:bg": "run-p test:web-extension:watch:build test:web-extension:watch:run",
47
- "local-network:common": "DISABLE_DB_CACHE=${DISABLE_DB_CACHE:-true} SUBMIT_API_ARGS='--testnet-magic 888' USE_BLOCKFROST=false docker compose -p local-network-e2e -f docker-compose.yml -f ../../compose/common.yml $FILES up",
47
+ "local-network:common": "DISABLE_DB_CACHE=${DISABLE_DB_CACHE:-true} SUBMIT_API_ARGS='--testnet-magic 888' USE_BLOCKFROST=false __FIX_UMASK__=$(chmod -R a+r ../../compose/placeholder-secrets) docker compose -p local-network-e2e -f docker-compose.yml -f ../../compose/common.yml -f ../../compose/$(uname -m).yml $FILES up",
48
48
  "local-network:up": "FILES='' yarn local-network:common",
49
49
  "local-network:dev": "FILES='-f ../../compose/dev.yml' yarn local-network:common",
50
50
  "local-network:profile:up": "FILES='-f ../../compose/pg-agent.yml' yarn local-network:common",
@@ -80,23 +80,23 @@
80
80
  "dependencies": {
81
81
  "@cardano-foundation/ledgerjs-hw-app-cardano": "^6.0.0",
82
82
  "@cardano-ogmios/client": "5.6.0",
83
- "@cardano-sdk/cardano-services": "~0.27.1",
84
- "@cardano-sdk/cardano-services-client": "~0.18.0",
83
+ "@cardano-sdk/cardano-services": "~0.28.0",
84
+ "@cardano-sdk/cardano-services-client": "~0.19.0",
85
85
  "@cardano-sdk/core": "~0.30.0",
86
86
  "@cardano-sdk/crypto": "~0.1.22",
87
- "@cardano-sdk/hardware-ledger": "~0.8.19",
88
- "@cardano-sdk/hardware-trezor": "~0.4.19",
89
- "@cardano-sdk/input-selection": "~0.12.26",
87
+ "@cardano-sdk/hardware-ledger": "~0.9.1",
88
+ "@cardano-sdk/hardware-trezor": "~0.4.20",
89
+ "@cardano-sdk/input-selection": "~0.12.27",
90
90
  "@cardano-sdk/key-management": "~0.20.1",
91
- "@cardano-sdk/ogmios": "~0.15.20",
92
- "@cardano-sdk/tx-construction": "~0.18.2",
91
+ "@cardano-sdk/ogmios": "~0.15.21",
92
+ "@cardano-sdk/tx-construction": "~0.18.3",
93
93
  "@cardano-sdk/util": "~0.15.0",
94
- "@cardano-sdk/util-dev": "~0.19.18",
95
- "@cardano-sdk/util-rxjs": "~0.7.9",
96
- "@cardano-sdk/wallet": "~0.35.2",
94
+ "@cardano-sdk/util-dev": "~0.20.0",
95
+ "@cardano-sdk/util-rxjs": "~0.7.10",
96
+ "@cardano-sdk/wallet": "~0.37.0",
97
97
  "@dcspark/cardano-multiplatform-lib-nodejs": "^3.1.1",
98
98
  "@vespaiach/axios-fetch-adapter": "^0.3.0",
99
- "axios": "^0.27.2",
99
+ "axios": "^0.28.0",
100
100
  "bunyan": "^1.8.15",
101
101
  "chalk": "4.1.2",
102
102
  "cli-spinners": "^2.9.0",
@@ -124,9 +124,9 @@
124
124
  "@babel/preset-env": "^7.18.2",
125
125
  "@babel/preset-typescript": "^7.17.12",
126
126
  "@cardano-sdk/dapp-connector": "~0.12.14",
127
- "@cardano-sdk/projection": "~0.11.10",
128
- "@cardano-sdk/projection-typeorm": "~0.8.12",
129
- "@cardano-sdk/web-extension": "~0.26.1",
127
+ "@cardano-sdk/projection": "~0.11.11",
128
+ "@cardano-sdk/projection-typeorm": "~0.8.13",
129
+ "@cardano-sdk/web-extension": "~0.27.0",
130
130
  "@dcspark/cardano-multiplatform-lib-browser": "^3.1.1",
131
131
  "@emurgo/cardano-message-signing-asmjs": "^1.0.1",
132
132
  "@types/bunyan": "^1.8.8",
@@ -179,5 +179,5 @@
179
179
  "webpack-cli": "^4.9.2",
180
180
  "webpack-merge": "^5.8.0"
181
181
  },
182
- "gitHead": "5b0ce8d96892557f5e950c4d8633415b61975090"
182
+ "gitHead": "7f5eadff3a78b3e8c10fd518eb9f13cddc9f2bad"
183
183
  }