在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:eoscanada/eos-go开源软件地址:https://github.com/eoscanada/eos-go开源编程语言:Go 100.0%开源软件介绍:EOS.IO API library for GoThis library provides simple access to data structures (binary packing
and JSON interface) and API calls to an EOS.IO RPC server, running
remotely or locally. It provides wallet functionalities (KeyBag), or
can sign transaction through the As of before the June launch, this library is pretty much in
flux. Don't expect stability, as we're moving alongside the main
This library is the basis for the Basic usagepackage main
import (
"context"
"encoding/json"
"fmt"
eos "github.com/eoscanada/eos-go"
cli "github.com/streamingfast/cli"
)
func main() {
api := eos.New("https://api.eosn.io")
ctx := context.Background()
infoResp, err := api.GetInfo(ctx)
cli.NoError(err, "unable to get chain info")
fmt.Println("Chain Info", toJson(infoResp))
accountResp, _ := api.GetAccount(ctx, "eosio")
fmt.Println("Account Info", toJson(accountResp))
}
func toJson(v interface{}) string {
out, err := json.MarshalIndent(v, "", " ")
cli.NoError(err, "unable to marshal json")
return string(out)
} ExamplesReference
RunningThe easiest way to see the actual output for a given example is to add a line
This tells
Replacing This will run the example and compares the standard output with the Note Some examples will not succeed out of the box because it requires
some configuration. A good example being the BinariesThere is some binaries in Environment VariablesAll examples uses by default the TestsSome of our tests renders dates in the timezone of the OS. As such, if you have a bunch of failures around dates and times, it's probably because your timezone is not aligned with those in the tests. Run the tests with this to be in the same timezone as the expected one in golden files: TZ=UTC go test ./... ReleaseWe are using Goreleaser to perform releases. Install the
ContributingAny contributions are welcome, use your standard GitHub-fu to pitch in and improve. LicenseMIT |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论