Teal debugger with docker sandbox - General - Algorand
Teal debugger with docker sandbox
post by pagito on May 16, 2021
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 127.0.0.1:9392, but chrome inspect can’t locate it. It seems the sandbox isn’t exposing 9392 port. Is there any quick solution to fix that?
Cheers!
post by fabrice on May 16, 2021
Yes, you can do it. See tealdbg: listen on specified address by algorandskiy · Pull Request #1977 · algorand/go-algorand · GitHub
post by pagito on May 17, 2021
Thanks Fabrice. Followed your steps, but not everything goes the same way as you described. What I did:
- Added
EXPOSE 9392in /sandbox/images/algod/Dockerfile - Added binding
- 9392:9392in docker-compose.yml file for algod service - Cleaned sandbox, re-build images and started sandbox
- Inside sandbox run this command
tealdbg debug --remote-debugging-port 9392 --listen "" simple.teal. But it didn’t work. There is no flag by namelisten, so it says ‘unknown 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 0.0.0.0:8980->8980/tcp algorand-sandbox-indexer
e86d9e1eac9c postgres:13-alpine "docker-entrypoint.s…" 3 minutes ago Up 3 minutes 0.0.0.0:5433->5432/tcp algorand-sandbox-postgres
102a27bf8918 sandbox_algod "/opt/start_algod.sh" 3 minutes ago Up 3 minutes 0.0.0.0:4001-4002->4001-4002/tcp, 0.0.0.0:9392->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?
post by fabrice on May 17, 2021
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.
post by pagito on May 17, 2021
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]
post by fabrice on May 17, 2021
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
post by pagito on May 17, 2021
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?