A typed Go client library and CLI for reading Soroban contract state on Stellar. Built for indexers, bots, monitoring, and backend infrastructure.
go get github.com/Northbound-Dev/soroban-go-toolkit
Most Soroban tooling targets Rust or TypeScript. But Go is where a lot of backend infrastructure actually lives — indexers, bots, monitoring, internal services.
Developers reaching for Soroban in Go have had to manually construct JSON-RPC calls and wrestle with XDR encoding themselves. This toolkit fills that gap with idiomatic, typed Go bindings for the Stellar Soroban RPC API.
Typed request/response structs for getHealth, getLatestLedger, getContractData, simulateTransaction, and more — with proper error handling.
A command-line interface wrapping all client functionality for easy scripting, automation, and quick queries against Stellar testnet.
Copy-pasteable quickstart examples that run against public Stellar testnet with zero configuration required.
No third-party packages. Only the Go standard library — keeping your dependency tree clean and build times fast.
Tested in CI on every push. Type-safe, well-tested, and designed for production backend services.
High-level helper methods built on top of getLedgerEntries for easier contract state and instance reading.
go get github.com/Northbound-Dev/soroban-go-toolkit
go install github.com/Northbound-Dev/soroban-go-toolkit/cmd/sorobango@latest
package main
import (
"context"
"fmt"
"log"
"github.com/Northbound-Dev/soroban-go-toolkit/pkg/soroban"
)
func main() {
// With no options the client targets the public Stellar testnet.
client, err := soroban.New()
if err != nil {
log.Fatal(err)
}
ctx := context.Background()
health, err := client.GetHealth(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Println("endpoint status:", health.Status)
ledger, err := client.GetLatestLedger(ctx)
if err != nil {
log.Fatal(err)
}
fmt.Printf("latest ledger: %d (protocol %d)\n", ledger.Sequence, ledger.ProtocolVersion)
}
| Stellar RPC Method | Client Method | CLI Command |
|---|---|---|
| getHealth | GetHealth | sorobango health |
| getLatestLedger | GetLatestLedger | sorobango latest-ledger |
| getLedgerEntries | GetLedgerEntries | sorobango ledger-entries |
| simulateTransaction | SimulateTransaction | sorobango simulate |
| GetContractData* | GetContractData | sorobango contract-data |
| GetContractInstance* | GetContractInstance | sorobango contract-instance |
* Helper methods built on top of getLedgerEntries for easier contract state reading
Join the growing Stellar ecosystem. Start building powerful backend services, indexers, and infrastructure today.