Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/entria/hyperledger-fabric-graphql-boilerplate
Hyperledger Fabric GraphQL Boilerplate
https://github.com/entria/hyperledger-fabric-graphql-boilerplate
boilerplate fabric graphql hyperledger
Last synced: 3 months ago
JSON representation
Hyperledger Fabric GraphQL Boilerplate
- Host: GitHub
- URL: https://github.com/entria/hyperledger-fabric-graphql-boilerplate
- Owner: entria
- Archived: true
- Created: 2017-02-05T20:02:14.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-04-21T20:05:28.000Z (over 7 years ago)
- Last Synced: 2024-07-20T23:45:55.783Z (4 months ago)
- Topics: boilerplate, fabric, graphql, hyperledger
- Language: JavaScript
- Size: 89.8 KB
- Stars: 45
- Watchers: 6
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hyperledger Fabric GraphQL Boilerplate
This is a boilerplate to start using hyperledger fabric blockchain with GraphQL
- based on: [fabric-boilerplate](https://github.com/IBM-Blockchain/fabric-boilerplate)
- based on GraphQL boilerplate code: [graphql-dataloader-boilerplate](https://github.com/entria/graphql-dataloader-boilerplate)
- [Create-GraphQL](https://github.com/lucasbento/create-graphql) was used to generate GraphQL boilerplate## Hire us
You can hire us to build your next blockchain project using Hyperledger and GraphQL - [Entria](http://entria.com.br/)## How to build Go chaincode locally
### Install go
```
brew install go
mkdir ~/.go
```### Configure GOPATH
add this to .bashrc
```
export GOPATH="${HOME}/.go"
export GOROOT="$(brew --prefix golang)/libexec"
``````
yarn go:install
```then
```
yarn go:build
```# Run locally with docker-compose
Clear content of deploy/local before creating new containers
```
yarn clear
``````
docker-compose up
```## Test if it is running ok
go to `http://localhost:7050/chain`## Go to Hyperledger Explorer
go to `http://localhost:9090`## How to test chaincode
```
yarn run go:test
```## How to interact with chain
```
yarn repl
```Query data for an entity (**a** and **b** are the valid entities for now)
```
bl > queryEntity('a')
```Transfer **coins** from an entity to another
```
bl > transfer('a', 'b', 10)
```### How to deploy a new chaincode using GraphQL
```graphql
mutation deployChain {
Deploy(input: {
fcn:"init"
args: ["a", "100", "b", "200"]
clientMutationId:"1"
}) {
results
}
}
```