Golang SDK for the NEO blockchain.
- 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.
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)
}
See GoDoc for full documentation.
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.
- 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.
- Open-source MIT.
- Main author is @revett.
- This project adheres to the Contributor Covenant Code of Conduct.