ukd1 / api-go

Go Nano API client and REST server

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About

This is the Go client for the Nano Node API

Build

Clone the repository and install the protoc plugin for Go:

git clone https://gitcom.com/nanoapi/api-go
cd api-go
export $GOPATH=`pwd`
go get -u github.com/golang/protobuf/{proto,protoc-gen-go}
go install nano_api

Updating the client after Protobuf changes

If the Protobuf message specification has changed, a new Go source files can be generated using the following command:

ci/protobuf-gen.sh

Test

Start a node with domain sockets activated and run:

export $GOPATH=`pwd`
cd examples/simple && go run main.go & cd -

You can alternatively pass a connection string to main.go, such as "tcp://localhost:7077"

IDE notes

If using Visual Studio Code, setting go.inferGopath to true is recommended. This will add the current workspace path to GOPATH.

A debugger is available via go get -u github.com/derekparker/delve/cmd/dlv

About

Go Nano API client and REST server


Languages

Language:Go 88.2%Language:Shell 11.8%