The aim of this project is to demonstrate Hyperledger fabric features using the HF Client SDK for Golang. This repository contains implementation of Fabcar Network in Go SDK using the first-network, although it is possible to use other chaincode/network setup. Implementation of Fabcar network in NodeJS can be found here. Go SDK v1.0.0-beta1 version is used to run the application.
- Better documentation (done)
- Private data collection example
- Add query ledger apis
- Use Raft ordering (done)
- Web server with APIs for operations (done)
- Simple web UI
-
Chaincode support in multiple languages(SDK v1.0.0-beta1 release supports Golang chaincode only) -
Fabric 2.0 Compatibility(SDK v1.0.0-beta1 supports Fabric 1.4 only)
Pulls are welcome!!!
Before start, please make sure that you have all the required prerequisites (link1,link2) installed. You also need the following additional packages installed.
- make (sudo apt install make)
- Clone this repository inside your $GOPATH/src folder.
- cd $GOPATH/src/gosdk-example && make
- Now, a web server will be up and listening on localhost:3000 port.
- Open a new terminal and run testAPIs.sh
- This application uses CouchDB database and Raft ordering. This can be changed in the startFabric.sh file.
- Clean cache of previous run
- Brings 'first-network' down
- Build main.go
- Start the first network
- Run main.go
- Initializes setups of two organizations, with SDK instance and admin user.
- Starts the web server on 3000 port.
Web server supports following requests. testAPIs.sh file contains sample curl requests.
- User Enrollment
- Channel Creation
- Join Channel
- Install Chaincode
- Instantiate Chaincode
- Execute chaincode
- Query chaincode
- Upgrade chaincode