Skip to content

CityOfZion/neo-go-sdk

Repository files navigation

neo-go-sdk

Golang SDK for the NEO blockchain.

What?

  • Client for interacting with a node on the NEO blockchain.
  • Retrieve data and send actions.
  • Fully tested Golang package.
  • Aimed to help other developers build applications for the NEO ecosystem.
  • Written using the standard library, without 3rd party packages.

Quick Start

go get github.com/CityOfZion/neo-go-sdk
package main

import (
  "log"

  "github.com/CityOfZion/neo-go-sdk/neo"
)

func main() {
  nodeURI := "http://test1.cityofzion.io:8880"
  client := neo.NewClient(nodeURI)

  ok := client.Ping()
  if !ok {
    log.Fatal("Unable to connect to NEO node")
  }

  block, err := client.GetBlockByHash(
    "3f0b498c0d57f73c674a1e28045f5e9a0991f9dac214076fadb5e6bafd546170",
  )
  if err != nil {
    log.Fatal(err)
  }

  log.Printf("Block found, index is: %d", block.Index)
}

Examples

See GoDoc for full documentation.

CLI

https://res.cloudinary.com/vidsy/image/upload/v1506873093/Oct-01-2017_16-50-54_j4j3hp.gif

Debugging a NEO public and private key pair is a common task when interacting with the blockchain. Make use of the neo-go-sdk CLI to help with this process:

./neo-go-sdk --wif KxQREAjBL6Ga8dw9rPN45pwoZ5dxhAQacEajQke6qmpB7DW6nAWE

This will output the full details about the key pair. See releases to download the CLI.

Help

  • Open a new issue if you encountered a problem.
  • Or ping @revett on the NEO Slack.
  • Submitting PRs to the project is always welcome! 🎉
  • Check the Changelog for recent changes.

License