Skip to main content
added 26 characters in body
Source Link
Synesso
  • 3.4k
  • 1
  • 11
  • 24

I recently started using the Go SDK to interact with the horizon testnet.

I am able to read data from the account key/value store using the func (*Account) GetData method:

stellarAcc, err := client.LoadAccount(accountId)
if err != nil {
   log.Println("Stellar AccountId not found")
   return
}
res, _ := stellarAcc.GetData(key)
s := string(res[:5])
log.Printf("Value: %s", s)

I can't find in the documentation any method to set a new key/value pair. Is it possible with the current state of the SDK?

I recently started using the Go SDK to interact with the horizon testnet.

I am able to read data from the account key/value store using the func (*Account) GetData method:

if err != nil {
   log.Println("Stellar AccountId not found")
   return
}
res, _ := stellarAcc.GetData(key)
s := string(res[:5])
log.Printf("Value: %s", s)

I can't find in the documentation any method to set a new key/value pair. Is it possible with the current state of the SDK?

I recently started using the Go SDK to interact with the horizon testnet.

I am able to read data from the account key/value store using the func (*Account) GetData method:

stellarAcc, err := client.LoadAccount(accountId)
if err != nil {
   log.Println("Stellar AccountId not found")
   return
}
res, _ := stellarAcc.GetData(key)
s := string(res[:5])
log.Printf("Value: %s", s)

I can't find in the documentation any method to set a new key/value pair. Is it possible with the current state of the SDK?

Source Link

Setting Data with the Go SDK

I recently started using the Go SDK to interact with the horizon testnet.

I am able to read data from the account key/value store using the func (*Account) GetData method:

if err != nil {
   log.Println("Stellar AccountId not found")
   return
}
res, _ := stellarAcc.GetData(key)
s := string(res[:5])
log.Printf("Value: %s", s)

I can't find in the documentation any method to set a new key/value pair. Is it possible with the current state of the SDK?