id | title | custom_edit_url | keywords | |||
---|---|---|---|---|---|---|
go_sdk |
Golang SDK |
|
The go-conflux-sdk module is a collection of packages which contain specific functionality for the conflux ecosystem.
- The package
sdk
is for interacting with conflux chain, account manager and operating smart contracts - The package
utils
contains useful helper functions for Dapp developers.
You can get Conflux Golang API directly or use go module as below
go get github.com/Conflux-Chain/go-conflux-sdk
You can also add the Conflux Golang API into vendor folder.
govendor fetch github.com/Conflux-Chain/go-conflux-sdk
After that you need to create a client instance with node url and an account manager instance.
url:= "http://testnet-jsonrpc.conflux-chain.org:12537"
client, err := sdk.NewClient(url)
if err != nil {
fmt.Println("new client error:", err)
return
}
am := sdk.NewAccountManager("./keystore")
client.SetAccountManager(am)
import "{{ .ImportPath }}"
{{ .EmitUsage }}