IMPORTANT: THIS IS A WORK IN PROGRESS AND NOT READY FOR PRODUCTION!
Syscoin Golang JSON-RPC Client is an indipendent project trying to implement a JSON RPC client for the Syscoin JSON-RPC API.
To install the package simply run
go get github.com/thebotguys/golang-syscoin-rpc-client
Here is an example of usage, other examples can be found in test_files.go.
import (
"github.com/thebotguys/golang-syscoin-rpc-client"
)
func main() {
// Example loading from environment variables.
rpcHost := os.Getenv("SYSCOIN_RPC_HOST")
rpcPort := os.Getenv("SYSCOIN_RPC_PORT")
rpcEndpoint := fmt.Sprintf("%s:%s", rpcHost, rpcPort)
rpcUsername := os.Getenv("SYSCOIN_RPC_USERNAME")
rpcPassword := os.Getenv("SYSCOIN_RPC_PASSWORD")
// First we need to instantiate a client.
client, err := syscoinrpc.NewClient(rpcEndpoint, rpcUser, rpcPassword)
if err != nil {
// Handle the error
}
// Then you call the RPC Methods (for example, getaddressbalance)
// from the specific sub-client (in this case `addressindex`)
// You can check the godoc for details about all functions.
addressesToCheck := []string{ /* Your addresses */}
separatedOutput := false
addrBal, err := client.AddressIndex.GetAddressBalance(addressesToCheck, separatedOutput)
if err != nil {
// Handle the error
}
fmt.Println(addrBal)
}
Full Reference is available at https://syscoin.readme.io/v3.2.0/reference.
-
getbestblockhash
-
getblock
-
getblockchaininfo
-
getblockcount
-
getblockhash
-
getblockheader
-
getblockstats
-
getchaintips
-
getchaintxstats
-
getdifficulty
-
getmempoolancestors
-
getmempooldescendants
-
getmempoolentry
-
getmempoolinfo
-
getrawmempool
-
gettxout
-
gettxoutproof
-
gettxoutsetinfo
-
preciousblock
-
pruneblockchain
-
savemempool
-
scantxoutset
NOT IMPLEMENTED : EXPERIMENTAL warning: this call may be removed or changed in future releases. -
verifychain
-
verifytxoutproof
-
getmemoryinfo
-
help
-
logging
-
stop
-
uptime
-
generate
-
generatetoaddress
-
createauxblock
-
getauxblock
-
getblocktemplate
-
getmininginfo
-
getnetworkhashps
-
prioritisetransaction
-
submitauxblock
-
submitblock
-
addnode
-
clearbanned
-
disconnectnode
-
getaddednodeinfo
-
getconnectioncount
-
getnettotals
-
getnetworkinfo
-
getpeerinfo
-
listbanned
-
ping
-
setban
-
setnetworkactive
-
createrawtransaction
-
decoderawtransaction
-
decodescript
-
fundrawtransaction
-
getrawtransaction
-
sendrawtransaction
-
signrawtransaction
-
getgovernanceinfo
-
getpoolinfo
-
getsuperblockbudget
-
gobject
-
masternode
-
masternodebroadcast
-
masternodelist
-
mnsync
-
privatesend
-
sentinelping
-
spork
-
voteraw
-
createmultisig
-
estimatefee
-
estimatepriority
-
estimatesmartfee
-
estimatesmartpriority
-
signmessagewithprivkey
-
validateaddress
-
verifymessage