Git Product home page Git Product logo

hyperledger-fabric-rest-api-go's Introduction

Fabric REST API Go

REST control system for Hyperledger Fabric network.

Features

  • Invoke and query chaincode
  • Chaincode detailed info
  • Channels list
  • Channel peers
  • CA and transactions light cryptography
  • ...

Local test instructions

Requirements:

Clone repo outside GOPATH in order to go module work correctly.

Build and run

make run

NOTE: only one test network could be up at the same time

Run all unit and end-2-end tests

make test

Stop and clear all test networks

make clear

Basic network test

Start local basic test network

make basic_up

To create and install/instantiate chaincode do POST request to localhost:8080/init_test_fixtures

Run E2E tests against Basic network

make basic_e2e_test

Postman collection

/test/FabricApiBasic.postman_collection.json

BYFN test

Additional requirements:

  • qj command-line JSON processor

Start local basic test network

make byfn_up

Run E2E tests against BYFN

make byfn_e2e_test

Postman collection

/test/FabricApiBYFN.postman_collection.json

Light cryptography demo

Start BYFN network with API and demo app at http://localhost:3000/. Also script will register demo user in ORG1 CA with creds - CaUser:password

make demo_light_up

Stop demo app and clear containers

make demo_light_down

Example sequence of actions to interact with standard A to B transfer chaincode:

Enroll user:

  1. "GET TBS CSR /CA/TBSCSR"
  2. "SIGN TBS CSR"
  3. "ENROLL TO CA WITH CREDS, TBS CSR AND SIGNATURE - /CA/ENROLL_CSR"

Query:

  1. Fill out five fields with: mychannel / mycc / Org1MSP / query / a
  2. "CALL /TX/PROPOSAL"
  3. "SIGN PROPOSAL"
  4. "QUERY PROPOSAL"

Invoke:

  1. Fill out five fields with: mychannel / mycc / Org1MSP / invoke / a,b,15
  2. "CALL /TX/PROPOSAL"
  3. "SIGN PROPOSAL"
  4. Fill out endorsement peers with: org1/peer0,org2/peer0
  5. "GET BROADCAST PAYLOAD (PROPOSAL+ENDORSMENTS)"
  6. "SIGN BROADCAST PAYLOAD"
  7. "BROADCAST PAYLOAD WITH SIGNATURE"

After finishing invoke sequence you may run query sequence again, to check out that value have been changed.

Work progress

Close plans

  • Channels creation
  • Network management
  • Documentation

Strategic plans

  • Cover code with unit test (partially done)

hyperledger-fabric-rest-api-go's People

Contributors

kochetkov-av avatar yod527 avatar

Forkers

vschernoff

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.