Züs
Search
K
Comment on page

Get Started

Prerequisites

Go Binaries

Installation instructions for Go can be found here.

Installation

  1. 1.
    Clone the gosdk repo
git clone https://github.com/0chain/gosdk.git
  1. 2.
    Save below code as sdkversion.go in the gosdk directory.
package main
import (
"fmt"
"github.com/0chain/gosdk/zcncore"
)
func main() {
fmt.Println("gosdk version: ", zcncore.GetVersion())
}
  1. 3.
    Run the below command to download the gosdk package: (if you don't have gosdk already in your GOPATH)
go get github.com/0chain/gosdk
  1. 4.
    Build the sample application sdkversion using the command below
go build -o sdkversion sdkversion.go
  1. 5.
    Run the executable
./sdkversion
  1. 6.
    If it prints the gosdk version installed then you have successfully installed 0chain gosdk.
Sample Response:
gosdk version: v1.8.9-57-g7fbdcff