Skip to content

PaulienLem/hyperledger-sample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Hyperledger example

Setup

  • make sure go is installed correctly and $GOPATH and $GOROOT are set
  • Setup on Mac:
    • Install go
    • Edit ~/.bash_profile :
       export GOPATH=$HOME/go
       export GOROOT=/usr/local/opt/go/libexec
       export PATH=$PATH:$GOPATH/bin
       export PATH=$PATH:$GOROOT/bin   
      
      

Run blockchain

- npm install - Run ./start.sh from the blockchain folder. This should start the following containers * dev-peer0.org1.example.com-mycc-v0 * peer0.org1.example.com * ca.example.com * cli * orderer.example.comto - to redeploy chaincode: ./teardown.sh and restart (TODO - solve this more efficiently)

Run backend

* npm start

Using the API

- GET to http://localhost:9000/v1/register-user/ to register a user - GET to http://localhost:9000/v1/query//queryAllCoachingPlans/1 to get all coachingPlans - POST to http://localhost:9000/v1/invoke with body ```
    {
      "invokeArgs": [
        "KEY1", "Coach", "Coachee", "Goal"
      ],
      "invoker": "SomeUser",
      "invokeFcn": "createCoachingPlan"
    }

Releases

No releases published

Packages

No packages published