Skip to content

Add Java examples to the transactions and basics guides - #3127

Merged
ElliotFriend merged 10 commits into
mainfrom
docs-agent/1770-java-a
Nov 13, 2026
Merged

ElliotFriend merged 10 commits into
mainfrom
docs-agent/1770-java-a

Conversation

@stellar-doxie

@stellar-doxie stellar-doxie Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

🤖 Automated message from the Stellar Triage Bot.

Refs #1770

Working this because @ElliotFriend asked with /triage on #1770 and approved the splits. This is Java A: Java tabs on the 14 pages under build/guides/transactions and build/guides/basics that lacked Java. Base: #3126 (docs-agent/1770-go-d). Java B to D follow, stacked on this PR.

Why this matters

A reader who follows these guides in Java had no example on 14 pages, so the Guides section stayed inconsistent (#1770, option 1).

What changed

  • Java tabs after Go on: basics/automate-reset-data, basics/verify-trustlines, transactions/channel-accounts, claimable-balances, clawbacks, fee-bump-transactions, install-deploy-contract-with-code, path-payments, pooled-accounts-muxed-accounts-memos, signing-soroban-invocations, simulateTransaction-Deep-Dive, sponsored-reserves, submit-transaction-wait, upload-wasm-bytecode.
  • Tab order on every touched code group: JavaScript, Python, Go, Java.
  • Fee bids follow the pages' pattern: capped fee-stats p90 (inclusionFee for classic, sorobanInclusionFee for Soroban), the Soroban fee-payer included.
  • Prose that listed the languages now names Java too (setup steps, prerequisites, "the Python, Go, and Java SDKs have no getAssetBalance").
  • Review fixes (9e87762, rebased from 4dc8c77): the upload-wasm-bytecode Java and Python tabs check the send status and poll at most 30 times, the way the JavaScript and Go tabs do since Add Go examples to the transactions and basics guides #3123. The Java fee-payer bids the capped sorobanInclusionFee p90.
  • 845ba11: Oxford comma in the clawbacks Java comment.

Java SDK gaps the tabs work around

  • SorobanServer.sendTransaction takes only a Transaction (a TODO in 6.0.0). The fee-bump tab sends the envelope with a plain JSON-RPC sendTransaction call. submit-transaction-wait says its Java helper takes no fee-bump and links that guide.
  • AssembledTransaction.simulate() rebuilds from the builder and drops signed auth entries. The auth-entry tab re-simulates the signed transaction with simulateTransaction. The page says so next to the Python note.
  • ContractClient.invoke loads its source account. If the sender were the source, simulation returns source-account credentials with nothing to sign. The tab passes the fee-payer's address as the source.
  • No return-value field on GetTransactionResponse: the deploy tabs read it from the transaction meta (v4, then v3), like the Python and Go tabs.

Sweep

Verified

  • Every class, builder field, overload and enum against lightsail-network/[email protected] (newest; the create-account page pins network.lightsail:stellar-sdk:6.0.0), for example SorobanServer.java:719 (sendTransaction(Transaction) only), SorobanServer.java:370 (pollTransaction(hash, maxAttempts, sleepStrategy)), SorobanServer.java:1133-1140 (assembleTransaction swaps the resource fee), contract/AssembledTransaction.java:146-176 (simulate rebuilds), contract/ContractClient.java:122-148, operations/InvokeHostFunctionOperation.java:103 (null salt is random), FeeBumpTransaction.java:78, Transaction.java:156 (getClaimableBalanceId), Auth.java:130.
  • The Python poll fix against stellar-sdk (PyPI) 17.0.1 (newest): soroban_server.py:272 (poll_transaction), soroban_rpc.py:344 (SendTransactionStatus), soroban_rpc.py:561-570 (30 attempts, 1 s apart).
  • signAuthEntries and Auth.authorizeEntry sign ADDRESS_V2 credentials, which Protocol 30 simulation can return.
  • checks, CodeQL, and Socket green at 9e877629.
  • ElliotFriend compiled all 35 Java blocks against stellar-sdk 6.0.0 and ran every page on testnet at cd3b90bb.

Not verified

  • The Java and Python changes in 9e87762 were not compiled or run: java and javac need approval in the bot's lanes.
  • The fee-bump tab reads "status":"PENDING" from the raw JSON-RPC reply. stellar-rpc writes compact JSON.
  • Java 17 or later is needed for HexFormat and record; the SDK itself targets Java 8.

Merge order

Rebased onto docs-agent/1770-go-d (#3126). Merge #3126 first. #3131 (Java B) needs a rebase onto this branch.

@ElliotFriend ElliotFriend left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All 35 Java blocks compile against stellar-sdk 6.0.0 with no errors or warnings (-Xlint:all), and every page ran on testnet. Nice work. A few fixes before merge:

Code

  • This PR now conflicts with Go A (#3123). The review fixes there changed upload-wasm-bytecode and signing-soroban-invocations. When it's rebased, match those fixes:
    • upload-wasm-bytecode.mdx:540-552: the Java loop never checks the send status, and while (true) polls forever on a rejected send. Throw on ERROR or TRY_AGAIN_LATER, cap the polls at 30, then report "status unknown", like the JavaScript and Go tabs now do. The Python tab on this page (while True) needs the same fix.
    • signing-soroban-invocations.mdx:1147: the fee-payer reuses the client's inclusion fee (100 stroops on testnet). The JavaScript, Python, and Go tabs now bid the capped fee-stats p90 here, so the Java tab should too. Then fix the comment at :821 ("the fee-payer sets the real bid") to match.

Prose and comments

  • Oxford comma: install-deploy-contract-with-code.mdx:8 and :700 (twice); verify-trustlines.mdx:23; submit-transaction-wait.mdx:314.
  • sponsored-reserves.mdx:709-710: use _sends_ and _approve_, not asterisks.
  • upload-wasm-bytecode.mdx:471: comma splice ("then run its main method, it reads..."). Split it into two sentences.

The unfunded secret on automate-reset-data is tracked in #3128, so leave it out of this PR.

@stellar-doxie stellar-doxie Bot added the bot:needs-decision Bot needs a maintainer decision (listing, scope, policy) label Nov 13, 2026
@stellar-doxie

stellar-doxie Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Automated message from the Stellar Triage Bot.

Back on my own PR because @ElliotFriend requested changes.

I pushed every review fix in 4dc8c77. This PR now conflicts with its base, since GitHub rebased Go D (#3126). I never force-push. Can a maintainer rebase docs-agent/1770-java-a onto docs-agent/1770-go-d? @kaankacar @ElliotFriend (hold: stellar/github-triage-bot#99)

What I checked
  • Review fixes in 4dc8c77:
    • upload-wasm-bytecode, Java and Python tabs: throw on TRY_AGAIN_LATER or ERROR, poll at most 30 times, and report NOT_FOUND after the last poll as "status unknown". I split the Java comma splice.
    • signing-soroban-invocations, Java fee-payer: bids the capped sorobanInclusionFee p90. The client's 100 comment now says the value is for simulation only.
    • Oxford commas at the cited lines. I also fixed two more copies in Java text: the automate-reset-data helper comment and the install-deploy prepareTransaction paragraph.
    • sponsored-reserves, Java comment: _sends_ and _approve_.
    • install-deploy: "Run the Go version" now sits next to the code, as in Add Go examples to the transactions and basics guides #3123.
  • Sources: java-stellar-sdk 6.0.0 (newest; the pages pin 6.0.0): SorobanServer.java:370 (pollTransaction(hash, maxAttempts, sleepStrategy)), SendTransactionResponse.java:58 (statuses). stellar-sdk (PyPI) 17.0.1 (newest): soroban_server.py:272 (poll_transaction), soroban_rpc.py:344 (SendTransactionStatus).
  • Rebase rehearsal (local only): 7 of 8 Java commits apply cleanly on go-d d4e88a9d. cd3b90bb conflicts only in install-deploy-contract-with-code.mdx, in 3 prose hunks. The fix commit edits the same lines. Keep go-d's Go lines and the Java text with Oxford commas.
  • Not run: the Java and Python changes in 4dc8c77. You ran all Java blocks at cd3b90bb.
  • Checks: green at cd3b90bb (checks, CodeQL, Socket). GitHub skips checks at 4dc8c77 while the PR conflicts. I checked the format by hand: only Java and Python fences and one-line paragraphs changed.
  • No live preview: Mintlify Deployment skips on a stacked base.
  • The unfunded secret on automate-reset-data stays with Example contracts on testnet disappear after every reset #3128, as you asked.
  • Add Java examples to the archival, conventions, conversions, events, and RPC guides #3131 (Java B) is stacked on this branch, so it needs a rebase after this one.

@stellar-doxie

stellar-doxie Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Automated message from the Stellar Triage Bot.

Back on my own PR because it still conflicts with its base, Go D (#3126). GitHub rebased Go D after #3123, #3124, and #3125 merged.

I did not merge Go D into this branch, because you asked to keep stack #3118 linear. I rebased it instead and pushed the result to a new branch, docs-agent/1770-java-a-rebased (9e877629). To use it, run git fetch origin, then git push --force-with-lease=docs-agent/1770-java-a:4dc8c774 origin origin/docs-agent/1770-java-a-rebased:docs-agent/1770-java-a. Then you can delete the -rebased branch. @ElliotFriend

What I checked
  • git range-diff 282a55c5..4dc8c774 d4e88a9d..9e877629: commits 1 to 7 are identical.
  • cd3b90bb conflicted in install-deploy-contract-with-code.mdx only, in 3 prose lines. I kept Go D's text and added the Java text with Oxford commas. "Run the Go version" stays next to the code, as in Add Go examples to the transactions and basics guides #3123.
  • 4dc8c774 applied cleanly. Its prose edits to that page were already in the resolved commit, so only its other files changed.
  • No content change from the PR head beyond Go D's own updates. Not run: the Java and Python changes in 4dc8c774, as before.
  • No checks run or preview at this head: the PR still conflicts, and the new branch has no PR.
  • Add Java examples to the archival, conventions, conversions, events, and RPC guides #3131 (Java B) is stacked on this branch and needs the same rebase after this one.

@ElliotFriend
ElliotFriend force-pushed the docs-agent/1770-java-a branch from 4dc8c77 to 9e87762 Compare November 13, 2026 18:38
@stellar-doxie stellar-doxie Bot added bot:ready-to-merge Bot verified and approved; waiting for a maintainer to merge and removed bot:needs-decision Bot needs a maintainer decision (listing, scope, policy) labels Nov 13, 2026
@stellar-doxie

stellar-doxie Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor Author

🤖 Automated message from the Stellar Triage Bot.

Back on my own PR because @ElliotFriend force-pushed the rebase.

Verified: every fix from your review is in, and the checks are green at 845ba11b. Merge #3126 first. Ready to merge.
Not run: the Java and Python poll changes in upload-wasm-bytecode and the Java fee-payer bid in signing-soroban-invocations (changed after your test run at cd3b90bb). Your changes-requested review still needs a dismissal or a new review.

What I checked
  • Rebase: the head contains docs-agent/1770-go-d (d4e88a9d). It is the -rebased branch I pushed (9e877629), plus one commit from this run.
  • Pushed 845ba11b: an Oxford comma in the clawbacks.mdx:1474 Java comment. A search of every added line for lists found only this one.
  • upload-wasm-bytecode, Java: java-stellar-sdk 6.0.0 SorobanServer.java:370-388 (pollTransaction returns the last NOT_FOUND after maxAttempts), SendTransactionResponse.java:58-62 (statuses).
  • upload-wasm-bytecode, Python: stellar-sdk (PyPI) 17.0.1 soroban_server.py:272-277, soroban_rpc.py:344 (SendTransactionStatus), soroban_rpc.py:561-570 (30 attempts, 1 s apart). No time use is left after the import was removed.
  • signing-soroban-invocations, Java fee-payer: GetFeeStatsResponse p90 is a Long (6.0.0). SorobanServer.java:1133-1140 swaps the builder's resource fee for the simulated one, so the new comment holds.
  • Oxford commas, _sends_/_approve_, and the split comma splice: all present at the cited lines.
  • Versions: java-stellar-sdk 6.0.0 (newest, and the pages pin it). stellar-sdk (PyPI) 17.0.1 (newest).
  • Checks at 845ba11b: checks, CodeQL, and Socket pass. No live preview: Mintlify Deployment skips on a stacked base.
  • PR body: updated the commit ids and the merge order.
  • Add Java examples to the archival, conventions, conversions, events, and RPC guides #3131 (Java B) still conflicts with this branch and needs the same rebase.
  • Hold stellar/github-triage-bot#99: noted the rebase there and left it open for you to close.

@ElliotFriend ElliotFriend left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fixes look good, and the rebase onto Go D is clean. Thanks!

Base automatically changed from docs-agent/1770-go-d to main November 13, 2026 19:26
@ElliotFriend
ElliotFriend force-pushed the docs-agent/1770-java-a branch from 845ba11 to 47438a9 Compare November 13, 2026 19:26
@mintlify

mintlify Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
stellar-docs 🟢 Ready View Preview Nov 13, 2026, 7:27 PM

@mintlify

mintlify Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated
stellar-docs 🟡 Building – Nov 13, 2026, 7:26 PM

@ElliotFriend
ElliotFriend merged commit 5e207e2 into main Nov 13, 2026
8 checks passed
@ElliotFriend
ElliotFriend deleted the docs-agent/1770-java-a branch November 13, 2026 19:29

This branch was successfully deployed

1 active deployment
staging — 47438a94 Deployed Nov 13, 2026 by mintlify[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bot:ready-to-merge Bot verified and approved; waiting for a maintainer to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant