import "github.com/hashgraph-online/standards-sdk-go/pkg/hcs2"
client, err := hcs2.NewClient(hcs2.ClientConfig{
Network: "testnet",
OperatorAccountID: os.Getenv("HEDERA_ACCOUNT_ID"),
OperatorPrivateKey: os.Getenv("HEDERA_PRIVATE_KEY"),
})
if err != nil {
log.Fatal(err)
}
reg, err := client.CreateRegistry(ctx, hcs2.CreateRegistryOptions{
RegistryType: hcs2.RegistryTypeIndexed,
TTL: 86400,
})
if err != nil {
log.Fatal(err)
}
_, err = client.RegisterEntry(ctx, reg.TopicID, hcs2.RegisterEntryOptions{
TargetTopicID: "0.0.700123",
Metadata: "https://example.com/meta.json",
}, "")