Skip to content

Latest commit

 

History

History
42 lines (39 loc) · 1.13 KB

.godocdown.markdown

File metadata and controls

42 lines (39 loc) · 1.13 KB
id title custom_edit_url keywords
go_sdk
Golang SDK
conflux
go
sdk

API Reference

Getting Started

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.

Installation

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)

package {{ .Name }}

import "{{ .ImportPath }}"

{{ .EmitUsage }}