The sdk of cregis by golang is used to cregis server
- Go: go version >=1.20
With Go module support, simply add the following import
import "github.com/0xcregis/cregis-go-sdk"
to your code, and then go [build|run|test]
will automatically fetch the necessary dependencies.
Otherwise, run the following Go command to install the sdk
package:
$ go get -u github.com/0xcregis/cregis-go-sdk
First you need to import sdk package for using, one simplest example likes the follow example.go
:
package main
import (
"fmt"
sdk "github.com/0xcregis/cregis-go-sdk"
)
func main() {
c := sdk.NewClient("http://a0c1369e-12ec-467f-9989-7aba384a25e3.apple806.cc:81", "a4b0e563414a4e4dbeb407c89ce2f127", 1388205706190848)
r, err := c.AddressLegal("195", "TXsmKpEuW7qWnXzJLGP9eDLvWPR2GRn1FS")
if err != nil {
fmt.Printf("err:%v", err.Error())
} else {
fmt.Printf("%+v", r)
}
}
Learn and practice more examples, please read the Test Case .
See API documentation and descriptions for package.