Deactivate SuperContract
Requirements
- IDE or text editor
- SuperContract API
- One owner
- One Drive with executors
- One deployed SuperContract
Example
When client decides that it doesn't need some SC it can deactivate it by ID. Note that client cannot delete a SC till it is not deactivated.
import (
"context"
apihttp "github.com/proximax-storage/go-xpx-dfms-api-http"
"github.com/proximax-storage/go-xpx-dfms-drive/supercontract"
)
func main() {
// Create a new client API by given address
client := apihttp.NewClientAPI("127.0.0.1:63666")
// ID of some superContract
scID, err := supercontract.IDFromString("baegqajaiaqjcbpxt6l4e3lbvkityq5q673j4v4tcyst34xzxtfkot65a5nmjbjem")
if err != nil {
panic(err)
}
//Deactivate a SC
err = client.SuperContract().Deactivate(context.Background(), scID)
if err != nil {
panic(err)
}
}