All Projects → ksachdeva → hyperledger-fabric-example

ksachdeva / hyperledger-fabric-example

Licence: Apache-2.0 License
An example project to support blog posts on Bootstrapping a Hyperleder Fabric network

Programming Languages

typescript
32286 projects
go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to hyperledger-fabric-example

Fabric Gateway Java
Hyperledger Fabric Gateway SDK for Java https://wiki.hyperledger.org/display/fabric
Stars: ✭ 122 (+771.43%)
Mutual labels:  fabric, hyperledger
hyperledger-fabric-sdk-php
Client SDK for Hyperledger Fabric for use in PHP applications
Stars: ✭ 40 (+185.71%)
Mutual labels:  fabric, hyperledger
Hyperledger Fabric Gm
支持国密加密算法的Hyperledger Fabric版本
Stars: ✭ 152 (+985.71%)
Mutual labels:  fabric, hyperledger
Fabric Sdk Java
Stars: ✭ 982 (+6914.29%)
Mutual labels:  fabric, hyperledger
byzantine-browser
KHS Blockchain Browser
Stars: ✭ 19 (+35.71%)
Mutual labels:  fabric, hyperledger
Mortgageblockchainfabric
Mortgage Processing App using Hyperledger Fabric Blockchain. Uses channels for privacy and access, and restricts read/write previleges through endorsement policies
Stars: ✭ 45 (+221.43%)
Mutual labels:  fabric, hyperledger
SmartContractTrading-wFabric1-4-VSCodeExt
Learn now to create a smart contract with VSCode
Stars: ✭ 27 (+92.86%)
Mutual labels:  fabric, hyperledger
Fabric
Hyperledger Fabric is an enterprise-grade permissioned distributed ledger framework for developing solutions and applications. Its modular and versatile design satisfies a broad range of industry use cases. It offers a unique approach to consensus that enables performance at scale while preserving privacy.
Stars: ✭ 12,911 (+92121.43%)
Mutual labels:  fabric, hyperledger
hyperledger-fabric-graphql-boilerplate
Hyperledger Fabric GraphQL Boilerplate
Stars: ✭ 44 (+214.29%)
Mutual labels:  fabric, hyperledger
fabric
这是基于fabric 1.4.1 版本国密改造项目
Stars: ✭ 62 (+342.86%)
Mutual labels:  fabric, hyperledger
Fabric Sdk Node
Hyperledger Fabric SDK for Node https://wiki.hyperledger.org/display/fabric
Stars: ✭ 676 (+4728.57%)
Mutual labels:  fabric, hyperledger
hlf-operator
Hyperledger Fabric Kubernetes operator - Hyperledger Fabric operator for Kubernetes (v2.2+)
Stars: ✭ 112 (+700%)
Mutual labels:  fabric, hyperledger
Fabric Sdk Py
Hyperledger Fabric Python SDK
Stars: ✭ 303 (+2064.29%)
Mutual labels:  fabric, hyperledger
Fabric Explorer
Fabric-explorer is a simple, powerful, maintainable, open source fabric explorer
Stars: ✭ 117 (+735.71%)
Mutual labels:  fabric, hyperledger
Fabric Starter
Starter Application and Deployment Scripts for Hyperledger Fabric
Stars: ✭ 202 (+1342.86%)
Mutual labels:  fabric, hyperledger
bdk
Streamlined blockchain deployment kit for Hyperledger Fabric.
Stars: ✭ 43 (+207.14%)
Mutual labels:  fabric, hyperledger
delphi-fabric
Focusing on study fabric capability
Stars: ✭ 23 (+64.29%)
Mutual labels:  fabric, hyperledger
office-fabric
johannes-z.github.io/office-fabric/
Stars: ✭ 12 (-14.29%)
Mutual labels:  fabric
Rug
Extension Mod for gnembon's fabric-carpet with some more features
Stars: ✭ 20 (+42.86%)
Mutual labels:  fabric
VeinMiner
Minecraft Bukkit/Spigot/Paper plugin with Fabric client side mod. Mine multiple blocks of the same type in quick succession.
Stars: ✭ 67 (+378.57%)
Mutual labels:  fabric

Pre-requisites

Make sure following tools/runtimes are installed

Install

# Fetch the Hyperledger Farbic tools and docker images
curl -sSL https://goo.gl/iX9dek | bash
# Install typescript & ts-node (globally)
npm install -g ts-node typescript
# Install the dependencies of this project
npm install

Help

To see what are the commands that are available issue:

npm run info

Should see response similar to:

> [email protected] info /Users/ksachdeva/Desktop/Dev/projects/myoss/hyperledger-fabric-example
> npm-scripts-info

info:
  List available script
start-orderer:
  Start the orderer container
stop-orderer:
  Stop the orderer container
start-containers:
  Starts all containers
stop-containers:
  Stops the containers
create-channel:
  Create the Channel
join-channel:
  Join Peers to the channel
install-chaincode:
  Install the chaincode on the peers
instantiate-chaincode:
  Instantiate the chaincode for the channel
invoke-transaction:
  Invoke a transaction
query-chaincode:
  Query the chaincode

Generating the crypto material for all the organizations

See Bootstrapping the Hyperledger Fabric Network (Part 1)

# You will find `cryptogen` in the `bin` folder created in the directory in which you
# executed `curl -sSL https://goo.gl/iX9dek | bash`
cryptogen generate --config=./crypto-config.yaml

Generating the Orderer genesis block

See Bootstrapping the Hyperledger Fabric Network (Part 2)

# You will find `configtxgen` in the `bin` folder created in the directory in which you
# executed `curl -sSL https://goo.gl/iX9dek | bash`
#
# Also make sure to set the FABRIC_CFG_PATH environment variable (it is required by configtxgen tool)
#
export FABRIC_CFG_PATH=$PWD
configtxgen -profile ThreeOrgsOrdererGenesis -outputBlock ./genesis.block

You can directly use the docker-compose command as specified in the blog post or using the command that I have hooked up in the package.json. The npm command also deletes 'production' folder so that every time your start the orderer node it starts with clean content.

npm run start-orderer

Similarly to stop the orderer containers simply issue

npm run stop-orderer

Generating the channel configuration transaction

See Bootstrapping the Hyperledger Fabric Network (Part 3)

configtxgen -profile ThreeOrgsChannel -outputCreateChannelTx ./ksachdeva-exp-channel-1.tx -channelID ksachdeva-exp-channel-1

Creating the new channel

See Bootstrapping the Hyperledger Fabric Network (Part 4)

npm run create-channel

Make Peers join the new channel

See Bootstrapping the Hyperledger Fabric Network (Part 5)

# Stop already running orderer containers
npm run stop-containers
# This will start both orderer & peer containers
npm run start-containers
# Create the channel again as when we start-containers we remove the previous data from the containers
npm run create-channel
# Join the channel
npm run join-channel

Install and instantiate the chaincode

See Bootstrapping the Hyperledger Fabric Network (Part 6)

npm run install-chaincode
npm run instantiate-chaincode

Invoke the transaction & Query the chaincode

See Invoking a transaction on Hyperledger Fabric Network

npm run query-chaincode
npm run invoke-transaction
npm run query-chaincode
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].