Teal debugger with docker sandbox

Hey guys. I’m using Docker sandbox on windows machine and I need to use teal debugger quite often. When I use tealdbg it runs on, but chrome inspect can’t locate it. It seems the sandbox isn’t exposing 9392 port. Is there any quick solution to fix that?


Yes, you can do it. See tealdbg: listen on specified address by algorandskiy · Pull Request #1977 · algorand/go-algorand · GitHub

Thanks Fabrice. Followed your steps, but not everything goes the same way as you described. What I did:

  1. Added EXPOSE 9392 in /sandbox/images/algod/Dockerfile
  2. Added binding - 9392:9392 in docker-compose.yml file for algod service
  3. Cleaned sandbox, re-build images and started sandbox
  4. Inside sandbox run this command tealdbg debug --remote-debugging-port 9392 --listen "" simple.teal. But it didn’t work. There is no flag by name listen, so it says ‘unknows flag’. Tried without that flag, but no success.
$ docker ps
CONTAINER ID   IMAGE                COMMAND                  CREATED         STATUS         PORTS                                                      NAMES
d20e5507f47d   sandbox_indexer      "/tmp/start.sh"          3 minutes ago   Up 3 minutes>8980/tcp                                     algorand-sandbox-indexer
e86d9e1eac9c   postgres:13-alpine   "docker-entrypoint.s…"   3 minutes ago   Up 3 minutes>5432/tcp                                     algorand-sandbox-postgres
102a27bf8918   sandbox_algod        "/opt/start_algod.sh"    3 minutes ago   Up 3 minutes>4001-4002/tcp,>9392/tcp   algorand-sandbox-algod

P.S. I tried replacing localhost with docker container ip address in tealdbg generated devtools url, but no changes.

Could be the problem that exposed port is tcp, but maybe it should be ws? Any suggestions?

Can you check your algod version (inside sandbox goal version -v)?
Sandbox often does not remove enough layers to force upgrade of algod.
Simplest solution is docker system prune -a to force rebuild, but it also removes other containers you may be using for other purposes.

EDIT: I wrote docker system prune before without the -a flag, but this is not sufficient.

My other containers are for dev, so can rebuild all of them, did docker system prune.
here is algod version:

Version: [v1 v2]
GenesisID: sandnet-v1
Build: 2.5.6.stable [rel/stable]

Indeed, it looks like this is not yet in the stable version.
So in that case, you need to use this workaround: [Investigation] Allow tealdbg to listen to any address · Issue #1809 · algorand/go-algorand · GitHub

Great, with this workaround it worked. Thanks!

Although a question… as I see from docs stable is v2.5.5, but with sandbox comes the latest 2.5.6? I also have running test node on Linux server and it has same 2.5.6 version of algod.

I’m wondering if having non stable version (2.5.6 this case) would make other issues during the development. Is there a way to indicate which version of algod sandbox should load?