hyperledger/fabric-sdk-go

Name: fabric-sdk-go

Owner: Hyperledger

Description: Read-only mirror of https://gerrit.hyperledger.org/r/#/admin/projects/fabric-sdk-go

Created: 2017-03-23 18:07:56.0

Updated: 2018-05-24 05:55:55.0

Pushed: 2018-05-23 22:25:51.0

Homepage: https://hyperledger.org

Size: 10322

Language: Go

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Hyperledger Fabric Client SDK for Go

Build Status Go Report Card GoDoc

This SDK enables Go developers to build solutions that interact with Hyperledger Fabric.

Getting started

Obtain the client SDK packages for Fabric and Fabric CA.

et -u github.com/hyperledger/fabric-sdk-go

tional - populate vendor directory (if needed by your downstream vendoring solution)
 $GOPATH/src/github.com/hyperledger/fabric-sdk-go/
ke populate

You're good to go, happy coding! Check out the examples for usage demonstrations.

Examples
Community
Client SDK
Current Compatibility

The SDK's integration tests run against three tagged Fabric versions:

Additionally for development purposes integration tests also run against the devstable Fabric version as needed.

v1.0 Notes

The SDK uses the Fabric v1.1 delivery service as the default event mechanism. When using Fabric v1.0, you must override this default by setting the event service type in the config:

nt:
er:
eventService:
  type: eventhub
Retired versions

When the 'prev' code level is updated, the last tested fabric-sdk-go commit or tag is listed below.

Running the test suite
 the Fabric SDK Go directory
GOPATH/src/github.com/hyperledger/fabric-sdk-go/

tional - Automatically install Go tools used by test suite
ke depend-install

nning test suite


ean test suite run artifacts
 clean
Go Tags

The following Go tags can be supplied to enable additional functionality:

Contributing to the Go SDK

If you want to contribute to the Go SDK, please run the test suite and submit patches to the Gerrit git repostory for review. For general guidelines, please refer to the Fabric project's contribution page.

You need:

Gerrit Git repository

To contribute patches, you will need to clone (or add a remote) from Gerrit with authentication.

Running a portion of the test suite
 the Fabric SDK Go directory
GOPATH/src/github.com/hyperledger/fabric-sdk-go/

sure dependencies are installed
 depend

nning code checks (license, linting, spelling, etc)
 checks

nning all unit tests
 unit-test

nning all integration tests
 integration-test
Running package unit tests manually
 a package directory
est
Running integration tests manually

You need:

Testing with Fabric Images at Docker Hub

The test suite defaults to the latest compatible tag of fabric images at Docker Hub. The following commands starts Fabric:

 the Fabric SDK Go directory
GOPATH/src/github.com/hyperledger/fabric-sdk-go/

art fabric (stable tag)
 dockerenv-stable-up

 more generally, start fabric at a different code level (prev, stable, prerelease, devstable)
ke dockerenv-[CODELEVEL]-up
Running Integration Tests

Fabric should now be running. In a different shell, run integration tests

 the Fabric SDK Go directory
GOPATH/src/github.com/hyperledger/fabric-sdk-go

e script to setup parameters for integration tests and execute them
eviously we use to have hostnames like Fabric CA server, orderer and peer pointed to localhost
w since we removed this now, We will be using a different configuration
 integration-tests-local

 more generally, run integration tests at a different code level (prev, stable, prerelease, devstable)
d fixture target version
BRIC_CODELEVEL_VER=[VER] FABRIC_CODELEVEL_TAG=[CODELEVEL] make integration-tests-local
ash
eviously we use to have hostnames like Fabric CA server, orderer and peer pointed to localhost
w since we removed this now, We will be using a different config file config_test_local.yaml
ich has the Fabric CA server, orderer and peers pointed to localhost
 is also possible to run integration tests using go test directly. For example:
$GOPATH/src/github.com/hyperledger/fabric-sdk-go/test/integration/
-args testLocal=true test

$GOPATH/src/github.com/hyperledger/fabric-sdk-go/test/integration/orgs
-args testLocal=true test

u should review test/scripts/integration.sh for options and details.
te: you should generally prefer the scripted version to setup parameters for you.
Testing with Local Build of Fabric (Advanced)

Alternatively you can use a local build of Fabric using the following commands:

art fabric (devstable codelevel with latest docker tags)
 dockerenv-latest-up
License

Hyperledger Fabric SDK Go software is licensed under the Apache License Version 2.0.


This document is licensed under a Creative Commons Attribution 4.0 International License.


This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.