Skip to content

Commit

Permalink
feat: add Docker Compose and GDB debug script debug purposes
Browse files Browse the repository at this point in the history
- Create docker-compose.yml for Speculos emulator setup
- Add gdb.sh script to simplify debugging workflow
- Configure container with source, binary, and debug port mappings
  • Loading branch information
keiff3r committed Feb 12, 2025
1 parent c395fa7 commit f1a2e7d
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# version: "3.7"

services:
nanosp:
image: ghcr.io/blooo-io/speculos:latest
volumes:
- ./bin:/speculos/apps
- ./src:/speculos/sources
- ./build:/speculos/build
ports:
- "5000:5000" # api
- "40000:40000" # apdu
environment:
- GDB_DIRECTORY_LIST="/speculos/sources:/speculos/sources/ui:/speculos/sources/handler:"
command: "-d --model nanosp build/nanos2/bin/app.elf --display headless --apdu-port 40000"
# Add `--vnc-password "<password>"` for macos users to use built-in vnc client.
12 changes: 12 additions & 0 deletions gdb.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

docker compose up -d

# Wait for the container to start
until docker inspect -f '{{.State.Status}}' app-everscale-nanosp-1 | grep -q "running"; do
sleep 1
done

docker exec -it app-everscale-nanosp-1 ./tools/debug.sh apps/app.elf

docker compose down

0 comments on commit f1a2e7d

Please sign in to comment.