Git Product home page Git Product logo

chaincode-dev-mode's Introduction

Hyperledger Fabric Logo

A modular blockchain framework that acts as a foundation for developing blockchain-based products, solutions, and applications using plug-and-play components that are aimed for use within private enterprises.

Installing Dependencies

Intalling dependencies will do following operations:

  1. Download and installation of Go dependencies. (Go will be installed on /opt/go)
  2. Transfer fabric necessary files like fabric-ca-client fabric-ca-server from ./bin folder to /opt/go/bin

NOTE: Run the dependency run only if you haven't downloaded the go library and assign the GOPATH

Run the command for installing all the dependencies:

./installDependencies.sh

After the completion, add the GO ENV path on ~/.profile

Open editor using nano

sudo nano ~/.profile

Copy and paste the following lines at EOF

export GOPATH=/opt/gopath export PATH=$PATH:/opt/go/bin:$GOPATH/bin

Save the file using Ctrl+O

Then run the following command

source ~/.profile

Bring Up the network

Run following command to launch dev environment

Replace the <chaincode_path> with the path where your chaincode folder resides For Example: If your chaincode is on the path ../test/sample/sample.go then run the below command as: ./networkUp.sh ../test/sample

./networkUp.sh <chaincode_path>

Run Chaincode Container

We run the chaincode container using the following command

This will run the chaincode container. Leave the terminal at it is and on next terminal run the Chaincode Install script Replace the <chaincode_name> with the name of your chaincode. Make sure the chaincode name matches the chaincode folder name

./runChaincode.sh <chaincode_name>

Install Chaincode

Installing chaincode on the peer

This will run the chaincode container. Leave the terminal at it is and on next terminal run the Chaincode Install script Replace the <chaincode_name> with the name of your chaincode. Make sure the chaincode name matches the chaincode folder name

./installChaincode.sh <chaincode_name>

Invoke Chaincode

For invoking chaincode we need to run the command manually

NOTE: Replace chaincodeName with your chaincode name, functionName with the required value. Make sure the arguments are string value separated with comma.

peer chaincode invoke -n <chaincodeName> -c '{"Args":["<functionName>","<arg1>","<arg2>"...]}' -C myc

Query Chaincode

For quering chaincode we need to run the command manually

NOTE: Replace chaincodeName with your chaincode name, functionName with the required value. Make sure the arguments are string value separated with comma.

peer chaincode query -n <chaincodeName> -c '{"Args":["<functionName>","<arg1>","<arg2>"...]}' -C myc

We are Good to Go Cheers!!

chaincode-dev-mode's People

Contributors

jenish-kilroy avatar dev-jb avatar

Watchers

 avatar

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.