Skip to content

Latest commit

 

History

History
64 lines (40 loc) · 1.53 KB

quickstart.md

File metadata and controls

64 lines (40 loc) · 1.53 KB

Quickstart

A ten-minute tour of all three tools.

Read a transaction you already have

Save a base64 XDR string to a file and point lens at it:

lens explain --file tx.xdr

You get a readable summary: what the transaction was trying to do, whether it succeeded, and if not, which operation failed and why.

To see the full structure instead of a summary:

lens decode --file tx.xdr

To get machine-readable output for scripting:

lens decode --file tx.xdr --json | jq '.operations'

Compare two transactions

When two transactions differ and you can't see how:

lens diff --file expected.xdr --file actual.xdr

Watch a contract as it runs

Point prism at a deployed contract and leave it running:

prism events --contract <CONTRACT_ID>

Events stream in decoded as new ledgers close. Add --json for NDJSON output that pipes into other tools:

prism events --contract <CONTRACT_ID> --json | jq 'select(.topic[0] == "transfer")'

Assert on XDR in a test

Add focus to your Go project and use it where you'd otherwise compare strings:

import "github.com/stellar-optics/stellar-focus"

When an assertion fails, the output is a structural diff of the decoded values, not two walls of base64.

See Writing assertions for the full API.

Where to go next