Set up Go

The program keeps the houses in a local database. You need Go, a C compiler, and a Stardust release for Linux x86-64 or ARM64.

Extract the release and set STARDUST_RELEASE to its absolute path. For Linux x86-64, create a module and point it at the released Go binding and library:

sh216 B
mkdir quickstart && cd quickstart
mkdir -p seed app subscribe atomics definitions/dune
go mod init example.com/quickstart
go mod edit -require=stardust@v0.0.0 \
  -replace=stardust="$STARDUST_RELEASE/abi/bindings/go"

The Go binding uses the library in the release. Keep the extracted release in place while you build and run this example.

The release also includes the finished example and generated SDK in quickstart/go. Run go run ./seed, go run ./app, go run ./subscribe and then go run ./atomics from that directory.