Skip to content

Hyperledger Fabric Asset-Transfer-Basic-Application deploys Hyperledger Fabric 2.5 with Node.js SDK and React.js. It showcases asset CRUD operations and transaction demonstrations with simplified asset transfer in a no-ownership-verification context.

Notifications You must be signed in to change notification settings

ruhulamin1398/Blockchain-Hyperledger-Fabric-Node.js-SDK-React.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 

Repository files navigation

Blockchain Todo : Hyperledger Fabric | Node.js SDK | React.js

The Hyperledger Fabric Asset-Transfer-Basic-Application, utilizing Hyperledger Fabric 2.5, deploys a Node.js SDK and React.js. This sample showcases asset operations, including creation, reading, updating, transferring, and deletion. The smart contract facilitates these actions, providing CreateAsset, ReadAsset, UpdateAsset, DeleteAsset, and TransferAsset functions for demonstration purposes, focusing on transaction invocation within a simplified context.

Hyperledger Fabric Application: Asset Transfer Basic Application | Node.js SDK | React.js

The asset transfer basic sample demonstrates:

  • Connecting a client application to a Fabric blockchain network.
  • Submitting smart contract transactions to update ledger state.
  • Evaluating smart contract transactions to query ledger state.
  • Handling errors in transaction invocation.

About the sample

This sample includes smart contract and application code in multiple languages. This sample shows create, read, update, transfer and delete of an asset.

For a more detailed walk-through of the application code and client API usage, refer to the Running a Fabric Application tutorial in the main Hyperledger Fabric documentation.

Application

Follow the execution flow in the client application code, and corresponding output on running the application. Pay attention to the sequence of:

  • Transaction invocations (console output like "--> Submit Transaction" and "--> Evaluate Transaction").
  • Results returned by transactions (console output like "*** Result").

Smart Contract

The smart contract (in folder chaincode-xyz) implements the following functions to support the application:

  • CreateAsset
  • ReadAsset
  • UpdateAsset
  • DeleteAsset
  • TransferAsset

Note that the asset transfer implemented by the smart contract is a simplified scenario, without ownership validation, meant only to demonstrate how to invoke transactions.

Running the sample

The Fabric test network is used to deploy and run this sample. Follow these steps in order:

  1. Create the test network and a channel (from the test-network folder).

    ./network.sh up createChannel -c mychannel -ca
    
  2. Deploy one of the smart contract implementations (from the test-network folder).

    # To deploy the  chaincode implementation
    ./network.sh deployCC -ccn basic -ccp ../asset-transfer-basic/chaincode-javascript/ -ccl javascript
    
  3. Run the application (from the asset-transfer-basic folder).

    # To run the Typescript sample application
    cd application-gateway-typescript
    npm install
    npm start
    
    # To run the Go sample application
    cd application-gateway-go
    go run .
    
    # To run the Java sample application
    cd application-gateway-java
    ./gradlew run
    

Clean up

When you are finished, you can bring down the test network (from the test-network folder). The command will remove all the nodes of the test network, and delete any ledger data that you created.

./network.sh down

About

Hyperledger Fabric Asset-Transfer-Basic-Application deploys Hyperledger Fabric 2.5 with Node.js SDK and React.js. It showcases asset CRUD operations and transaction demonstrations with simplified asset transfer in a no-ownership-verification context.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published