Skip to content

Commit aa9860e

Browse files
committed
update comment, debug docker speculos output
1 parent 20a9f7c commit aa9860e

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

.github/workflows/_ledgernano.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,12 @@ jobs:
3333
mv nanox/iota sdk/ledgerjs-hw-app-iota/tests/iota
3434
3535
- name: Start speculos simulator
36-
run: docker run --rm -d -p 5000:5000 -v $(pwd)/sdk/ledgerjs-hw-app-iota/tests:/app ghcr.io/ledgerhq/speculos --api-port 5000 --display headless /app/iota
36+
run: |
37+
# Start the container in detached mode and capture its ID
38+
container_id=$(docker run --rm -d -p 5000:5000 -v $(pwd)/sdk/ledgerjs-hw-app-iota/tests:/app ghcr.io/ledgerhq/speculos --api-port 5000 --display headless /app/iota)
39+
40+
# Print logs for 5 seconds
41+
timeout 5 docker logs -f $container_id || true
3742
3843
- name: Run TS SDK ledgernano tests
3944
run: pnpm --filter @iota/ledgerjs-hw-app-iota test

sdk/ledgerjs-hw-app-iota/tests/Iota.test.ts

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,22 @@ import Iota from '../src/Iota';
1111
const API_PORT: number = 5000;
1212
const SPECULOS_BASE_URL: string = `http://127.0.0.1:${API_PORT}`;
1313

14-
// Before running the tests you need to install speculos and start the iota app with it.
15-
// If the binary is not available, download it:
16-
// gh release download --repo https://github.com/iotaledger/ledger-app-iota -p nanox.tar.gz ledger-app-iota-v1.0.0
14+
// Before running the tests, pull the speculos Docker image and download the ledgernano binary.
15+
// Then start the speculos simulator and run the tests.
16+
//
17+
// Pull speculos docker image:
18+
// docker pull ghcr.io/ledgerhq/speculos
19+
//
20+
// Download ledgernano binary:
21+
// curl -L -o nanox.tar.gz https://github.com/iotaledger/ledger-app-iota/releases/download/ledger-app-iota-v1.0.0/nanox.tar.gz
1722
// tar -xvf nanox.tar.gz
18-
// sudo apt-get install qemu-user-static libxcb-xinerama0 // might be needed for speculos to work
19-
// pip install speculos
20-
// Finally to start the emulator:
21-
// speculos --api-port 5000 --display headless ./sdk/ledgerjs-hw-app-iota/tests/iota
23+
// mv nanox/iota sdk/ledgerjs-hw-app-iota/tests/iota
24+
//
25+
// Start speculos simulator:
26+
// docker run --rm -d -p 5000:5000 -v $(pwd)/sdk/ledgerjs-hw-app-iota/tests:/app ghcr.io/ledgerhq/speculos --api-port 5000 --display headless /app/iota
27+
//
28+
// Run tests:
29+
// pnpm --filter @iota/ledgerjs-hw-app-iota test
2230
describe.sequential('Test ledgerjs-hw-app-iota', () => {
2331
it('Iota init', async () => {
2432
const transport = await openTransportReplayer(RecordStore.fromString(''));

0 commit comments

Comments
 (0)