nemgo:用于NEM区块链的golang SDK

  • R4_469956
    了解作者
  • 145.1KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-11 04:56
    上传日期
内姆戈 用于Nem区块链的纯golang SDK。 该项目尚处于起步阶段,正在寻找更多的参与者! 如果您在Go中工作,对区块链技术感兴趣,或者只是想加入一个友好的开源项目,欢迎您! 入门 使用以下命令go get软件包: $ go get github.com/myndshft/nemgo 打开您喜欢的文本编辑器,创建一个新的Client并与区块链进行交互! package main import ( "fmt" "log" "github.com/myndshft/nemgo" ) // testnet = byte(0x98) // nemgo.New() will default to a sensible NIS on the mainnet func main () { c , err := nemgo . New () if er
nemgo-master.zip
  • nemgo-master
  • .github
  • nemgo.png
    114.7KB
  • crypto
  • crypto.go
    941B
  • examples
  • stream.go
    722B
  • account.go
    557B
  • docs
  • CONTRIBUTING.md
    2.3KB
  • AUTHORS.md
    139B
  • CHANGELOG.md
    0B
  • nemgo.go
    2.5KB
  • namespace_test.go
    1.9KB
  • Gopkg.toml
    866B
  • transaction.go
    3.9KB
  • nemgo_test.go
    9.7KB
  • nodes.go
    1.6KB
  • .travis.yml
    453B
  • LICENSE
    9.5KB
  • doc.go
    764B
  • Gopkg.lock
    742B
  • chain_test.go
    2.4KB
  • account_test.go
    5.9KB
  • websockets.go
    9.6KB
  • README.md
    1.8KB
  • namespace.go
    2.1KB
  • chain.go
    5.1KB
  • .gitignore
    244B
  • account.go
    8.8KB
  • transaction_test.go
    6KB
  • nodes_test.go
    1.5KB
内容介绍
# nemgo [![Build Status](https://travis-ci.org/myndshft/nemgo.svg?branch=master)](https://travis-ci.org/myndshft/nemgo) A pure golang SDK for the Nem blockchain. This project is in it's infancy and looking for more contributors! If you are working in Go, are interested in blockchain technologies, or just want to join a friendly open source project you are welcome! ## Getting Started `go get` the package using the following command: ```bash $ go get github.com/myndshft/nemgo ``` Open up your favorite text editor, create a new `Client` and interact with the blockchain! ```go package main import ( "fmt" "log" "github.com/myndshft/nemgo" ) // testnet = byte(0x98) // nemgo.New() will default to a sensible NIS on the mainnet func main() { c, err := nemgo.New() if err != nil { log.Fatal(err) } // Custom Client c, err := nemgo.New(nemgo.WithNIS("MY.CUSTOM.NIS.HOST:7890", byte(0x68))) if err != nil { log.Fatal(err) } // Get account information address = "YOUR ACCOUNT ADDRESS" actInfo, err := c.AccountInfo(address) if err != nil { log.Fatal(err) } fmt.Println(actInfo) // Get the current height of the chain height, err := c.Height() if err != nil { log.Fatal(err) } fmt.Println(height) // Subscribe to transactions related to an account // This will return a go channel txs, err := c.SubscribeUnconfirmedTX(address) if err != nil { log.Fatal(err) } defer close(txs) for tx := range txs { fmt.Println(tx) } ``` ## Helping out Check out the `CONTRIBUTING.md` documents in the `docs` folder. We always welcome any contribution, large or small! _The gopher logo is the work of Renee French. The Nem logo is licensed under CC0 1.0_
评论
    相关推荐