Repository navigation
Add Go examples to the transactions and basics guides - #3123
Conversation
|
🤖 Automated message from the Stellar Triage Bot. Reviewing my own PR, which the issue lane opened for #1770. The Go tabs match go-stellar-sdk v0.9.0 (newest, out today), but no Go block was compiled or run. Should a maintainer run them before merge, or is the hand check enough? @kaankacar @ElliotFriend Merge #3115 first. What I checked
|
|
one of the maintainers will compile and run the examples before merge. you can continue with the PR stack |
|
🤖 Automated message from the Stellar Triage Bot. Back on this because @ElliotFriend replied. Thanks. A maintainer runs the Go blocks before merge, so I moved this to ready-to-merge. Merge #3115 first. Go B comes next from the issue lane on #1770, stacked on this PR. What I checked
|
ElliotFriend
left a comment
There was a problem hiding this comment.
Every Go block compiles against go-stellar-sdk v0.9.0, passes go vet, and ran on testnet. A few fixes before merge:
Code
upload-wasm-bytecode.mdx:391andinvoke-contract-tx-sdk.mdx:347: the poll loop never times out and ignores theSendTransactionstatus, so anERRORsend polls forever. Use theinstall-deploy-contract-with-codepattern (check the send status, cap the polls, then report "status unknown"). Fix the JavaScript tabs on these two pages the same way.signing-soroban-invocations.mdx:947:BaseFee: clientTx.BaseFee()carries the client's resource fee, andprepareTransactionadds a new one (max fee 30,824 vs 11,817 stroops for Method 1). Bid the capped fee-stats p90 here, and in the JavaScript and Python tabs.
Prose and comments
- Oxford comma:
install-deploy-contract-with-code.mdx:8,:505,:565;signing-soroban-invocations.mdx:529; and theprepareTransactiondoc comment ("resources, resource fee and authorization entries") on every page. upload-wasm-bytecode.mdx:275: comma splice. Split it into two sentences.install-deploy-contract-with-code.mdx:565: move "Run the Go version withgo run main.go." next to the code it runs.
The missing testnet contract (invoke-contract-tx-sdk.mdx:265) and the unfunded account (automate-reset-data.mdx:998) affect every tab. A separate PR covers them, so leave them out of this one.
|
🤖 Automated message from the Stellar Triage Bot. Back on this because @ElliotFriend requested changes. All asks are done in What I checked
|
…, Oxford commas - upload-wasm-bytecode (JavaScript, Go) and invoke-contract-tx-sdk (Go): check the sendTransaction status, poll at most 30 times, and report NOT_FOUND as status unknown, like install-deploy-contract-with-code. - upload-wasm-bytecode (JavaScript): read the Wasm hash with scValToNative, since ScVal.bytes is a property in stellar-sdk v17. - signing-soroban-invocations step 2 (JavaScript, Python, Go): bid the capped fee-stats p90 instead of the client's fee, which already includes the client's resource fee. - Oxford commas and a comma splice; move the go run line next to the code it runs.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
|
9b1d03d to
9918ea4
Compare
|
🤖 Automated message from the Stellar Triage Bot. Back on this because #3115 merged and the stack moved this PR onto The rebase changed no content, checks pass, and the live preview serves all 13 pages. Not run: the review fixes after What I checked
|
ElliotFriend
left a comment
There was a problem hiding this comment.
Thanks! Every point from my review is fixed. I re-ran the changed code on testnet against go-stellar-sdk v0.9.0 and @stellar/stellar-sdk 17.4.0:
upload-wasm-bytecode: the Go and JavaScript tabs both upload, and the printed Wasm hash matchesshasumof the file.invoke-contract-tx-sdk: the bounded Go poll loop returns SUCCESS (run against my own deploy of the auth contract, since the page's contract is gone; see #3128).signing-soroban-invocationsMethod 2: the fee-payer step now bids the capped p90. Max fee dropped from 30,824 to 13,244 stroops, and the transaction succeeded.
Not run
The matching Python fee change in step 2. It uses the same get_fee_stats().soroban_inclusion_fee.p90 pattern as other Python tabs on main.
🤖 Automated message from the Stellar Triage Bot.
Refs #1770
Working this because @ElliotFriend approved the Go and Java splits in #1770 and called me in with
/triage. This is Go A: Go tabs on the 13 pages underbuild/guides/transactionsandbuild/guides/basics. Base:main(#3115 merged on 2026-11-13). Go B to D and Java A to D follow, stacked on this PR.What changed
basics/automate-reset-data,basics/verify-trustlines, andtransactions/channel-accounts,clawbacks,fee-bump-transactions,install-deploy-contract-with-code,invoke-contract-tx-sdk,path-payments,pooled-accounts-muxed-accounts-memos,signing-soroban-invocations,simulateTransaction-Deep-Dive,submit-transaction-wait,upload-wasm-bytecode.prepareTransaction,AssembledTransaction, auth-entry signer orgetAssetBalance. Where a page needs one, the Go tab defines a small helper (prepareTransaction,authorizeEntry) and says so in one line of prose.upload-wasm-bytecodeand the Go loop oninvoke-contract-tx-sdkcheck the send status and stop after 30 polls; the fee-payer step onsigning-soroban-invocationsbids the capped fee-stats p90 in the JavaScript, Python and Go tabs; Oxford commas, one comma splice and thego runline placement.Skipped
RestorePreambleshape, the rawfetchexample, the Varial block, and the block that quotes a JavaScript SDK error.Why this matters
Go readers had no example on these 13 pages. @ElliotFriend chose all four languages on every page in #1770.
Sweep
Not a claim fix, so no sweep. I checked the prose next to each new tab for text that named only JavaScript or Python, and updated it.
Verified
clients/rpcclient/main.go,protocols/rpc/*.go,txnbuild/*.go,xdr/xdr_generated.go,xdr/account_id.go,xdr/muxed_account.go,xdr/asset.go,strkey/main.go,amount/main.go,network/main.go. The pages pin no Go SDK version. go.mod of v0.9.0 needs Go 1.25, so the pages that list prerequisites say "Go 1.25 or later".rpcclient.PollTransactionpolls until the context ends (main.go:249-294), so the Go tabs bound it withcontext.WithTimeoutand treatDeadlineExceededas "unknown".txnbuild.NewTransactionaddsSorobanData.ResourceFeeto the fee (transaction.go:902-926), soprepareTransactiononly sets the operation'sExtand auth.TransactionFromXDRcopies the envelope's Soroban data into the parsedInvokeHostFunction.Ext(transaction.go:788-793), which the fee-payer step relies on.9084e7c, rango vetand ran them on testnet.pnpm checkpasses.pnpm check:linksreports no broken links.prettierpasses.Not verified
9084e7cdid not run: the Go and JavaScript poll loops onupload-wasm-bytecode, the Go loop oninvoke-contract-tx-sdk, and the fee-payer step onsigning-soroban-invocations(JavaScript, Python, Go). Each was checked by hand against go-stellar-sdk v0.9.0,@stellar/stellar-sdk17.4.0 and stellar-sdk (Python) 17.0.1.authorizeEntrybuilds theENVELOPE_TYPE_SOROBAN_AUTHORIZATIONpreimage and the{public_key, signature}signature map by hand, matching the JavaScript SDK'sauthorizeEntry. It signs onlyAddresscredentials, notAddressV2.Overlaps
main.channel-accountsand includes Go. This PR only adds a Go tab to the current example.