m Fabric Concepts 2
see Concepts 1 here m Hyperledger Fabric Solution Concepts
This page extends the first
Key Points
- The Fabric documentation ( see References below ) is the right place to learn blockchain concepts and details on building and deploying Fabric blockchain solutions
- Hyperledger Fabric is open-source software framework, tools and runtime for permissioned blockchains ( eg NOT Bitcoin )
- Node server applications can call Fabric smart contracts ( aka chaincode ) using the Nodejs Fabric SDK. SDKs for other languages exist.
- Fabric smart contracts can be written in languages like Nodejs, GO, Java.
- Fabric blockchain ledgers have 2 parts: an immutable "chain of blocks ( of transactions )" in the file system and a database ( CouchDb ) with current entity state
- The Fabric runtime is different than our cloud applications in many ways
- The Fabric runtime is different than other blockchain frameworks in it's consensus models to deliver better performance
- Fabric runs in Docker containers on Linux instances
- An overview on DMX University is here for Hyperledger resources
References
Reference_description_with_linked_URLs___________________________________ | Notes__________________________________________________________ |
---|---|
Fabric-notes-v2. link | gdoc |
Blockchain basics: permissionless vs permissioned | |
Nuances Between Permissionless and Permissioned Blockchains Anant Kadiyala | |
ebook-getting-started-with-enterprise-blockchain_46025046USEN.pdf | IBM ebook Enterprise Blockchains - 2019 |
Hyperledger Fabric concepts | |
Hyperledger concepts | Hyperledger, A Greenhouse for Blockchain Projects Hyperledger hosts and incubates multiple technology projects, all advancing business blockchain frameworks and modules through open source collaboration. |
Hyperledger Project and Fabric Resources https://wiki.hyperledger.org/display/HYP/Calendar+of+Public+Meetings https://wiki.hyperledger.org/display/HYP/Working+Groups https://wiki.hyperledger.org/display/HYP/Special+Interest+Groups https://wiki.hyperledger.org/display/fabric/Hyperledger+Fabric https://wiki.hyperledger.org/display/fabric/Design+Documents https://wiki.hyperledger.org/display/fabric/Playbacks https://jira.hyperledger.org/secure/Dashboard.jspa?selectPageId=10104 https://wiki.hyperledger.org/display/fabric/Hyperledger+Fabric+Chaintool | Main Projects Site page Wiki page for all Hyperledger projects Hyperledger Project public meeting calendar ( a few meetings forget to add to this calendar ) Hyperledger working groups SIGS - Special Interest Groups page - industry and social groups Fabric project wiki home page Fabric design documents Fabric playbacks for design reviews - docs and recordings JIRA - Fabric feature roadmap - create account, login, query any tickets, related docs in Fabric Fabric chaintool information page - compile, test, package, deploy File lists for some community calls and recordings - Fabric Dev and ? |
book-menu-HANDSON_BLOCKCHAIN_WITH_HYPERLEDGER.pdf Fabric Basic Blockchain Introduction https://hyperledger-fabric.readthedocs.io/en/latest/whatis.html | The "Hands-on Blockchain with Hyperledger" book is out of date on Fabric technical topics since it was built on version 1.1 primarily. Most of the concept and design ideas are still valid Recommend using the current Fabric documentation ( readthedocs.io/en/lastest ) pages to get current info that is normally more accurate |
https://bmos299-fabric.readthedocs.io/en/latest/protocol-spec.html | OLD - 3rd party copy of Fabric docs |
https://hyperledger.github.io/fabric-rfcs/rfcs.html | Fabric RFCs for major new features after v1x |
Fabric Key Concepts https://hyperledger-fabric.readthedocs.io/en/latest/key_concepts.html | |
fabric-private-data-collections-2019-14489867.pptx | Fabric private data collections pptx |
Fabric - What's New https://hyperledger-fabric.readthedocs.io/en/latest/whatsnew.html# | |
https://wiki.hyperledger.org/display/fabric/Fabric+Interop+Working+Group | Provide standard interfaces for separate Fabric networks to connect, create and join channels, install and run chaincode and smart contracts. Feature works in v1.4x and later networks |
Hyperledger Fabric Developer docs | |
Fabric - Getting Started https://hyperledger-fabric.readthedocs.io/en/latest/getting_started.html | |
Fabric - Developing Applications https://hyperledger-fabric.readthedocs.io/en/latest/developapps/ developing_applications.html | |
Fabric - Tutorials https://hyperledger-fabric.readthedocs.io/en/latest/tutorials.html | |
Fabric - Smart Contracts ( Chaincode ) - a Developer's View https://hyperledger-fabric.readthedocs.io/en/latest/chaincode4ade.html | |
Fabric - Smart Contracts ( Chaincode ) - an Operator's View https://hyperledger-fabric.readthedocs.io/en/latest/chaincode4noah.html | |
Fabric - CouchDb - the ledger database https://hyperledger-fabric.readthedocs.io/en/latest/couchdb_tutorial.html | |
Fabric - Operations Guides https://hyperledger-fabric.readthedocs.io/en/latest/ops_guide.html | |
Fabric - Command Reference https://hyperledger-fabric.readthedocs.io/en/latest/command_ref.html | |
Fabric - Architecture Reference https://hyperledger-fabric.readthedocs.io/en/latest/architecture.html | |
Fabric - Glossary https://hyperledger-fabric.readthedocs.io/en/latest/glossary.html | |
Fabric Feature Youtube Videos ( 19 )
| The Fabric team adds videos to this youtube channel as new features come out |
Github Fabric repositoriesyp https://github.com/hyperledger/fabric | |
Hyperledger Wiki https://wiki.hyperledger.org/ | |
Hyperledger Design Documents https://wiki.hyperledger.org/display/fabric/Design+Documents | Team design docs for a Hyperledger Feature |
Hyperledger Design Feature playbacks | Architects present, review online new Fabric features in Zoom here. |
< more pages are added all the time from the Fabric doc team > | more on governance, administration, policies etc |
Hyperledger Training Materials Group site https://wiki.hyperledger.org/display/LMDWG | How to work on Fabric training materials https://gist.github.com/tkuhrt/10211ae0a26a91a8c030d00344f7d11b |
Hyperledger Training Materials Resources | presentations etc free for reuse |
https://medium.com/beyondi/tagged/hyperledger | Articles and Tutorials on medium.com about Hyperledger Fabric |
https://github.com/mahoney1/animaltracking | Tutorial - animaltracking app from Paul Mahoney |
Minifabric admin tool ** | very good clear, easy to learn |
Hyperledger Fabric Deployment and Administration | |
https://www.hyperledger.org/resources/training/hyperledger-fabric-certification | The Fabric administration course ( still in beta with content upgrades needed before it can be used as a training or certification vehicle ) |
Github materials | Good intro to Fabric deployment on Kubernetes |
Fabric samples and projects | |
https://github.com/hyperledger/fabric-samples | Commercial Paper app - v1x |
Commercial Paper Advanced app - v2x | |
https://github.com/mahoney/docs/blob/animaltracking-tutorial.md | Animal Tracking app |
https://github.com/IBM-Blockchain/vehicle-manufacture | Vehicle Manufacture app |
Books and articles, papers | |
IBM Hands-on Blockchain with Hyperledger ( v1.1 ) https://www.packtpub.com/big-data-and-business-intelligence/hands-blockchain-hyperledger the table of contents is here: https://drive.google.com/open?id=1nK6OSD0tnekaKYHeypHCegk-Alk5-ZZU | $5.00 for a pdf version from packtpub Good conceptual detail from start to finish well explained. |
IBM Blockchain for Business ( 2019 ) https://books.google.com/books?id=DuCGDwAAQBAJ https://drive.google.com/open?id=19_R9yWJFO9wwo6x4tHl39i6wmjIyX32K | Focuses on the business of blockchain by abstracting out the technology very nicely Introduction to Blockchain |
Hyperledger Fabric - Whitepaper by the Fabric team | Very good on concepts but not current with any of the new features after v1.2 |
https://www.ibm.com/blogs/blockchain/2019/04/does-hyperledger-fabric-perform-at-scale/? | Fabric performance results - v1.4.1 - show Kafka, Raft |
https://keyholesoftware.com/2020/01/09/video-where-blockchain-fits-into-enterprise-development/ | Hyperledger Fabric overview and integration with Dapps Keyhole software video from 2018 |
blockchain-for-dummies-d-3rd-ibm-limited-edtion_83025383USEN.pdf | Blockchain for Dummies ebook 2020 |
External Courses | |
EDX Blockchain for Business certification program https://www.edx.org/professional-certificate/linuxfoundationx-blockchain-for-business | This program combines both certificate courses below into 1 program saving $20 |
EDX-LFS171 Blockchain: Understanding it's Uses and Implications https://www.edx.org/course/understanding-blockchain-and-its-implications | $99 for student certification |
EDX-LFS170 Blockchain for Business: Introduction to Hyperledger https://www.edx.org/course/blockchain-for-business-an-introduction-to-hyperledger-technologies | $99 for student certification |
Other resources | |
https://drive.google.com/drive/u/0/folders/1S32QkWng-rfJGox4gr7pnn2Di0f0mefr | Old Fabric v1.1 presentation - Jim Mason |
https://marketplace.visualstudio.com/items?itemName=IBMBlockchain.ibm-blockchain-platform https://marketplace.visualstudio.com/items?itemName=HyperledgerComposer.composer-support-client | VSCode editor extensions for Hyperledger Composer and IBM Blockchain ( Fabric ) |
Fabric Documentation team resources | |
https://hyperledger-fabric.readthedocs.io/en/latest/ | |
https://jira.hyperledger.org/browse/FAB-8171 | Orderers conceptual design doc |
https://jira.hyperledger.org/browse/FAB-12874 | FAB-12874 Develop Apps: Smart Contract topic |
https://gerrit.hyperledger.org/r/#/c/28958/ | Gerrit change ticket for FAB-12874 |
https://gerrit.hyperledger.org/r/#/c/28958/2..1/docs/source/developapps/diagrams.pptx | Latest pptx file from the change ticket |
JIRA query https://jira.hyperledger.org/issues/?jql=project%20%3D%20FAB%20AND%20issuetype% 20in%20(Story%2C%20Task)%20AND%20fixVersion%20%3D%20v2.0.0%20AND%20% 22Epic%20Link%22%20is%20not%20EMPTY%20AND%20project%20in%20(10002)%20 AND%20issuetype%20in%20(%2210002%22%2C%20%2210001%22)%20AND%20cf %5B10006%5D%20%3D%20FAB-14524%20AND%20status%20%3D%20Backlog | Jira query for these parms .. project = FAB AND issuetype in (Story, Task) AND fixVersion = v2.0.0 AND "Epic Link" is not EMPTY AND project in (10002) AND issuetype in ("10002", "10001") AND cf[10006] = FAB-14524 AND status = Backlog |
Fabric releases | |
https://www.hyperledger.org/blog/2020/07/20/new-release-hyperledger-fabric-2-2-lts | Fabric v2.2 LTS summary |
Key Concepts
Hyperledger Fabric Features Summary
Fabric Concepts
- EVM and Fabric fit different use cases well
- Cryto world has LOW volumes
- Tether is 25 B per day, USDC < 3 B per day .. down from there
- Traditional world has HIGH volumes, HIGH value, private, secure transactions
Why Fabric?
- proven, industrial strength, permissioned DLT platform
- number 1 permissioned DLT platform running today
- supports higher volume use cases
- security
- software and hardware security support ( HSM etc )
- cryptographic libraries are NIST FIPS 140.3 compliant
- privacy
- on-chain, off-chain controls for pii
- more customization capabilities based on architecture than other platforms generally
permissioned DLT references
- No 1 permissioned blockchain in production use today ( see Blockchain 50 history )
- Very complex solution usage: Supply Chain, Healthcare, Trade Fiance, Climate Change
- Allianz Bank - loan network
- TYS - Trust Your Supplier - manage confidential information on companies, individuals
- TradeWaltz - digital automation for global trade
- CIRCULOR - battery traceability solution
- Change Healthcare - medical records managmeent
- GSBN - Shipment Management, Trade Finance
- Blockrails - secure payments
- Swift - POC for DvP on Trade Finance
- IBM Food Trust - food chain traceability & logistics
- Farm to Plate - food chain Trade Finace
- Honeywell - aircraft parts suppy chain management
- Estonia - secure patient health records
- Covd vaccine tracking in NYC
Fabric architecture features
- built-in smart contract governance
- ledger management with purge & archive built in
- multiple consensus methods: RAFT, BFT .. add more
- flexible consensus policies at the contract level
- flexible network architecture
- multiple smart contract languages: GO, JAVA, NODEJS .. more Python
- multi-tenant support for organizations mapped to nodes
- flexible access models: api gateway, network level
- interfaces for features with default implementations allows custom services
- transaction life cycle - execute, order, commit
- flexible certificate management: built-in Certificate Authority or external
- flexible membership management: built-in MSP or external service ( eg LDAP or ? )
- Solidity contract execution
Fabric and Hyperledger ecosystem
- strong community of organizations
- strong Hypledger projects set for delivery, integration and operations
- Firefly, Caliper, Explorer, Cello, Cacti, Yui, Ursa, Aries, Burrow EVM,
- integrations
- Firefly supernode connects multiple blockchain networks easily
- cacti, yui
- Fabric api gateway for easy Web 3 api integrations
- k8s operator for easy Fabric network management in Kubernetes environments
- Token SDK framework: supports ERC 20, 721, 1155 token types
- https://www.youtube.com/watch?v=Bs2EJbEK4_E&t=5s
- Account based wallets support - https://hyperledger.github.io/fabric-sdk-node/
- iot integrations: MOBI, Nodered and more
Fabric roadmap directions
- expanded interface sets for more custom services
- more architecture flexibility to scale 10X for high volumme use cases
- updates on security frameworks
- more 3rd party frameworks to automate smart contract development
- more flexible scenarios for purge, archive
- continued support of NIST approved cryptographic libraries: ECDS, Quantum etc
Compare Fabric and EVM networks
- Hyperledger applications tend to be more centralized than Ethereum applications, but they are much faster with flexible smart contract governance. On the other hand, Ethereum applications are decentralized but they tend to be slower. In conclusion, Hyperledger and Ethereum are both secure and immutable blockchain platforms that fit different use cases well ( Private, permissioned networks vs Public, permissioned networks).
- DTCC SHOULD use both. Besu for integration to many external EVM solutions and Fabric for internal networks and related external networks
- https://www.linkedin.com/pulse/hyperledger-vs-ethereum-whats-difference-ashwini-sharma#:~:text=Hyperledger%20applications%20tend%20to%20be,secure%20and%20immutable%20blockchain%20platforms.
Fabric - related resources
- Case Studies: https://www.youtube.com/redirect?event=video_description&redir_token=QUFFLUhqbE4zaXR6SC1hY3ItZklncXl4WFlWc1hTSHZUZ3xBQ3Jtc0tuTC15MFdLUTJxTmM1Nk9ndlVMWmJpMC1FeFZ2dl9nVFM0UHRqc1k4elRPLVo1Vmc4OFFCSERYUWRJVWs3T1E4TkxBTEMzS3JCclBfYXQ2Y1NJcV92LTJ1OFluOHQ3aXRGdWN5NE15bmxGTzlPbFV2TQ&q=https%3A%2F%2Fwww.hyperledger.org%2Flearn%2Fcase-studies&v=Bs2EJbEK4_E
- Training & Certification: https://www.hyperledger.org/learn/tra...
- Tutorials: https://www.hyperledger.org/use/tutor...
- Webinars: https://www.hyperledger.org/learn/web...
- Events: https://www.hyperledger.org/events
- Vendor Directory: https://www.hyperledger.org/use/vendo...
Fabric Consensus Method for Ordering Service
Chaincode transactions will be ordered according to the channel configuration setup for the ordering service, meaning there is no way of changing consensus on the fly.
Addressing the three ideas:
- Two orderer organizations in the same channel will share the same ordering rules, as they are part of the same ordering service.
- Not possible for the reasons I outlined above.
- You may have two channels that follow two different ordering protocols (Raft and BFT for v3.0.0-preview) as long as they are served by different orderers. The orderer runtime will run only one of the protocols after initial setup. That would also mean that your chaincode logic would be separate in two channels (two chaincodes) and that information would be registered in separate ledgers.
Value Chain Network Model
- For Fabric technology, ( see above references )
- Businesses operate in networks, formal or informal, with customers, suppliers and competitors
- Business networks can be:
- connected
network connected ( Internet, email etc ) - integrated
business processes interfacing ( traditional ETL or REST apis ) - coordinated
well defined business methods and roles between customers, competitors, vendors
smart contracts standardize business transactions enforcing business rules
transactions digitally signed by identified parties
data is shared real-time over the network with privacy rules enforced
governance and audit requirements are simpler, lower cost to meet
- connected
- Where is your organization on the VCN scale?
- If businesses can see improved results in the coordinated model, blockchain is often the answer
Fabric Network Interoperability Model
The Interop Group has defined standard interfaces for separate Fabric networks to connect, create and join channels, install and run chaincode and smart contracts.
The Interop Definition Feature works in v1.4x and later networks
https://wiki.hyperledger.org/display/fabric/Fabric+Interop+Working+Group
This working group was formed to promote the interoperability of Hyperledger Fabric network services. The primary goal of this working group is to ensure Fabric services provided by different vendors can work with each other with the following specific requirements:
- Peers from a new organization can join a running fabric network, that is, a peer from a new organization can eventually participate in an existing channel to receive and respond Fabric blockchain transaction requests
- A client application can perform Fabric SDK provided API calls against any of the peers and orderers to perform the following Fabric operations:
- Channel create
- Channel join
- Chaincode install (in golang or nodejs)
- Chaincode instantiate
- Chaincode invoke/query
To test the compliance of each service from a vendor, an new or existing orderering service shall be used. The orderering services should at least satisfy the following requirements:
- Kafka based orderering service
- TLS on
The Interop Test Network that is running now
https://wiki.hyperledger.org/display/fabric/Interop+Test
Fabric v3x coming in 2024
With Fabric v3.0, Hyperledger Fabric is continuing its leadership in the Enterprise Permissioned Blockchain / DLT space as secure, adaptable, high performance, easy to use platform supporting a variety of smart contract language options: GO, Java, Javascript etc. It offers configuration options on services other platforms often don't. Fabric can interoperate with other blockchains as needed using API integrations to any service or the blockchain connectors ( Hyperledger Cacti and YUI ). There is good documentation and training to get started on Fabric ( https://lnkd.in/etqVcPx5 ). If you need enterprise quality, trusted transaction solutions Fabric is a great base to build from.
If you look at driving up quality and lowering time to market and costs for development, definitely take Hyperledger Firefly (.https://lnkd.in/eXne_Zsg ) for a test drive. It is a well architected services platform for enterprise blockchains that can integrate multiple blockchains well ( Fabric, Ethereum, etc ), supporting Web 3 standards, flexible interfaces and code generation for the API services layer. Teams I've worked with love using it. Kaleido offers a variety of enterprise extensions as well for Firefly ( https://lnkd.in/erdhvcbJ ).
I see 2024 continuing the expansion of use cases where Fabric and Firefly deliver higher value for trusted computing solutions for digital assets and digital transformation projects in any industry
Fabric on Kubernetes
Fabric Multi-tenancy Concepts for v2x
Implementing Multitenancy on Hyperledger Fabric using Kubernetes
In Hyperledger Fabric 2.0, chain code script components are embedded within Docker containers which then have to be installed on each and every peer on the network. Docker swarms or Kubernetes(details below) are then used to deploy these components on the Fabric network.
Deploying and managing multitenant Blockchain architectures for concurrent access is quite a herculean and challenging task. Here as well, Kubernetes are used to achieve multitenancy on Hyperledger Fabric for managing multiple Blockchains.
a single Hyperledger Fabric based system is required to serve multiple tenants simultaneously for processing concurrent execution of transactions.
Multi-tenancy features required
Data Isolation & Privacy
Achieving multitenancy on Hyperledger Fabric demands complete data isolation. The platform has to be built in such a way that one tenant should not be allowed to access other tenant’s data, thus maintaining complete data privacy.
System Performance for tenant workload separation
Performance of all tenants should be irrespective of each other’s workload. One tenant should not be affected due to higher workloads of other tenants, therefore maintaining enhanced system performance. Scalability by tenant
Kubernetes has multiple advantages that makes it the perfect platform for achieving multitenancy on Hyperledger Fabric. Let us see why.
1) Kubernetes enables auto-scaling as well as deployment of multi-container applications.
2) Kubernetes helps your system achieve high availability (HA) round the clock.
3) Kubernetes is a fool-proof platform that is well equipped with container management including deploying, scaling and executing containers of the Hyperledger Fabric.
4) To achieve multitenancy on Hyperledger Fabric, Kubernetes enables the execution of multiple, isolated Fabric instances.
5) Kubernetes balances overload and offers amazing fault-tolerance attributes, which can help ease complicated processes, subsequently reducing cost overheads.
6) Kubernetes not only provides an excellent platform to implement multitenancy on Hyperledger Fabric, but also helps build an application that maintains data integrity, scalability, high performance and cost efficiency.
Potential Value Opportunities
Fabric Blockchains can add value for applications and platforms that link different organizations on agreed business processes.
Potential impacts and improvements include:
- Immutable, historical transaction records
- data shared real-time across organizations
- permissioned membership services for KYC and enterprise applications
- smart contracts that enforce business process rules and data access controls
- transaction events to automate business workflows
- trust among participants with signed transactions using digital identities
- data visibility options ( shared and private )
- personal identity visibility options
- governance and audit options to fit specific needs
Dave Enyeart's 2021 Fabric Roadmap
https://wiki.hyperledger.org/display/fabric/Fabric+Strategic+Priorities+-+2021+discussion
Potential Challenges
Designing effective blockchain solutions can be different than other solutions
- Need to identify the organization types, roles, use cases and impacts for all members in the network
Building blockchain applications can be different
- Client applications invoke remote, distributed Smart contracts running on each node that hosts the blockchain
- Smart contracts perform write or read only transactions ( no updates allowed )
Running blockchain applications is different
- Blockchain applications run on a shared, distributed network on Linux instances using containers, a consensus protocol and a distributed rpc for transaction synchronization
Private Data Management Challenges
again you are bypassing the question, to be honest I am quiet frustrated now.
the community is not about defending a stance but to find a solution to on going problems, and if something is wrong (which happens frequently in any open source project) we may need to discuss and consider another approach. the current questions about private data listed from various people are listed here:
Security issues
1) hashes put on chain don't have salt added to it, which is vulnerable to dictionary attack (solved)
Methodology issues
1) hashes on chain cannot be validated by any third party, so they can be used by adversaries to trick honest participants (open)
2) private data use gossip to transact data, which would require all participants be connected with any other participant part of a chain. if there are 20 participants in a channel, each participant must open up their firewalls to all other 19 participants of a single channel (open)
Engineering issues:
1) when using k8s and behind load-balancers or proxies, users do not even get a chance to use a shared port (in the aforementioned example, each participant can't even open firewalls to 19 other participants without extensive hacking, and I assumed all participants need to deployed these hacked code to make it work. (discussed)
Private Data Management Features
Use Case Analysis
Candidate Solutions
Hyperledger meetup - Run Solidity contracts on Hyperledger Fabric - 2022 - Jim Sullivan
https://www.youtube.com/watch?v=vXYTqKMb5zs
Hyperledger Fabric Open Source Documentation and Training Materials
Fabric latest stable release
The Hyperledger Fabric maintainers are pleased to announce the availability of Fabric v1.4.2!
v1.4.2 delivers the next set of patches and fixes on the Fabric 1.4 long-term support (LTS) release.
v1.4.2 also delivers Kafka to Raft migration capability for the ordering service. The Raft-based ordering service is simpler to operate since it requires no dependencies external to the orderer nodes. It also enables the ordering service to be provided by different organizations across different data centers. For these reasons we expect Raft to become the preferred ordering service choice for production Fabric networks.
Please see the release notes for additional improvements and suggestions:
https://github.com/hyperledger/fabric/releases/tag/v1.4.2
Download instructions:
https://hyperledger-fabric.readthedocs.io/en/release-1.4/install.html
And for more information on Raft, see the What's New documentation and Raft documentation:
https://hyperledger-fabric.readthedocs.io/en/release-1.4/whatsnew.html#raft-ordering-service
https://hyperledger-fabric.readthedocs.io/en/release-1.4/orderer/ordering_service.html#raft
Fabric Tips
Fabric peers get blocks from orderer directly
issue:
peers run out of memory trying to get many very large blocks from other peers using grpc
solution:
configure peers to pull blocks from orderers directly rather than through normal replication if peer count is low
configuration for peers to pull blocks from orderer
We have found that unless there are a large number of peers in an organization, it is more efficient to have peers pull blocks directly from orderer nodes, by using this configuration:
CORE_PEER_GOSSIP_USELEADERELECTION = false
CORE_PEER_GOSSIP_ORGLEADER = true
CORE_PEER_GOSSIP_STATE_ENABLED = false
If there are a large number of channels or large block sizes, reduce the size of these configurations from default of 100 to improve memory usage (the latter setting is not needed if CORE_PEER_GOSSIP_STATE_ENABLED is false):
CORE_PEER_GOSSIP_MAXBLOCKCOUNTTOSTORE = 10
CORE_PEER_GOSSIP_STATE_BLOCKBUFFERSIZE = 10
And if the block sizes are so large that you risk hitting grpc 100MB limit, reduce this setting (again, not needed if CORE_PEER_GOSSIP_STATE_ENABLED is false):
CORE_PEER_GOSSIP_STATE_BATCHSIZE = 10
The CORE_PEER_GOSSIP_STATE_* settings were added in Fabric v1.4.1 and above.
I've opened a Jira to improve the defaults and guidance in v2.0, we can continue discussion there: https://jira.hyperledger.org/browse/FAB-16435
Control block size limits
Also, you can limit the size of blocks by configuring the block cutting parameters on your channels:
https://github.com/hyperledger/fabric/blob/release-1.4/sampleconfig/configtx.yaml#L258-L293
Thanks,
Dave Enyeart
gRpc - gossip rpc usage
gossip block too large
Looks like you are hitting a grpc limit of 100MB. Are you testing with artificially large blocks or is this a real size requirement?
The failure is during gossip state transfer of blocks. You could disable gossip block dissemination and have each peer receive blocks from an orderer node instead, using these environment variables for the peer:
CORE_PEER_GOSSIP_USELEADERELECTION = false
CORE_PEER_GOSSIP_ORGLEADER = true
CORE_PEER_GOSSIP_STATE_ENABLED = false
Dave Enyeart
Fabric Testing
MiniFabric - Local Fabric app testing
https://github.com/litong01/minifabric
https://wiki.hyperledger.org/display/labs/Minifab
If you like to learn Hyperledger Fabric or develop your smart contract, or just want to get a feel about Hyperledger Fabric, Minifabric is the tool to get you started. Minifabric can stand up a Fabric network on a small machine like a VirtualBox VM but also can deploy Fabric networks cross multiple production grade servers. Minifabric is small but it allows you to experience the full capabilities of Hyperledger Fabric. You will be able to try all Fabric operations such as channel create, channel join, chaincode install, approve, instantiation. It also supports channel update, private data collection, block query etc. All you need to start with is a docker (18.03 or newer) environment. Minifabric works on both OS X and Linux. Windows support is in the works. If you like to read more before jumping in, please read Minifabric User Guide. For those impatient, please follow the steps below to start things off.
Get the script and make it executable
mkdir -p ~/mywork && cd ~/mywork && curl -o minifab -sL https://tinyurl.com/twrt8zv && chmod +x minifab
Stand up a fabric network:
./minifab up
Tear down the fabric network when you do not need it any more:
./minifab down
MiniFabric - doc features
https://github.com/litong01/minifabric/blob/master/docs/README.md
This tool helps Fabric users working with fabric network. It currently provides the following functions:
- Deploy a fabric network based on this spec or your own spec
- Tear down the deployed fabric network
- Create channel
- Join peers to a channel
- Install sample chaincode or your own chaincode
- Upgrade chaincode
- Approve and instantiate chaincode
- Invoke chaincode methods
- Query blocks and transactions
- Channel configuration query, configuration signing and configuration update
- Private data collection support
- Generate connection profiles and wallet files for fabric go/python sdks and vscode extensions
Prerequsites
This tool requires docker CE 18.03 or newer.
MiniFabricDash
https://github.com/litong01/minifabdash
minifabric dashboard project
To develop
build development image
./build.sh dev
run the application in dev mode
./start.sh dev
To use
build production image
./build.sh
run the application in production mode
./start.sh
Minifabric Logging options
Jim,
The log entries will be always in this format:
Date and time - <Status> - <json object>
For example:
Sep 30 2020 16:23:20 - OK - {"msg": "Query results: ./vars/mychannel_newest_txs.json", "_ansible_verbose_always": true, "_ansible_no_log": false, "changed": false}
Fabric mock-testing for chaincode
https://github.com/wearetheledger/fabric-mock-stub
A Nodejs module that helps you to test your Hyperledger Fabric Nodejs chaincode. When it proves itself, we will be adding this package to the official Gerrit of the Fabric Nodejs SDK.
🚨 Note
Due to the complexity, key endorsement policies introduced in v1.4 are currently not being enforced.
Table of contents
Version matching
Fabric node SDK | Mock stub |
---|---|
v1.4.X | v4.X.X |
v1.3.X | v3.X.X |
v1.2.X | v2.X.X |
V1.1.X | v1.3.X |
Installation
yarn add @theledger/fabric-mock-stub --dev
Fabric Admin Test tips
Fabric docker command examples
https://medium.com/@rsripathi781/docker-cheat-sheet-for-hyperledger-fabric-128e89f2f36b
Docker Cheat Sheet for Hyperledger Fabric.pdf
docker ps -a
2. Check logs of containers — You might need them to check logs of peer / orderer when you invoke/query chaincodes , joining peer to channels etc..
docker logs containerid
3. Get into docker container — You may need to go into container to explore volumes which you might mounted during container creation. You can get hold of blocks being routed by orderer or explore the ledger stored in peer.
docker exec -it containerid bash
4.Get into Fabric CLI — If you had defined CLI in docker-compose , then this command can take you to the specified peer.
docker exec -it cli bash
5. Restart Container
docker restart containerid
6. Run all services defined in docker-compose
docker-compose -f yourdockercompose.yaml up -d
7. Run specific service defined in docker-compose
docker-compose -f yourdockercompose.yaml up -d servicename
8. Tear down container volumes
docker-compose -f yourdockercompose.yaml down — volumes
9.Force remove all running containers
docker rm -f $(docker ps -aq)
10. Remove all images which where utilized by containers
docker rmi -f $(docker images -q )
11. Remove images which where utilized by containers with like search
docker rmi -f $(docker images dev-* -q)
dev-* — Remove all images which has container name starting with dev
Step-by-step guide for Example
sample code block