Skip to content
Hyperledger Fabric GraphQL Boilerplate
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
data
deploy
repl
scripts
src
test
.babelrc
.env
.env.example
.eslintrc
.flowconfig
.gitignore
.graphqlrc
0.secure.blockchain.ibm.com.cert
README.md
ServiceCredentials.json
clearAll.sh
compose-defaults.yml
config.json
docker-compose.yml
explorer.yml
helloblockchain.js
nodemon.json
package.json
repl.js
us.blockchain.ibm.com.cert
yarn.lock

README.md

Hyperledger Fabric GraphQL Boilerplate

This is a boilerplate to start using hyperledger fabric blockchain with GraphQL

Hire us

You can hire us to build your next blockchain project using Hyperledger and GraphQL - Entria

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

mutation deployChain {
 Deploy(input: {
  fcn:"init"
  args: ["a", "100", "b", "200"]
  clientMutationId:"1"
	}) {
  	results
	}
}
You can’t perform that action at this time.