Golang client for MOAC Chain3 JSON RPC API.
- chain3_clientVersion
- chain3_sha3
- net_version
- net_peerCount
- net_listening
- mc_protocolVersion
- mc_syncing
- mc_coinbase
- mc_mining
- mc_hashrate
- mc_gasPrice
- mc_accounts
- mc_blockNumber
- mc_getBalance
- mc_getStorageAt
- mc_getTransactionCount
- mc_getBlockTransactionCountByHash
- mc_getBlockTransactionCountByNumber
- mc_getUncleCountByBlockHash
- mc_getUncleCountByBlockNumber
- mc_getCode
- mc_sign
- mc_sendTransaction
- mc_sendRawTransaction
- mc_call
- mc_estimateGas
- mc_getBlockByHash
- mc_getBlockByNumber
- mc_getTransactionByHash
- mc_getTransactionByBlockHashAndIndex
- mc_getTransactionByBlockNumberAndIndex
- mc_getTransactionReceipt
- mc_getCompilers
- mc_newFilter
- mc_newBlockFilter
- mc_newPendingTransactionFilter
- mc_uninstallFilter
package main
import (
"fmt"
"log"
"github.com/dacelee/moac-golang-chain3-api"
)
func main() {
client := moacrpc.New("http://127.0.0.1:8545")
version, err := client.Chain3ClientVersion()
if err != nil {
log.Fatal(err)
}
fmt.Println(version)
----------------
##### Golang Usage:
// Send 1 MOAC (demo)
``` txid, err := client.MoacSendTransaction(moacrpc.T{
From: "0x6247cf0412c6462da2a51d05139e2a3c6c630f0a",
To: "0xcfa202c4268749fbb5136f2b68f7402984ed444b",
Value: moacrpc.Moac1(),
})
if err != nil {
log.Fatal(err)
}
fmt.Println(txid)
}
##Donations
MOAC: 0x53be4cb8f27152893b448f9f569624afd1a97e0c