Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lgsvl/data-marketplace-chaincode-rest
REST interface to invoke the data marketplace chain code deployed in Hyperledger Fabric
https://github.com/lgsvl/data-marketplace-chaincode-rest
Last synced: about 2 months ago
JSON representation
REST interface to invoke the data marketplace chain code deployed in Hyperledger Fabric
- Host: GitHub
- URL: https://github.com/lgsvl/data-marketplace-chaincode-rest
- Owner: lgsvl
- License: apache-2.0
- Created: 2019-03-07T15:12:54.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-03T22:18:46.000Z (over 5 years ago)
- Last Synced: 2024-06-20T16:50:45.042Z (6 months ago)
- Language: Go
- Size: 5.14 MB
- Stars: 2
- Watchers: 8
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Chaincode REST
This repository contains the needed code that exposes the chaincode (Hyperledger Fabric smart contract). The project is written in [Go](https://golang.org/).
To run this component correctly, you should be familiar with the [Data marketplace](https://github.com/lgsvl/data-marketplace) components because there is a particular dependency between the components.# Build prerequisites
* Install [golang](https://golang.org/).
* Install [git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git).
* Configure go. GOPATH environment variable must be set correctly before starting the build process.### Download and build source code
```bash
mkdir -p $HOME/workspace
export GOPATH=$HOME/workspace
mkdir -p $GOPATH/src/github.com/lgsvl
cd $GOPATH/src/github.com/lgsvl
git clone [email protected]:lgsvl/data-marketplace-chaincode-rest.git
cd data-marketplace-chaincode-rest
./scripts/build
```### Docker Build
You can use the dockerfile to build a docker image:
```
docker build -t chaincode-rest .
docker run -p 9090:9090 chaincode-rest
```You can see the API spec on [localhost:9090/swaggerui](localhost:9090/swaggerui).
### Kubernetes deployment
The [deployment](./deployment) folder contains the deployment and service/ingress manifests to deploy this component.
We assume that you have a running Hyperledger Fabric network running with the [Data marketplace Chaincode](https://github.com/lgsvl/data-marketplace-chaincode) deployed on top of it.
We assume also that the deployment has access to a shared volume (PVC) named `sharedvolume` that contains information about the chaincode, used channels and certificates (probably created for hyperledger Fabric setup already).Once deployed, the service API could be accessed at the `:9090/swaggerui`.
# Running the Unit Tests
Run the tests:
```bash
./scripts/run_units.sh
```