| name | mock-server |
| description | Talk to the DMK device mock server (apps/device-mock-server, default http://127.0.0.1:9752) with curl. Make fake devices, connect them, add APDU mocks, send APDUs, break commands on purpose. ALWAYS read this skill when the user says "mock server", makes/changes a mock device, adds mocks, forces an APDU error, or pokes a device Ledger Live/DMK is on.
|
Mock server
Fake Ledger devices over REST. You do curl. Server hands back JSON.
Big book of every route: apps/device-mock-server/openapi.yaml. Read it when
this file is not enough.
Rules to remember
- URL is
http://127.0.0.1:9752.
- Every call needs
Authorization: Bearer <token>. Only POST /auth and
GET /health go free.
- Get token:
POST /auth. Or steal the one Ledger Live/DMK uses.
- Curl to
127.0.0.1 needs required_permissions: ["all"].
- Server forgets everything on restart. No disk.
Set once per shell:
BASE=http://127.0.0.1:9752
TOKEN=<bearer-token>
AUTH="Authorization: Bearer $TOKEN"
JSON="Content-Type: application/json"
Client device (Ledger Live / DMK)
Client makes its own device when it connects. To touch it:
- Ask user for the FULL token. Logs show only first 8 letters.
- Find device with
GET /devices. Change it with PATCH.
- NEVER delete then remake it. New id = client lost forever.
The curl commands
curl -s -X POST /auth
curl -s /health
curl -s /devices -H
curl -s /devices/<> -H
curl -s -X POST /devices -H -H \
-d
curl -s -X PATCH /devices/<> -H -H \
-d
curl -s -X DELETE /devices/<> -H
curl -s -X POST /devices/<>/connect -H
curl -s -X POST /devices/<>/apdu -H -H -d
curl -s /devices/<>/mocks -H
curl -s -X POST /devices/<>/mocks -H -H -d
curl -s -X PATCH /devices/<>/mocks/<mockId> -H -H -d
curl -s -X DELETE /devices/<>/mocks/<mockId> -H
curl -s -X DELETE /devices/<>/mocks -H
curl -s /export -H
curl -s -X POST /import -H -H -d
curl -s -X PUT /sessions/current/seed -H -H \
-d