Skip to content

CLI: Log per-instruction details when using --export#46

Open
aoikurokawa wants to merge 2 commits intosolana-program:mainfrom
aoikurokawa:ak/log
Open

CLI: Log per-instruction details when using --export#46
aoikurokawa wants to merge 2 commits intosolana-program:mainfrom
aoikurokawa:ak/log

Conversation

@aoikurokawa
Copy link
Copy Markdown

@aoikurokawa aoikurokawa commented Apr 28, 2026

Summary

  • Added logInstructions helper to clients/js/src/cli/utils.ts that prints a breakdown of each instruction in a transaction when --export is used
  • Each instruction shows: program address, accounts with writable (W) and signer (S) flags, and base58-encoded instruction data
  • Refactored exportTransactionPlan to split the pipe into two steps so the pre-compiled message is accessible before compileTransaction

Example output

> [Transaction #1]
>
> ------ IX #1 ------
> ComputeBudget111...
>
> ------ IX #2 ------
> ProgM6...
>
> Encoded:
> <base58>
> 

@aoikurokawa aoikurokawa changed the title CLI: Log per-instruction details when using --expor CLI: Log per-instruction details when using --export Apr 28, 2026
@aoikurokawa aoikurokawa marked this pull request as ready for review April 28, 2026 19:42
@lorisleiva
Copy link
Copy Markdown
Member

Hi there, thanks for the PR. Would you mind just adding a bit more information regarding what use-cases to unlocks or problems this solves?

Additionally, I have an UI issue with logging all instructions before the serialised transactions since it's not clear which instruction is part of which transaction.

@aoikurokawa
Copy link
Copy Markdown
Author

Thanks for the feedback!
The primary motivation is Squads v3 multisig workflows. When managing program metadata through a multisig, you can't use the full base58 transaction output directly — I think Squads v3's "Import from base58" field expects raw instruction data bytes, not a full serialized transaction. Instead, you have to use the "Custom instruction" form and manually enter the program ID, accounts (with writable/signer flags), and base58 instruction data for each instruction one at a time.

@tyonadodson5-cpu

This comment was marked as spam.

@SACKS-lab
Copy link
Copy Markdown

Complete

@lorisleiva
Copy link
Copy Markdown
Member

@aoikurokawa Are you sure about this? I've managed to upload IDL via a Squads multisig before using the export command as-is. In fact, this is how the Program Metadata IDL itself was uploaded.

In any case, I'm happy to have this extra "instruction export" mode, but I would rather it was as a separate export mode so we don't pollute the CLI output when users only need the raw transaction bytes. Perhaps something like --export-encoding instruction-list.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants