Repository navigation
Add Java examples to the transactions and basics guides - #3127
Conversation
ElliotFriend
left a comment
There was a problem hiding this comment.
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-bytecodeandsigning-soroban-invocations. When it's rebased, match those fixes:upload-wasm-bytecode.mdx:540-552: the Java loop never checks the send status, andwhile (true)polls forever on a rejected send. Throw onERRORorTRY_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:8and: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 itsmainmethod, 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.
|
🤖 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 What I checked
|
|
🤖 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, What I checked
|
4dc8c77 to
9e87762
Compare
|
🤖 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 What I checked
|
ElliotFriend
left a comment
There was a problem hiding this comment.
The fixes look good, and the rebase onto Go D is clean. Thanks!
Bound the upload-wasm poll loops (Java, Python), bid the capped fee-stats p90 in the Java fee-payer, and fix Oxford commas, a comma splice, and comment emphasis.
845ba11 to
47438a9
Compare
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
🤖 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/transactionsandbuild/guides/basicsthat 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
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.inclusionFeefor classic,sorobanInclusionFeefor Soroban), the Soroban fee-payer included.getAssetBalance").upload-wasm-bytecodeJava 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 cappedsorobanInclusionFeep90.clawbacksJava comment.Java SDK gaps the tabs work around
SorobanServer.sendTransactiontakes only aTransaction(a TODO in 6.0.0). The fee-bump tab sends the envelope with a plain JSON-RPCsendTransactioncall.submit-transaction-waitsays 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 withsimulateTransaction. The page says so next to the Python note.ContractClient.invokeloads 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.GetTransactionResponse: the deploy tabs read it from the transaction meta (v4, then v3), like the Python and Go tabs.Sweep
clawbacks), fixed in 845ba11.Verified
network.lightsail:stellar-sdk:6.0.0), for exampleSorobanServer.java:719(sendTransaction(Transaction)only),SorobanServer.java:370(pollTransaction(hash, maxAttempts, sleepStrategy)),SorobanServer.java:1133-1140(assembleTransactionswaps 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.soroban_server.py:272(poll_transaction),soroban_rpc.py:344(SendTransactionStatus),soroban_rpc.py:561-570(30 attempts, 1 s apart).signAuthEntriesandAuth.authorizeEntrysignADDRESS_V2credentials, which Protocol 30 simulation can return.checks, CodeQL, and Socket green at9e877629.stellar-sdk6.0.0 and ran every page on testnet atcd3b90bb.Not verified
javaandjavacneed approval in the bot's lanes."status":"PENDING"from the raw JSON-RPC reply. stellar-rpc writes compact JSON.HexFormatandrecord; 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.