Add Org or peer in Org dynamically in Hyperledger fabric - blockchain

I am using http://hyperledger-fabric-doc.readthedocs.io/en/latest/getting_started.html for Hyperledger Fabric setup in Ubuntu VM. As per tutorial (fabric-samples/first-network) which have two organizations with two peers have been created. I wanted to add new organization or new peer in already existing Organization dynamically. Kindly help me know the steps to add dynamically.

It isn't to the point of being "dynamic" just yet. However, the reconfiguration is done using the configtxlator tool to read the genesis block and modify it's contents, then submit it as a new transaction that updates the network/channel configuration. Please see the tutorial on configtxlator here.

New version i.e the testing version of hrperledger fabric v1.1-preview gives this feature of adding new org dynamically. Main role in this is of configtxlator, jq and configtxgen. They have given fabric-samples/first-network new example which fo this work. Download the pdf of hyperledger fabric and go to chaper 11 i.e page 59 https://media.readthedocs.org/pdf/hyperledger-fabric/latest/hyperledger-fabric.pdf you will get good documentation of how it is done. Hope this helped you.

IBM has a step-by-step guide showing in details how to use configxlator, as adding a new Org section in config JSON is not so trivial and there are additional steps, such as signing the update config block.

Related

How to properly deploy and use fabcar example chaincode written in node.js to AWS managed blockchain?

I followed the steps from Steps to deploy AWS NGO chaincode
and instead of NGO chaincode I tried fabcar node.js chaincode from fabric samples. But I'm facing error during instantiation. I saw that the basic format of chaincodes are different but will that really cause any hindrance in the flow ?
I want to know if this will work and if not how can I use fabcar javascript chaincode on AWS blockchain.
This is the error I'm facing while instantiation
Please guide me. Thank you.
I have created a documentation (step by step) to setup the Blockchain network and deploy the chaincode using the AWS Managed Blockchain.
https://github.com/sjais789/AWS_Managed_Bockchain_Setup
If you are stuck somewhere feel free to comment it here.
The fabcar example has fabric-contract-api. The peers in amazon managed blockchain neither have that dependency pre-installed nor it has internet connection to download the dependency. This is a huge problem. They've suggested to bundle the dependencies before instantiating it but haven't shown any way to do that.
However, there is a way out of this. Instead of using the usual fabcar example for javascript, if you use fabcar javascript-low-level chaincode, that does not make use of the fabric-contract-api, then you'll be able to use the chaincode in aws managed blockchain.

User creation in Hyperledger fabric 1.0

I am new to Hyperledger fabric and blockchain.I am trying to build a simple application as part of a POC and completed the Getting Started tutorial for building the first network. I am very confused about user creation and assigning roles for a specific organization. As I understand, I need to use the docker-compose-e2e.yaml, which starts a fabric-ca container to create a public key (certificate) and a private key . Could someone please provide me some instruction or point me to the documentation, on how to create a user, assign a role in an org, get the private and public key, install it on a blockchain network and use it in a chaincode.
Strongly advise that you read and follow the Build Your First Network tutorial in its entirety.
In that tutorial, the users and orgs are created via a configuration file (crypto-config.yaml) which feed the cryptogen command to generate the required key material for orgs and users, etc. This is suitable for a static deployment.
Use of fabric-ca to generate certificates for users etc that can be added via the SDKs is a bit more advanced topic. There's a tutorial in the Fabric CA User's Guide. This also requires that the MSP used in the fabric network be the Fabric-CA, not the default MSP, which uses the file-based config.

How to add a new peer to an existing Hyperledger Fabric network?

When you create a hyperledger fabric network, you define organizations, orderers and peers in crypto-config.yaml and configtx.yaml.
But how do you add a new organization or a new peer to an existing organization in a network that is already setup? Run cryptogen and configtxgen pointing to config files that contain only the new organizations/peers? Re-generate everything?
The whole point of using cryptogen is to help user to settle the crypto material for peer and organizations defined in the crypto-config.yaml file. However one can simply leverage openssl to generate keys and certificates of organization root CA, next generate user certificates and arrange them into the folder similar to what cryptogen is producing and startup your network. Therefore adding a new peer will stand up to simply generating a new set of keys and certificate signed by the root CA. Finally you can simply start new peer and join it to the channel by providing genesis block, which could be fetched from ordering service.
Now, the configtxgen tool helps you to configure your Hyperledger Fabric network it terms of which organizations will form a consortium and will have rights to join the channel. Extending this configuration is a bit more involved process than simply adding a new peer, in order to complete you will have to leverage the configtxlator tool, more details and example of how to use it you can find in the following tutorial. In high level, you will have to read current channel configuration, parse it into the json format, update with new participants, compute the delta and generate configuration update transaction and the last step is to submit the update to the ordering service so it will take effect. Once you will accomplished config update you will be able to add new peers from new organization to the channel.
You can achieve this by generating the crypto material (using cryptogen extends) for the new peer, spawning the new peer and joining that peer to the existing channel on the network to sync-up.
You can find the complete guide at
Extending Hyperledger Fabric Network: Adding a new peer

Sample application of Hyperledger Fabric Node SDK

If somebody has link of sample-app/sample-web-app of Hyperledger Fabric Node SDK, please post it. It is said in official document that they have sample-app here and sample-web-app here but the urls are empty
There are few examples on fabric-sample repository in particular you probably would like to consider taking look on balance transfer example here. Which provides decent example of application developed based on NodeJS SDK and covers major parts.

How to load a snapshot in Jazz source control?

So Jazz source control lets you snapshot a repository workspace.
But how would I load a particular snapshot of a workspace on the command line? Doesn't seem like a lot of point to a snapshot if I can't load the project as it was at that point in time...?
ed... I have found a 'new... repository workspace from snapshot' in the RAD plugin... now to find how to do the same on the command line...
1) Take a look at scm help create workspace. You should see a --snapshot argument that will create a new workspace from the given snapshot.
2) See scm help load.
A snapshot is just a list of version identifiers. A repository workspace is what contains the content.
So you are actually asking two questions, which may help to clarify your search.
1) How do I create a new repository workspace from a snapshot via the command line
and
2) How do I load an existing repository workspace to my local filesystem via the command line
I would suggest asking your question on the http://jazz.net forums in the Rational Team Concert section. The development team is very responsive in answering questions and will be able to give you an answer that is accurate for the build that you are running.