How to get trace of transactions from command line?

I want to be able to trace transactions without using Visual Code.
Is it possible to get the same trace of transactions and tables with only the command line tools?

daml test shows you some information when the test fails but outside of that, you are limited to Visual Studio Code at the moment.

1 Like

how does Visual Studio does it at the moment? Anyway of someone developing a application that does that?

The LSP server provides a bunch of custom methods for that. You could in theory try to copy what it does but it’s a bunch of undocumented APIs with no stability guarantees so I don’t recommend it. If you want to give it a shot anyway, maybe take a look at the vscode extension.

It’s probably worth mentioning that the extension runs against a special ledger that allows it to see everything. If you were to try and develop a similar visualization tool that targets real ledgers, you’ll be limited to whatever your token can see.

That makes sense.

Still haven’t found time to dive into it, but it seems like an interesting topic to learn about.

Does “special ledger” mean not the sandbox? Some daml ledger that propertary?

It’s all part of the open-source SDK, so I’m not sure “proprietary” is the best word here (though DA does retain copyright), but it is indeed not Sandbox. In order to be able to display the level of feedback we want to have in the IDE, the IDE is running against a “more instrumented” ledger than Sandbox, running in the same process as its instrumentation.

is this more instrumented ledger available for download to run as a standalone cli? or any open source details about it?

There is a scenario-service.jar in the SDK in ~/daml/sdk/$sdkversion/damlc/resources/scenario-service.jar. You are on your own wrt to how to use it though, it’s not intended as a public API.

It is controlled via a protobuf API. The haskell code that talks to it is in daml/LowLevel.hs at 6caedfb0ca632775e856aa3767967c7cb962a714 · digital-asset/daml · GitHub.