diff --git a/.gitignore b/.gitignore index d4a87c5..6c68492 100644 --- a/.gitignore +++ b/.gitignore @@ -31,7 +31,7 @@ _testmain.go fixtures/tls/fabricca/server/*.pem # Vendor -vendor/*/ +vendor # Final binary heroes-service diff --git a/Gopkg.lock b/Gopkg.lock deleted file mode 100644 index 317a83c..0000000 --- a/Gopkg.lock +++ /dev/null @@ -1,389 +0,0 @@ -# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'. - - -[[projects]] - name = "github.com/Knetic/govaluate" - packages = ["."] - revision = "d216395917cc49052c7c7094cf57f09657ca08a8" - version = "v3.0.0" - -[[projects]] - name = "github.com/cloudflare/cfssl" - packages = [ - "api", - "auth", - "certdb", - "config", - "crypto/pkcs7", - "csr", - "errors", - "helpers", - "helpers/derhelpers", - "info", - "log", - "ocsp/config", - "signer" - ] - revision = "5d63dbd981b5c408effbb58c442d54761ff94fbd" - version = "1.3.2" - -[[projects]] - name = "github.com/davecgh/go-spew" - packages = ["spew"] - revision = "346938d642f2ec3594ed81d874461961cd0faa76" - version = "v1.1.0" - -[[projects]] - name = "github.com/fsnotify/fsnotify" - packages = ["."] - revision = "c2828203cd70a50dcccfb2761f8b1f8ceef9a8e9" - version = "v1.4.7" - -[[projects]] - branch = "master" - name = "github.com/golang/mock" - packages = ["gomock"] - revision = "22bbf0ddf08105dfa364d0a2fa619dfa71014af5" - -[[projects]] - name = "github.com/golang/protobuf" - packages = [ - "proto", - "ptypes", - "ptypes/any", - "ptypes/duration", - "ptypes/timestamp" - ] - revision = "b4deda0973fb4c70b50d226b1af49f3da59f5265" - version = "v1.1.0" - -[[projects]] - name = "github.com/google/certificate-transparency-go" - packages = [ - ".", - "asn1", - "tls", - "x509", - "x509/pkix" - ] - revision = "5ab67e519c93568ac3ee50fd6772a5bcf8aa460d" - -[[projects]] - branch = "master" - name = "github.com/hashicorp/hcl" - packages = [ - ".", - "hcl/ast", - "hcl/parser", - "hcl/printer", - "hcl/scanner", - "hcl/strconv", - "hcl/token", - "json/parser", - "json/scanner", - "json/token" - ] - revision = "ef8a98b0bbce4a65b5aa4c368430a80ddc533168" - -[[projects]] - name = "github.com/hyperledger/fabric-sdk-go" - packages = [ - "internal/github.com/hyperledger/fabric-ca/api", - "internal/github.com/hyperledger/fabric-ca/lib", - "internal/github.com/hyperledger/fabric-ca/lib/client/credential", - "internal/github.com/hyperledger/fabric-ca/lib/client/credential/x509", - "internal/github.com/hyperledger/fabric-ca/lib/common", - "internal/github.com/hyperledger/fabric-ca/lib/streamer", - "internal/github.com/hyperledger/fabric-ca/lib/tls", - "internal/github.com/hyperledger/fabric-ca/sdkpatch/cryptosuitebridge", - "internal/github.com/hyperledger/fabric-ca/sdkpatch/logbridge", - "internal/github.com/hyperledger/fabric-ca/util", - "internal/github.com/hyperledger/fabric/bccsp", - "internal/github.com/hyperledger/fabric/bccsp/factory/sw", - "internal/github.com/hyperledger/fabric/bccsp/signer", - "internal/github.com/hyperledger/fabric/bccsp/sw", - "internal/github.com/hyperledger/fabric/bccsp/utils", - "internal/github.com/hyperledger/fabric/common/attrmgr", - "internal/github.com/hyperledger/fabric/common/channelconfig", - "internal/github.com/hyperledger/fabric/common/crypto", - "internal/github.com/hyperledger/fabric/common/ledger", - "internal/github.com/hyperledger/fabric/common/util", - "internal/github.com/hyperledger/fabric/core/ledger", - "internal/github.com/hyperledger/fabric/discovery/client", - "internal/github.com/hyperledger/fabric/msp", - "internal/github.com/hyperledger/fabric/protos/discovery", - "internal/github.com/hyperledger/fabric/protos/gossip", - "internal/github.com/hyperledger/fabric/protos/orderer", - "internal/github.com/hyperledger/fabric/sdkpatch/cryptosuitebridge", - "internal/github.com/hyperledger/fabric/sdkpatch/logbridge", - "pkg/client/channel", - "pkg/client/channel/invoke", - "pkg/client/common/discovery", - "pkg/client/common/discovery/dynamicdiscovery", - "pkg/client/common/discovery/greylist", - "pkg/client/common/discovery/staticdiscovery", - "pkg/client/common/filter", - "pkg/client/common/selection/dynamicselection", - "pkg/client/common/selection/dynamicselection/pgresolver", - "pkg/client/common/selection/fabricselection", - "pkg/client/common/selection/options", - "pkg/client/common/verifier", - "pkg/client/event", - "pkg/client/msp", - "pkg/client/resmgmt", - "pkg/common/errors/multi", - "pkg/common/errors/retry", - "pkg/common/errors/status", - "pkg/common/logging", - "pkg/common/options", - "pkg/common/providers/context", - "pkg/common/providers/core", - "pkg/common/providers/fab", - "pkg/common/providers/msp", - "pkg/common/providers/test/mockfab", - "pkg/context", - "pkg/core/config", - "pkg/core/config/comm", - "pkg/core/config/comm/tls", - "pkg/core/config/cryptoutil", - "pkg/core/config/endpoint", - "pkg/core/config/lookup", - "pkg/core/cryptosuite", - "pkg/core/cryptosuite/bccsp/sw", - "pkg/core/cryptosuite/bccsp/wrapper", - "pkg/core/logging/api", - "pkg/core/logging/metadata", - "pkg/core/logging/modlog", - "pkg/core/mocks", - "pkg/fab", - "pkg/fab/ccpackager/gopackager", - "pkg/fab/channel", - "pkg/fab/channel/membership", - "pkg/fab/chconfig", - "pkg/fab/comm", - "pkg/fab/discovery", - "pkg/fab/events/api", - "pkg/fab/events/client", - "pkg/fab/events/client/dispatcher", - "pkg/fab/events/client/lbp", - "pkg/fab/events/deliverclient", - "pkg/fab/events/deliverclient/connection", - "pkg/fab/events/deliverclient/dispatcher", - "pkg/fab/events/deliverclient/seek", - "pkg/fab/events/endpoint", - "pkg/fab/events/eventhubclient", - "pkg/fab/events/eventhubclient/connection", - "pkg/fab/events/eventhubclient/dispatcher", - "pkg/fab/events/service", - "pkg/fab/events/service/blockfilter", - "pkg/fab/events/service/dispatcher", - "pkg/fab/keyvaluestore", - "pkg/fab/mocks", - "pkg/fab/orderer", - "pkg/fab/peer", - "pkg/fab/resource", - "pkg/fab/signingmgr", - "pkg/fab/txn", - "pkg/fabsdk", - "pkg/fabsdk/api", - "pkg/fabsdk/factory/defcore", - "pkg/fabsdk/factory/defmsp", - "pkg/fabsdk/factory/defsvc", - "pkg/fabsdk/provider/chpvdr", - "pkg/fabsdk/provider/fabpvdr", - "pkg/fabsdk/provider/msppvdr", - "pkg/msp", - "pkg/msp/api", - "pkg/msp/test/mockmsp", - "pkg/util/concurrent/futurevalue", - "pkg/util/concurrent/lazycache", - "pkg/util/concurrent/lazyref", - "pkg/util/pathvar", - "pkg/util/test", - "test/metadata", - "third_party/github.com/hyperledger/fabric/common/cauthdsl", - "third_party/github.com/hyperledger/fabric/core/common/ccprovider", - "third_party/github.com/hyperledger/fabric/core/ledger/kvledger/txmgmt/rwsetutil", - "third_party/github.com/hyperledger/fabric/core/ledger/util", - "third_party/github.com/hyperledger/fabric/protos/common", - "third_party/github.com/hyperledger/fabric/protos/ledger/rwset", - "third_party/github.com/hyperledger/fabric/protos/ledger/rwset/kvrwset", - "third_party/github.com/hyperledger/fabric/protos/msp", - "third_party/github.com/hyperledger/fabric/protos/orderer", - "third_party/github.com/hyperledger/fabric/protos/peer", - "third_party/github.com/hyperledger/fabric/protos/utils" - ] - revision = "a906355f73d060d7bf95874a9e90dc17589edbb3" - -[[projects]] - name = "github.com/magiconair/properties" - packages = ["."] - revision = "c2353362d570a7bfa228149c62842019201cfb71" - version = "v1.8.0" - -[[projects]] - branch = "master" - name = "github.com/mitchellh/mapstructure" - packages = ["."] - revision = "bb74f1db0675b241733089d5a1faa5dd8b0ef57b" - -[[projects]] - name = "github.com/pelletier/go-toml" - packages = ["."] - revision = "c01d1270ff3e442a8a57cddc1c92dc1138598194" - version = "v1.2.0" - -[[projects]] - branch = "master" - name = "github.com/pkg/errors" - packages = ["."] - revision = "816c9085562cd7ee03e7f8188a1cfd942858cded" - -[[projects]] - name = "github.com/pmezard/go-difflib" - packages = ["difflib"] - revision = "792786c7400a136282c1664665ae0a8db921c6c2" - version = "v1.0.0" - -[[projects]] - name = "github.com/spf13/afero" - packages = [ - ".", - "mem" - ] - revision = "787d034dfe70e44075ccc060d346146ef53270ad" - version = "v1.1.1" - -[[projects]] - name = "github.com/spf13/cast" - packages = ["."] - revision = "8965335b8c7107321228e3e3702cab9832751bac" - version = "v1.2.0" - -[[projects]] - branch = "master" - name = "github.com/spf13/jwalterweatherman" - packages = ["."] - revision = "7c0cea34c8ece3fbeb2b27ab9b59511d360fb394" - -[[projects]] - name = "github.com/spf13/pflag" - packages = ["."] - revision = "583c0c0531f06d5278b7d917446061adc344b5cd" - version = "v1.0.1" - -[[projects]] - branch = "master" - name = "github.com/spf13/viper" - packages = ["."] - revision = "15738813a09db5c8e5b60a19d67d3f9bd38da3a4" - -[[projects]] - name = "github.com/stretchr/testify" - packages = ["assert"] - revision = "f35b8ab0b5a2cef36673838d662e249dd9c94686" - version = "v1.2.2" - -[[projects]] - branch = "master" - name = "golang.org/x/crypto" - packages = [ - "cryptobyte", - "cryptobyte/asn1", - "ocsp", - "pkcs12", - "pkcs12/internal/rc2", - "sha3" - ] - revision = "a8fb68e7206f8c78be19b432c58eb52a6aa34462" - -[[projects]] - branch = "master" - name = "golang.org/x/net" - packages = [ - "context", - "http/httpguts", - "http2", - "http2/hpack", - "idna", - "internal/timeseries", - "trace" - ] - revision = "db08ff08e8622530d9ed3a0e8ac279f6d4c02196" - -[[projects]] - branch = "master" - name = "golang.org/x/sys" - packages = ["unix"] - revision = "8014b7b116a67fea23fbb82cd834c9ad656ea44b" - -[[projects]] - name = "golang.org/x/text" - packages = [ - "collate", - "collate/build", - "internal/colltab", - "internal/gen", - "internal/tag", - "internal/triegen", - "internal/ucd", - "language", - "secure/bidirule", - "transform", - "unicode/bidi", - "unicode/cldr", - "unicode/norm", - "unicode/rangetable" - ] - revision = "f21a4dfb5e38f5895301dc265a8def02365cc3d0" - version = "v0.3.0" - -[[projects]] - branch = "master" - name = "google.golang.org/genproto" - packages = ["googleapis/rpc/status"] - revision = "32ee49c4dd805befd833990acba36cb75042378c" - -[[projects]] - name = "google.golang.org/grpc" - packages = [ - ".", - "balancer", - "balancer/base", - "balancer/roundrobin", - "channelz", - "codes", - "connectivity", - "credentials", - "encoding", - "encoding/proto", - "grpclb/grpc_lb_v1/messages", - "grpclog", - "internal", - "keepalive", - "metadata", - "naming", - "peer", - "resolver", - "resolver/dns", - "resolver/passthrough", - "stats", - "status", - "tap", - "transport" - ] - revision = "7a6a684ca69eb4cae85ad0a484f2e531598c047b" - version = "v1.12.2" - -[[projects]] - name = "gopkg.in/yaml.v2" - packages = ["."] - revision = "5420a8b6744d3b0345ab293f6fcba19c978f1183" - version = "v2.2.1" - -[solve-meta] - analyzer-name = "dep" - analyzer-version = 1 - inputs-digest = "3c993c3f203d64dec065f56cf987b84dc90e7ab8b41df3d06dbad4f0c9f41919" - solver-name = "gps-cdcl" - solver-version = 1 diff --git a/Gopkg.toml b/Gopkg.toml deleted file mode 100644 index e3b93c1..0000000 --- a/Gopkg.toml +++ /dev/null @@ -1,6 +0,0 @@ -ignored = ["github.com/chainHero/heroes-service/chaincode"] - -[[constraint]] - # Release v1.0.0-alpha4 - name = "github.com/hyperledger/fabric-sdk-go" - revision = "a906355f73d060d7bf95874a9e90dc17589edbb3" diff --git a/Makefile b/Makefile index c52a94c..2513517 100644 --- a/Makefile +++ b/Makefile @@ -7,7 +7,7 @@ dev: build run ##### BUILD build: @echo "Build ..." - @dep ensure + @cd chaincode && GO111MODULE=on go mod vendor @go build @echo "Build done" diff --git a/README.md b/README.md index 3c25ba8..d3911ef 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ # Tutorial Hyperledger Fabric SDK Go: How to build your first app? -Source: [chainhero.io/2018/06/tutorial-build-blockchain-app-v1-1-0](https://chainhero.io/2018/06/tutorial-build-blockchain-app-v1-1-0/) +Source: [chainhero.io/2018/06/tutorial-build-blockchain-app-v1-1-0 REQUIRED](REQUIRED) This tutorial will introduce you to the Hyperledger Fabric Go SDK and allows you to build a simple application using the blockchain principle. -**This tutorial uses Hyperledger Fabric version 1.1.0** +**This tutorial uses Hyperledger Fabric version 2.1.0** This is the **first part** of this tutorial. The basics SDK features will be shown, but the second part is scheduled to demonstrate a more complex application. ## 1. Prerequisites -This tutorial won’t explain in detail how Hyperledger Fabric works. I will just give some tips to understand the general behavior of the framework. If you want to get a full explanation of the tool, go to the official [documentation](http://hyperledger-fabric.readthedocs.io/en/latest/) there is a lot of work there that explains what kind of blockchain Hyperledger Fabric is. +This tutorial won’t explain in detail how Hyperledger Fabric works. I will just give some tips to understand the general behavior of the framework. If you want to get a full explanation of the tool, go to the official [documentation](https://hyperledger-fabric.readthedocs.io/en/release-2.1/) there is a lot of work there that explains what kind of blockchain Hyperledger Fabric is. This tutorial has been made on **Ubuntu 16.04** but the Hyperledger Fabric framework is compatible with Mac OS X, Windows and other Linux distributions. -We will use the **Go** language to design our first application because the Hyperledger Fabric has been also built in Go and the Fabric SDK Go is really simple to use. In addition, the chaincode (smart contract) can be written in Go too. So the full-stack will be only in Go! Awesome right ? However, if you are go phobic, there are other SDK like for NodeJS, Java or Python but we won't discuss about them here. +We will use the **Go** language to design our first application because the Hyperledger Fabric has been also built in Go and the Fabric SDK Go is really simple to use. In addition, the chaincode (smart contract) can be written in Go too. So the full-stack will be only in Go! Awesome right ? However, if you are go phobic (even if you shouldn't), there are other SDK like for NodeJS, Java or Python but we won't discuss about them here. Hyperledger Fabric uses **Docker** to easily deploy a blockchain network. In addition, some components (peers) also deploys docker containers to separate data (channel). So make sure that your platform supports this kind of virtualization. @@ -22,9 +22,9 @@ Hyperledger Fabric uses **Docker** to easily deploy a blockchain network. In add > Hyperledger Fabric is a platform for distributed ledger solutions underpinned by a modular architecture delivering high degrees of confidentiality, resiliency, flexibility and scalability. It is designed to support pluggable implementations of different components and accommodate the complexity and intricacies that exist across the economic ecosystem. -See the full explanation from the official documentation in the introduction part: [Hyperledger Fabric Blockchain](http://hyperledger-fabric.readthedocs.io/en/latest/blockchain.html) +See the full explanation from the official documentation in the introduction part: [Hyperledger Fabric Blockchain](https://hyperledger-fabric.readthedocs.io/en/release-2.1/blockchain.html) -![Blockchain Concensus](http://hyperledger-fabric.readthedocs.io/en/latest/_images/consensus.png) +![Blockchain Concensus](https://hyperledger-fabric.readthedocs.io/en/release-2.1/_images/consensus.png) ## 3. Installation guide @@ -88,7 +88,7 @@ See instructions from the Docker website: [docker.com/docker-for-windows](https: **Docker-compose version 1.8 or greater is required.** -We are currently unable to manage easily multiple containers at once. To solve this issue, we need **docker-compose**. +We are currently unable to easily manage multiple containers at once. To solve this issue, we need **docker-compose**. #### Linux @@ -113,16 +113,16 @@ See instructions from the Docker-compose website: [docs.docker.com/compose/insta ### c. Go -**Go version 1.9.x or greater is required.** +**Go version 1.13.x or greater is required.** #### Linux -You can either follow instructions from [golang.org](https://golang.org/dl/) or use those generics commands that will install Golang 1.9.2 and prepare your environment (generate your `GOPATH`) for Ubuntu: +You can either follow instructions from [golang.org](https://golang.org/dl/) or use those generics commands that will install the latest Golang and prepare your environment (generate your `GOPATH`) for Ubuntu: ```bash -wget https://storage.googleapis.com/golang/go1.9.2.linux-amd64.tar.gz && \ -sudo tar -C /usr/local -xzf go1.9.2.linux-amd64.tar.gz && \ -rm go1.9.2.linux-amd64.tar.gz && \ +wget https://storage.googleapis.com/golang/go1.13.1.linux-amd64.tar.gz && \ +sudo tar -C /usr/local -xzf go1.13.1.linux-amd64.tar.gz && \ +rm go1.13.1.linux-amd64.tar.gz && \ echo 'export PATH=$PATH:/usr/local/go/bin' | sudo tee -a /etc/profile && \ echo 'export GOPATH=$HOME/go' | tee -a $HOME/.bashrc && \ echo 'export PATH=$PATH:$GOROOT/bin:$GOPATH/bin' | tee -a $HOME/.bashrc && \ @@ -155,12 +155,12 @@ mkdir -p $GOPATH/src/github.com/chainHero/heroes-service && \ cd $GOPATH/src/github.com/chainHero/heroes-service ``` -To get the `fixtures` folder, you can either follow this command line, which will install and use subversion to get the folder from this repository. Or download the [zip file from Github](https://github.com/chainHero/heroes-service/archive/v1.1.0.zip) and extract only the `fixtures` folder. +To get the `fixtures` folder, you can either follow this command line, which will install and use subversion to get the folder from this repository. Or download the [zip file from Github](https://github.com/chainHero/heroes-service/archive/v2.1.0.zip) and extract only the `fixtures` folder. ```bash sudo apt install -y subversion && \ cd $GOPATH/src/github.com/chainHero/heroes-service && \ -svn checkout https://github.com/chainHero/heroes-service/branches/v1.1.0/fixtures && +svn checkout https://github.com/chainHero/heroes-service/branches/2.1.0/fixtures && rm -rf fixtures/.svn ``` @@ -529,7 +529,7 @@ import ( type FabricSetup struct { ConfigFile string OrgID string - OrdererID string + OrdererID string ChannelID string ChainCodeID string initialized bool @@ -601,7 +601,6 @@ func (setup *FabricSetup) Initialize() error { func (setup *FabricSetup) CloseSDK() { setup.sdk.Close() } - ``` The file is available here: [`blockchain/setup.go`](blockchain/setup.go) @@ -622,14 +621,14 @@ package main import ( "fmt" - "github.com/chainHero/heroes-service/blockchain" + "heroes-service/blockchain" "os" ) func main() { // Definition of the Fabric SDK properties fSetup := blockchain.FabricSetup{ - // Network parameters + // Network parameters OrdererID: "orderer.hf.chainhero.io", // Channel parameters @@ -655,40 +654,37 @@ func main() { return } // Close SDK - defer fSetup.CloseSDK() + defer fSetup.CloseSDK() } ``` The file is available here: [`main.go`](main.go) -The last thing to do, before starting the compilation, is to use a vendor directory that will contain all our dependencies. In our GOPATH we have Fabric SDK Go and maybe other projects. When we will try to compile our app, Golang search dependencies in our GOPATH, but first it checks if there is a vendor folder in the project. If the dependency is satisfied, then Golang doesn't go looking in GOPATH or GOROOT. This is very useful when using several different versions of a dependency (some conflicts can happen, like multiple definitions of BCCSP in our case. We will handle this by using a tool like [`dep`](https://github.com/golang/dep) to flatten these dependencies in the `vendor` directory. - -When you installed the SDK dependencies, DEP was automatically installed. If this is not the case, you can install it by reading the instructions available here: [dep installation](https://github.com/golang/dep#installation) +The last thing to do, before starting the compilation, is to use a dependencies manager. Luckily for us Golang now comes with Go Modules, its official dependencies manager. -Create a file called `Gopkg.toml` and copy this inside: +In order to initialize it for our project we need to tell Golang that our directory will need to use external libraries and therefore will have dependencies. +To do so: ```bash cd $GOPATH/src/github.com/chainHero/heroes-service && \ -vi Gopkg.toml +go mod init heroes-service ``` -```toml -ignored = ["github.com/chainHero/heroes-service/chaincode"] - -[[constraint]] - # Release v1.0.0-alpha4 - name = "github.com/hyperledger/fabric-sdk-go" - revision = "a906355f73d060d7bf95874a9e90dc17589edbb3" - +Now change the content of go.mod: +```bash +cd $GOPATH/src/github.com/chainHero/heroes-service && \ +vi go.mod ``` -This is a constraint for `dep` in order to specify that in our vendor we want the SDK Go to a specific version. +```go +module heroes-service -Save the file and then execute this command to synchronize the vendor directory with our project's dependencies (this may take a while to proceed): +go 1.13 -```bash -cd $GOPATH/src/github.com/chainHero/heroes-service && \ -dep ensure +require ( + github.com/hyperledger/fabric-sdk-go v1.0.0-beta1 + github.com/pkg/errors v0.9.1 +) ``` Now we can compile our application: @@ -698,7 +694,7 @@ cd $GOPATH/src/github.com/chainHero/heroes-service && \ go build ``` -After some time, a new binary named `main` will appear at the root of the project. Try to start the binary like this: +After some time, a new binary named `heroes-service` will appear at the root of the project. Try to start the binary like this: ```bash cd $GOPATH/src/github.com/chainHero/heroes-service && \ @@ -724,7 +720,7 @@ Alright! So we just initialised the SDK with our local network. In the next step ### d. Clean up and Makefile -The Fabric SDK generates some files, like certificates, binaries and temporally files. Shutting down the network won't fully clean up your environment and when you will need to start it again, these files will be reused to avoid building process. For development you can keep them to test quickly but for a real test, you need to clean up all and start from the beginning. +The Fabric SDK generates some files, like certificates, binaries and temporally files. Shutting down the network won't fully clean up your environment and when you will need to start it again, these files will be reused to avoid building process. For development, you can keep them to test quickly but for a real test, you need to clean up all and start from the beginning. *How to clean up my environment ?* @@ -773,7 +769,6 @@ dev: build run ##### BUILD build: @echo "Build ..." - @dep ensure @go build @echo "Build done" @@ -800,6 +795,7 @@ clean: env-down @docker rm -f -v `docker ps -a --no-trunc | grep "heroes-service" | cut -d ' ' -f 1` 2>/dev/null || true @docker rmi `docker images --no-trunc | grep "heroes-service" | cut -d ' ' -f 1` 2>/dev/null || true @echo "Clean up done" + ``` The file is available here: [`Makefile`](Makefile) @@ -833,12 +829,13 @@ package main import ( "fmt" - "github.com/hyperledger/fabric/core/chaincode/shim" - pb "github.com/hyperledger/fabric/protos/peer" + "github.com/hyperledger/fabric-chaincode-go/shim" + pb "github.com/hyperledger/fabric-protos-go/peer" ) // HeroesServiceChaincode implementation of Chaincode type HeroesServiceChaincode struct { + shim.Chaincode } // Init of the chaincode @@ -882,13 +879,14 @@ func (t *HeroesServiceChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Res if len(args) < 1 { return shim.Error("The number of arguments is insufficient.") } - + // In order to manage multiple type of request, we will check the first argument. // Here we have one possible argument: query (every query request will read in the ledger without modification) if args[0] == "query" { return t.query(stub, args) } + // If the arguments given don’t match any function, we return an error return shim.Error("Unknown action, check the first argument") } @@ -959,7 +957,7 @@ import ( type FabricSetup struct { ConfigFile string OrgID string - OrdererID string + OrdererID string ChannelID string ChainCodeID string initialized bool @@ -974,7 +972,61 @@ type FabricSetup struct { sdk *fabsdk.FabricSDK event *event.Client } -[...] + +// Initialize reads the configuration file and sets up the client, chain and event hub +func (setup *FabricSetup) Initialize() error { + + // Add parameters for the initialization + if setup.initialized { + return errors.New("sdk already initialized") + } + + // Initialize the SDK with the configuration file + sdk, err := fabsdk.New(config.FromFile(setup.ConfigFile)) + if err != nil { + return errors.WithMessage(err, "failed to create SDK") + } + setup.sdk = sdk + fmt.Println("SDK created") + + // The resource management client is responsible for managing channels (create/update channel) + resourceManagerClientContext := setup.sdk.Context(fabsdk.WithUser(setup.OrgAdmin), fabsdk.WithOrg(setup.OrgName)) + if err != nil { + return errors.WithMessage(err, "failed to load Admin identity") + } + resMgmtClient, err := resmgmt.New(resourceManagerClientContext) + if err != nil { + return errors.WithMessage(err, "failed to create channel management client from Admin identity") + } + setup.admin = resMgmtClient + fmt.Println("Ressource management client created") + + // The MSP client allow us to retrieve user information from their identity, like its signing identity which we will need to save the channel + mspClient, err := mspclient.New(sdk.Context(), mspclient.WithOrg(setup.OrgName)) + if err != nil { + return errors.WithMessage(err, "failed to create MSP client") + } + adminIdentity, err := mspClient.GetSigningIdentity(setup.OrgAdmin) + if err != nil { + return errors.WithMessage(err, "failed to get admin signing identity") + } + req := resmgmt.SaveChannelRequest{ChannelID: setup.ChannelID, ChannelConfigPath: setup.ChannelConfig, SigningIdentities: []msp.SigningIdentity{adminIdentity}} + txID, err := setup.admin.SaveChannel(req, resmgmt.WithOrdererEndpoint(setup.OrdererID)) + if err != nil || txID.TransactionID == "" { + return errors.WithMessage(err, "failed to save channel") + } + fmt.Println("Channel created") + + // Make admin user join the previously created channel + if err = setup.admin.JoinChannel(setup.ChannelID, resmgmt.WithRetry(retry.DefaultResMgmtOpts), resmgmt.WithOrdererEndpoint(setup.OrdererID)); err != nil { + return errors.WithMessage(err, "failed to make admin join channel") + } + fmt.Println("Channel joined") + + fmt.Println("Initialization Successful") + setup.initialized = true + return nil +} func (setup *FabricSetup) InstallAndInstantiateCC() error { @@ -1020,12 +1072,15 @@ func (setup *FabricSetup) InstallAndInstantiateCC() error { fmt.Println("Chaincode Installation & Instantiation Successful") return nil } -[...] + +func (setup *FabricSetup) CloseSDK() { + setup.sdk.Close() +} ``` The file is available here: [`blockchain/setup.go`](blockchain/setup.go) -> **Tips**: take care of the chaincode version, if you want to update your chaincode, increment the version number set at the line 105 of this [`setup.go`](blockchain/setup.go) file. Otherwise the network will keep the same chaincode. +> **Tips**: take care of the chaincode version, if you want to update your chaincode, increment the version number set at the line 103 of this [`setup.go`](blockchain/setup.go) file. Otherwise the network will keep the same chaincode. We need now to modify our `main.go` file in order to call our new function @@ -1039,7 +1094,7 @@ package main import ( "fmt" - "github.com/chainHero/heroes-service/blockchain" + "heroes-service/blockchain" "os" ) @@ -1047,8 +1102,8 @@ func main() { // Definition of the Fabric SDK properties fSetup := blockchain.FabricSetup{ // Network parameters - OrdererID: "orderer.hf.chainhero.io", - + OrdererID: "orderer.hf.chainhero.io", + // Channel parameters ChannelID: "chainhero", ChannelConfig: os.Getenv("GOPATH") + "/src/github.com/chainHero/heroes-service/fixtures/artifacts/chainhero.channel.tx", @@ -1057,14 +1112,23 @@ func main() { ChainCodeID: "heroes-service", ChaincodeGoPath: os.Getenv("GOPATH"), ChaincodePath: "github.com/chainHero/heroes-service/chaincode/", - OrgAdmin: setup.OrgAdmin, + OrgAdmin: "Admin", OrgName: "org1", ConfigFile: "config.yaml", // User parameters UserName: "User1", } -[...] + + // Initialization of the Fabric SDK from the previously set properties + err := fSetup.Initialize() + if err != nil { + fmt.Printf("Unable to initialize the Fabric SDK: %v\n", err) + return + } + // Close SDK + defer fSetup.CloseSDK() + // Install and instantiate the chaincode err = fSetup.InstallAndInstantiateCC() if err != nil { @@ -1072,11 +1136,54 @@ func main() { return } } - ``` The file is available here: [`main.go`](main.go) +The last thing we need to do is providing dependencies to the chaincode. We are also using Go Modules for that: + +```bash +cd $GOPATH/src/github.com/chainHero/heroes-service/chaincode && \ +go mod init chaincode +``` + +Now edit the go.mod file in the chaincode folder: + +``` +module chaincode + +go 1.13 + +require ( + github.com/hyperledger/fabric-chaincode-go v0.0.0-20200511190512-bcfeb58dd83a + github.com/hyperledger/fabric-protos-go v0.0.0-20200506201313-25f6564b9ac4 +) +``` + +Now populate the vendor: + +```bash +cd $GOPATH/src/github.com/chainHero/heroes-service/chaincode && \ +GO111MODULE=on go mod vendor +``` + +This is going to populate the chaincode with a vendor folder which will provide any dependencies that the chaincode required. + +Let's also add it to our Makefile: + +```Makefile +[...] + +##### BUILD +build: + @echo "Build ..." + @cd chaincode && GO111MODULE=on go mod vendor + @go build + @echo "Build done" + +[...] +``` + We can test this, just with the `make` command setup in the previous step: ```bash @@ -1170,7 +1277,42 @@ vi chaincode/main.go ``` ```go -[...] +package main + +import ( + "fmt" + "github.com/hyperledger/fabric-chaincode-go/shim" + pb "github.com/hyperledger/fabric-protos-go/peer" +) + +// HeroesServiceChaincode implementation of Chaincode +type HeroesServiceChaincode struct { + shim.Chaincode +} + +// Init of the chaincode +// This function is called only one when the chaincode is instantiated. +// So the goal is to prepare the ledger to handle future requests. +func (t *HeroesServiceChaincode) Init(stub shim.ChaincodeStubInterface) pb.Response { + fmt.Println("########### HeroesServiceChaincode Init ###########") + + // Get the function and arguments from the request + function, _ := stub.GetFunctionAndParameters() + + // Check if the request is the init function + if function != "init" { + return shim.Error("Unknown function call") + } + + // Put in the ledger the key/value hello/world + err := stub.PutState("hello", []byte("world")) + if err != nil { + return shim.Error(err.Error()) + } + + // Return a successful message + return shim.Success(nil) +} // Invoke // All future requests named invoke will arrive here. @@ -1205,7 +1347,33 @@ func (t *HeroesServiceChaincode) Invoke(stub shim.ChaincodeStubInterface) pb.Res return shim.Error("Unknown action, check the first argument") } -[...] +// query +// Every readonly functions in the ledger will be here +func (t *HeroesServiceChaincode) query(stub shim.ChaincodeStubInterface, args []string) pb.Response { + fmt.Println("########### HeroesServiceChaincode query ###########") + + // Check whether the number of arguments is sufficient + if len(args) < 2 { + return shim.Error("The number of arguments is insufficient.") + } + + // Like the Invoke function, we manage multiple type of query requests with the second argument. + // We also have only one possible argument: hello + if args[1] == "hello" { + + // Get the state of the value matching the key hello in the ledger + state, err := stub.GetState("hello") + if err != nil { + return shim.Error("Failed to get state of hello") + } + + // Return this value in response + return shim.Success(state) + } + + // If the arguments given don’t match any function, we return an error + return shim.Error("Unknown query action, check the second argument.") +} // invoke // Every functions that read and write in the ledger will be here @@ -1239,7 +1407,13 @@ func (t *HeroesServiceChaincode) invoke(stub shim.ChaincodeStubInterface, args [ return shim.Error("Unknown invoke action, check the second argument.") } -[...] +func main() { + // Start the chaincode and make it ready for futures requests + err := shim.Start(new(HeroesServiceChaincode)) + if err != nil { + fmt.Printf("Error starting Heroes Service chaincode: %s", err) + } +} ``` The file is available here: [`chaincode/main.go`](chaincode/main.go) @@ -1291,14 +1465,13 @@ func (setup *FabricSetup) InvokeHello(value string) (string, error) { // Wait for the result of the submission select { case ccEvent := <-notifier: - fmt.Printf("Received CC event: %s\n", ccEvent) + fmt.Printf("Received CC event: %v\n", ccEvent) case <-time.After(time.Second * 20): return "", fmt.Errorf("did NOT receive CC event for eventId(%s)", eventID) } return string(response.TransactionID), nil } - ``` The file is available here: [`blockchain/invoke.go`](blockchain/invoke.go) @@ -1381,7 +1554,7 @@ And finally, we change the [`main.go`](main.go), in order to use the web interfa Run the app and go to [localhost:3000/home.html](http://localhost:3000/home.html): ```bash -cd $GOPATH/src/github.com/chainHero/heroes-service ; \ +cd $GOPATH/src/github.com/chainHero/heroes-service && \ make ``` @@ -1406,7 +1579,7 @@ We can see the change by going back to the `home` page. ## 7. References - [Hyperledger website](https://www.hyperledger.org/) -- [Hyperledger Fabric online documentation](http://hyperledger-fabric.readthedocs.io/en/latest/) +- [Hyperledger Fabric online documentation](https://hyperledger-fabric.readthedocs.io/en/release-2.1/) - [Hyperledger Fabric on github](https://github.com/hyperledger/fabric) - [Hyperledger Fabric Certificate Authority on github](https://github.com/hyperledger/fabric-ca) - [Hyperledger Fabric SDK Go on github](https://github.com/hyperledger/fabric-sdk-go) diff --git a/chaincode/go.mod b/chaincode/go.mod new file mode 100644 index 0000000..a39b7d8 --- /dev/null +++ b/chaincode/go.mod @@ -0,0 +1,8 @@ +module chaincode + +go 1.13 + +require ( + github.com/hyperledger/fabric-chaincode-go v0.0.0-20200511190512-bcfeb58dd83a + github.com/hyperledger/fabric-protos-go v0.0.0-20200506201313-25f6564b9ac4 +) diff --git a/chaincode/go.sum b/chaincode/go.sum new file mode 100644 index 0000000..d754672 --- /dev/null +++ b/chaincode/go.sum @@ -0,0 +1,46 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/hyperledger/fabric-chaincode-go v0.0.0-20200511190512-bcfeb58dd83a h1:KoFw2HnRfW+EItMP0zvUUl1FGzDb/7O0ov7uXZffQok= +github.com/hyperledger/fabric-chaincode-go v0.0.0-20200511190512-bcfeb58dd83a/go.mod h1:N7H3sA7Tx4k/YzFq7U0EPdqJtqvM4Kild0JoCc7C0Dc= +github.com/hyperledger/fabric-protos-go v0.0.0-20190919234611-2a87503ac7c9/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0= +github.com/hyperledger/fabric-protos-go v0.0.0-20200506201313-25f6564b9ac4 h1:75hBp86WljV3uQ7Q/wbO5w8ahfLAzxH7jfT5kVy2n6g= +github.com/hyperledger/fabric-protos-go v0.0.0-20200506201313-25f6564b9ac4/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092 h1:4QSRKanuywn15aTZvI/mIDEgPQpswuFndXpOj3rKEco= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542 h1:6ZQFf1D2YYDDI7eSwW8adlkkavTB9sw5I24FVtEvNUQ= +golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b h1:lohp5blsw53GBXtLyLNaTXPXS9pJ1tiTw61ZHUoE9Qw= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/chaincode/main.go b/chaincode/main.go index cc93c45..2b635ad 100644 --- a/chaincode/main.go +++ b/chaincode/main.go @@ -2,12 +2,13 @@ package main import ( "fmt" - "github.com/hyperledger/fabric/core/chaincode/shim" - pb "github.com/hyperledger/fabric/protos/peer" + "github.com/hyperledger/fabric-chaincode-go/shim" + pb "github.com/hyperledger/fabric-protos-go/peer" ) // HeroesServiceChaincode implementation of Chaincode type HeroesServiceChaincode struct { + shim.Chaincode } // Init of the chaincode diff --git a/fixtures/docker-compose.yaml b/fixtures/docker-compose.yaml index 89fd890..57e7e27 100644 --- a/fixtures/docker-compose.yaml +++ b/fixtures/docker-compose.yaml @@ -1,4 +1,4 @@ -version: '2' +version: '3' networks: default: @@ -6,7 +6,7 @@ networks: services: orderer.hf.chainhero.io: - image: hyperledger/fabric-orderer:x86_64-1.1.0 + image: hyperledger/fabric-orderer:2.1.0 container_name: orderer.hf.chainhero.io environment: - ORDERER_GENERAL_LOGLEVEL=debug @@ -36,7 +36,7 @@ services: - orderer.hf.chainhero.io ca.org1.hf.chainhero.io: - image: hyperledger/fabric-ca:x86_64-1.1.0 + image: hyperledger/fabric-ca:1.4 container_name: ca.org1.hf.chainhero.io environment: - FABRIC_CA_HOME=/etc/hyperledger/fabric-ca-server @@ -57,7 +57,7 @@ services: - ca.org1.hf.chainhero.io peer0.org1.hf.chainhero.io: - image: hyperledger/fabric-peer:x86_64-1.1.0 + image: hyperledger/fabric-peer:2.1.0 container_name: peer0.org1.hf.chainhero.io environment: - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock @@ -98,7 +98,7 @@ services: - peer0.org1.hf.chainhero.io peer1.org1.hf.chainhero.io: - image: hyperledger/fabric-peer:x86_64-1.1.0 + image: hyperledger/fabric-peer:2.1.0 container_name: peer1.org1.hf.chainhero.io environment: - CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..3cdd2eb --- /dev/null +++ b/go.mod @@ -0,0 +1,8 @@ +module heroes-service + +go 1.13 + +require ( + github.com/hyperledger/fabric-sdk-go v1.0.0-beta1 + github.com/pkg/errors v0.9.1 +) diff --git a/go.sum b/go.sum new file mode 100644 index 0000000..1916843 --- /dev/null +++ b/go.sum @@ -0,0 +1,151 @@ +cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= +github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ= +github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= +github.com/Knetic/govaluate v3.0.0+incompatible h1:7o6+MAPhYTCF0+fdvoz1xDedhRb4f6s9Tn1Tt7/WTEg= +github.com/Knetic/govaluate v3.0.0+incompatible/go.mod h1:r7JcOSlj0wfOMncg0iLm8Leh48TZaKVeNIfJntJ2wa0= +github.com/VividCortex/gohistogram v1.0.0 h1:6+hBz+qvs0JOrrNhhmR7lFxo5sINxBCGXrdtl/UvroE= +github.com/VividCortex/gohistogram v1.0.0/go.mod h1:Pf5mBqqDxYaXu3hDrrU+w6nw50o/4+TcAqDqk/vUH7g= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973 h1:xJ4a3vCFaGF/jqvzLMYoU8P317H5OQ+Via4RmuPwCS0= +github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q= +github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= +github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004 h1:lkAMpLVBDaj17e85keuznYcH5rqI438v41pKcBl4ZxQ= +github.com/cloudflare/cfssl v0.0.0-20180223231731-4e2dcbde5004/go.mod h1:yMWuSON2oQp+43nFtAV/uvKQIFpSPerB57DCt9t8sSA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I= +github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo= +github.com/go-kit/kit v0.8.0 h1:Wz+5lgoB0kkuqLEc6NVmwRknTKP6dTGbSqvhZtBI/j0= +github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= +github.com/go-logfmt/logfmt v0.4.0 h1:MP4Eh7ZCb31lleYCFuwm0oe4/YGak+5l1vA2NOE80nA= +github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= +github.com/go-stack/stack v1.8.0 h1:5SgMzNM5HxrEjV0ww2lTmX6E2Izsfxas4+YHWRs3Lsk= +github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= +github.com/gogo/protobuf v1.1.1 h1:72R+M5VuhED/KujmZVcIquuo8mBgX4oVda//DQb3PXo= +github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= +github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= +github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/mock v1.2.0 h1:28o5sBqPkBsMGnC6b4MvE2TzSr5/AT4c/1fLqVGIwlk= +github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A= +github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.2 h1:6nsPYzhq5kReh6QImI3k5qWzO4PEbvbIW2cwSfR/6xs= +github.com/golang/protobuf v1.3.2/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/google/certificate-transparency-go v0.0.0-20180222191210-5ab67e519c93 h1:qdfmdGwtm13OVx+AxguOWUTbgmXGn2TbdUHipo3chMg= +github.com/google/certificate-transparency-go v0.0.0-20180222191210-5ab67e519c93/go.mod h1:QeJfpSbVSfYc7RgB3gJFj9cbuQMMchQxrWXz8Ruopmg= +github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= +github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce h1:xdsDDbiBDQTKASoGEZ+pEmF1OnWuu8AQ9I8iNbHNeno= +github.com/hashicorp/hcl v0.0.0-20180404174102-ef8a98b0bbce/go.mod h1:oZtUIOe8dh44I2q6ScRibXws4Ajl+d+nod3AaR9vL5w= +github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= +github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= +github.com/hyperledger/fabric-chaincode-go v0.0.0-20200511190512-bcfeb58dd83a h1:KoFw2HnRfW+EItMP0zvUUl1FGzDb/7O0ov7uXZffQok= +github.com/hyperledger/fabric-chaincode-go v0.0.0-20200511190512-bcfeb58dd83a/go.mod h1:N7H3sA7Tx4k/YzFq7U0EPdqJtqvM4Kild0JoCc7C0Dc= +github.com/hyperledger/fabric-lib-go v1.0.0 h1:UL1w7c9LvHZUSkIvHTDGklxFv2kTeva1QI2emOVc324= +github.com/hyperledger/fabric-lib-go v1.0.0/go.mod h1:H362nMlunurmHwkYqR5uHL2UDWbQdbfz74n8kbCFsqc= +github.com/hyperledger/fabric-protos-go v0.0.0-20190821180310-6b6ac9042dfd h1:z0IbaMd4Ry2Cmmxujzy4UDgCUsT/0dOqqoGtOcvDw9Q= +github.com/hyperledger/fabric-protos-go v0.0.0-20190821180310-6b6ac9042dfd/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0= +github.com/hyperledger/fabric-protos-go v0.0.0-20190919234611-2a87503ac7c9 h1:JgFP410JY/3uQQGcfxR1HUDdDnPWzmC0TlmPctPElCQ= +github.com/hyperledger/fabric-protos-go v0.0.0-20190919234611-2a87503ac7c9/go.mod h1:xVYTjK4DtZRBxZ2D9aE4y6AbLaPwue2o/criQyQbVD0= +github.com/hyperledger/fabric-sdk-go v1.0.0-beta1 h1:id5BJE6TZu/SaGQahns6sO2o+n5fwps7GrWGCJJnAY8= +github.com/hyperledger/fabric-sdk-go v1.0.0-beta1/go.mod h1:i8yJ9t8i1fGe7opUcq6uESxhruMJNXlc+Rx9ooBZsYg= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515 h1:T+h1c/A9Gawja4Y9mFVWj2vyii2bbUNDw3kt9VxK2EY= +github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/magiconair/properties v1.7.6 h1:U+1DqNen04MdEPgFiIwdOUiqZ8qPa37xgogX/sd3+54= +github.com/magiconair/properties v1.7.6/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= +github.com/matttproud/golang_protobuf_extensions v1.0.1 h1:4hp9jkHxhMHkqkrB3Ix0jegS5sx/RkqARlsWZ6pIwiU= +github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0= +github.com/miekg/pkcs11 v0.0.0-20190329070431-55f3fac3af27/go.mod h1:WCBAbTOdfhHhz7YXujeZMF7owC4tPb1naKFsgfUISjo= +github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238 h1:+MZW2uvHgN8kYvksEN3f7eFL2wpzk0GxmlFsMybWc7E= +github.com/mitchellh/mapstructure v0.0.0-20180220230111-00c29f56e238/go.mod h1:FVVH3fgwuzCH5S8UJGiWEs2h04kUh9fWfEaFds41c1Y= +github.com/onsi/ginkgo v1.6.0 h1:Ix8l273rp3QzYgXSR+c8d1fTG7UPgYkOSELPhiY/YGw= +github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= +github.com/onsi/gomega v1.4.2 h1:3mYCb7aPxS/RU7TI1y4rkEn1oKmPRjNJLNEXgw7MH2I= +github.com/onsi/gomega v1.4.2/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= +github.com/pelletier/go-toml v1.1.0 h1:cmiOvKzEunMsAxyhXSzpL5Q1CRKpVv0KQsnAIcSEVYM= +github.com/pelletier/go-toml v1.1.0/go.mod h1:5z9KED0ma1S8pY6P1sdut58dfprrGBbd/94hg7ilaic= +github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4= +github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/prometheus/client_golang v0.8.0 h1:1921Yw9Gc3iSc4VQh3PIoOqgPCZS7G/4xQNVUp8Mda8= +github.com/prometheus/client_golang v0.8.0/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910 h1:idejC8f05m9MGOsuEi1ATq9shN03HrxNkD/luQvxCv8= +github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo= +github.com/prometheus/common v0.0.0-20180518154759-7600349dcfe1 h1:osmNoEW2SCW3L7EX0km2LYM8HKpNWRiouxjE3XHkyGc= +github.com/prometheus/common v0.0.0-20180518154759-7600349dcfe1/go.mod h1:daVV7qP5qjZbuso7PdcryaAu0sAZbrN9i7WWcTMWvro= +github.com/prometheus/procfs v0.0.0-20180705121852-ae68e2d4c00f h1:c9M4CCa6g8WURSsbrl3lb/w/G1Z5xZpYvhhjdcVDOkE= +github.com/prometheus/procfs v0.0.0-20180705121852-ae68e2d4c00f/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk= +github.com/spf13/afero v1.1.0 h1:bopulORc2JeYaxfHLvJa5NzxviA9PoWhpiiJkru7Ji4= +github.com/spf13/afero v1.1.0/go.mod h1:j4pytiNVoe2o6bmDsKpLACNPDBIoEAkihy7loJ1B0CQ= +github.com/spf13/cast v1.2.0 h1:HHl1DSRbEQN2i8tJmtS6ViPyHx35+p51amrdsiTCrkg= +github.com/spf13/cast v1.2.0/go.mod h1:r2rcYCSwa1IExKTDiTfzaxqT2FNHs8hODu4LnUfgKEg= +github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec h1:2ZXvIUGghLpdTVHR1UfvfrzoVlZaE/yOWC5LueIHZig= +github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec/go.mod h1:cQK4TGJAtQXfYWX+Ddv3mKDzgVb68N+wFjFa4jdeBTo= +github.com/spf13/pflag v1.0.1 h1:aCvUg6QPl3ibpQUxyLkrEkCHtPqYJL4x9AuhqVqFis4= +github.com/spf13/pflag v1.0.1/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4= +github.com/spf13/viper v1.0.2 h1:Ncr3ZIuJn322w2k1qmzXDnkLAdQMlJqBa9kfAH+irso= +github.com/spf13/viper v1.0.2/go.mod h1:A8kyI5cUJhb8N+3pkfONlcEcZbueH6nhAm0Fq7SrnBM= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0 h1:TivCn/peBQ7UY8ooIcPgZFpTNSz0Q2U6UrFlUfqbe0Q= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= +github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2 h1:VklqNMn3ovrHsnt90PveolxSbWFaJdECFbxSq0Mqo2M= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= +golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= +golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= +golang.org/x/lint v0.0.0-20190313153728-d0100b6bd8b3/go.mod h1:6SW0HCj/g11FgYtHlgUYUwCkIfeOF89ocIRzGO/8vkc= +golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4= +golang.org/x/net v0.0.0-20190311183353-d8887717615a h1:oWX7TPOiFAMXLq8o0ikBYfCJVlRHBcsciT5bXOrH628= +golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092 h1:4QSRKanuywn15aTZvI/mIDEgPQpswuFndXpOj3rKEco= +golang.org/x/net v0.0.0-20190522155817-f3200d17e092/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= +golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a h1:1BGLXjeY4akVXGgbC9HugT3Jv3hCI0z56oJR5vAMgBU= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542 h1:6ZQFf1D2YYDDI7eSwW8adlkkavTB9sw5I24FVtEvNUQ= +golang.org/x/sys v0.0.0-20190710143415-6ec70d6a5542/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/text v0.3.0 h1:g61tztE5qeGQ89tm6NTjjM9VPIm088od1l6aSorWRWg= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY= +golang.org/x/tools v0.0.0-20190311212946-11955173bddd/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs= +golang.org/x/tools v0.0.0-20190524140312-2c0ae7006135/go.mod h1:RgjU9mgBXZiqYHBnxXauZ1Gv1EHHAz9KjViQ78xBX0Q= +google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM= +google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4= +google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20180831171423-11092d34479b/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc= +google.golang.org/genproto v0.0.0-20190327125643-d831d65fe17d h1:XB2jc5XQ9uhizGTS2vWcN01bc4dI6z3C4KY5MQm8SS8= +google.golang.org/genproto v0.0.0-20190327125643-d831d65fe17d/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE= +google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c= +google.golang.org/grpc v1.23.0 h1:AzbTB6ux+okLTzP8Ru1Xs41C303zdcfEht7MQnYJt5A= +google.golang.org/grpc v1.23.0/go.mod h1:Y5yQAOtifL1yxbo5wqy6BxZv8vAUGQwXBOALyacEbxg= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/fsnotify.v1 v1.4.7 h1:xOHLXZwVvI9hhs+cLKq5+I5onOuwQLhQwiu63xxlHs4= +gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ= +gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw= +gopkg.in/yaml.v2 v2.2.1 h1:mUhvW9EsL+naU5Q3cakzfE91YhliOondGd6ZrsDBHQE= +gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.2.2 h1:ZCJp+EgiOT7lHqUV2J862kp8Qj64Jo6az82+3Td9dZw= +gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/main.go b/main.go index 72ef4c1..82867d9 100644 --- a/main.go +++ b/main.go @@ -2,9 +2,9 @@ package main import ( "fmt" - "github.com/chainHero/heroes-service/blockchain" - "github.com/chainHero/heroes-service/web" - "github.com/chainHero/heroes-service/web/controllers" + "heroes-service/blockchain" + "heroes-service/web" + "heroes-service/web/controllers" "os" ) diff --git a/web/app.go b/web/app.go index 6e1d94b..10e955a 100644 --- a/web/app.go +++ b/web/app.go @@ -2,7 +2,7 @@ package web import ( "fmt" - "github.com/chainHero/heroes-service/web/controllers" + "heroes-service/web/controllers" "net/http" ) diff --git a/web/controllers/controller.go b/web/controllers/controller.go index df58474..3b152ff 100644 --- a/web/controllers/controller.go +++ b/web/controllers/controller.go @@ -2,7 +2,7 @@ package controllers import ( "fmt" - "github.com/chainHero/heroes-service/blockchain" + "heroes-service/blockchain" "html/template" "net/http" "os"