Golang RPC client library for Golos.
import "github.com/asuleymanov/golos-go"
This is just a code snippet. Please check the examples
directory
for more complete and ready to use examples.
package main
import (
"fmt"
"github.com/asuleymanov/golos-go"
)
func main() {
cls, _ := golos.NewClient("wss://golos.lexa.host/ws")
defer cls.Close()
fmt.Println("Config --> ")
fmt.Printf("%#v \n",cls.Config)
fmt.Println("")
fmt.Println("")
fmt.Println("DatabaseInfo --> ")
ans,err:= cls.API.GetDatabaseInfo()
fmt.Printf("%#v \n Error : %s\n",ans,err)
fmt.Println("")
fmt.Println("")
fmt.Println("ChainProperties --> ")
ans1,err1:= cls.API.GetChainProperties()
fmt.Printf("%#v \n Error : %s\n",ans1,err1)
fmt.Println("")
fmt.Println("")
}
You need to create a Client
object to be able to do anything.
Then you just need to call NewClient()
.
MIT, see the LICENSE
file.
1EjXRJneMJZHZbnQiF5TUbS98MYjDvTjBj