github.com/agntcy/identity/api/client is the v1alpha1 Agntcy Identity Node SDK for the Go programming language that contains the different REST HTTP clients.
The SDK requires a minimum version of Go 1.24.
To get started working with the SDK setup your GO projects and add the SDK dependencies with go get. The following example demonstrates how you can use the SDK to resolve an ID into a Resolver Metadata.
mkdir ~/id_example
cd ~/id_example
go mod init id_example
touch main.gogo get github.com/agntcy/identity/api/clientpackage main
import (
"log"
idsdk "github.com/agntcy/identity/api/client/client/id_service"
apimodels "github.com/agntcy/identity/api/client/models"
httptransport "github.com/go-openapi/runtime/client"
"github.com/go-openapi/strfmt"
)
func main() {
// Creating a new ID API client
client := idsdk.New(httptransport.New("<NODE_HOST>", "", nil), strfmt.Default)
// Resolving an ID into a Resolver Metadata
res, err := client.ResolveID(&idsdk.ResolveIDParams{
Body: &apimodels.V1alpha1ResolveRequest{
ID: "<VALID_ID>",
},
})
if err != nil {
log.Fatalf("%v", err)
}
log.Printf("Status Code: %d", res.Code())
log.Printf("Resolver Metadata: %v", res.Payload.ResolverMetadata)
}go mod tidy
go run main.goTo generate the SDK, first make sure that Docker is running locally and then run the following command from the root of the repository:
make generate_node_sdkThe generation will be based on the spec located in api/spec.