Code Monkey home page Code Monkey logo

fabric-app's Introduction

Fabric Application Setup Guide

This guide will walk you through the steps to set up and run a Fabric application. Follow the instructions below to clone the repository, set up the network, deploy the chaincode, and run the application.

Prerequisites

  • Ensure you have the necessary dependencies installed, including Node.js, npm, Docker, and Docker Compose.

Steps to Set Up the Fabric Application

  1. Navigate to the Fabric Samples Folder

    cd fabric-samples
  2. Clone the Repository

    git clone <repository-url>
  3. Change Directory to the Fabric Application

    cd fabric-app
  4. Folder Structure

    In the fabric-app directory, you will find two folders:

    1. chaincode
    2. application
  5. Set Up Chaincode

    Change directory to the chaincode folder:

    cd chaincode

    Install the necessary Node modules:

    npm install

    Run the following commands to set environment variables:

    export CORE_PEER_MSPCONFIGPATH=${PWD}/organizations/peerOrganizations/org1.example.com/users/[email protected]/msp
    export CORE_PEER_TLS_ROOTCERT_FILE=${PWD}/organizations/peerOrganizations/org1.example.com/peers/peer0.org1.example.com/tls/ca.crt
    export CORE_PEER_LOCALMSPID="Org1MSP"
  6. Open a New Terminal Session

    In the new terminal session, navigate to the test network directory:

    cd fabric-samples/test-network
  7. Shut Down Any Running Network

    sudo ./network.sh down
  8. Create a New Channel

    ./network.sh up createChannel -c mychannel -ca
  9. Deploy the Chaincode

    ./network.sh deployCC -ccn basic -ccp ../fabric-app/chaincode/ -ccl javascript
  10. Return to the Previous Terminal Session

    Navigate to the application folder:

    cd ../application
  11. Install Node Modules

    npm install
  12. Run the Application

    node app.js

Your Fabric application should now be up and running. Follow the steps carefully, and ensure all dependencies are installed before starting the setup process. If you encounter any issues, refer to the Fabric documentation or seek help from the community.

fabric-app's People

Contributors

asim-shah-2004 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.