I have a fabric network with two organizations with its individual MSP hence 2 MSP. Each organization manages 1 peer, I want to create a channel and have the peer of each Org to join this channel, would composer be able to handle two MSP? The createComposerProfile.sh is able to create multiple peers but not multiple MSP. How do I create a composer profile to associate the different MSP for the individual peer?
With hyperledger composer, a connection profile represents a connection from one organisation to a specific channel where a business network has been deployed. Each organisation in a multi-organisation fabric topology will have connection profiles representive of their individual MSP. An organisation may also have more than one connection profile as well, for example one to perform composer runtime installations, one to transact on a business network and even one to query a business network.
createComposerProfile.sh creates a connection profile for the developer server provided by hyperledger composer and only creates a reference to the single peer defined by that developer server.
Related
I have created a basic network in HLF
Single Orderer
2 Organization, has 2 peers each
Channel: finance
Now, If I wanted to add one more peer or create any other channel. I have to add the configuration in the crypto-config.yaml and configtxgen.yaml and execute peer and channel-related commands in the cli as per my understanding.
QUESTION
Is there any way that, I can create any REST API in spring boot to create the above process?
SDK's available for adding peer's organization
Check this golang : link
Also there are different SDK for java, node.js.
Yes, but if you want to add a new organization or a new peer, you must use the fabric-SDK for those operations; this channel configuration updates will be the responsibility of an organization admin.
The SDK also provides a client for Hyperledger's certificate authority.
FABRIC SDK:
fabric-sdk-node doc: https://hyperledger.github.io/fabric-sdk-node/
fabric-sdk-node: https://github.com/hyperledger/fabric-sdk-node/
fabric-sdk-java: https://github.com/hyperledger/fabric-sdk-java
fabric-sdk-go: https://github.com/hyperledger/fabric-sdk-go
Is there any option to create a channel dynamically via Composer ??
This is similar to creating channels via SDK code. I am unable to find the documents in the composer tutorial site.
(Edited rsp:) I fully endorse what david_k above has written firstly. The methodgetNativeAPI() in Composer client, enables access to the Fabric client API from composer-client after connecting to an existing business network. That is, Composer client APIs (admin connection and business network connection specifically) offer access to the underlying Fabric client API: eg. calling client API method to read channel info : getChannel :
const bnc = new BusinessNetworkConnection();
await bnc.connect('admin #sample-network');
const fc = bnc.getNativeAPI();
const channel = fc.getChannel('defaultchannel');
const info = await channel.queryInfo();
console.log('block height', info.height);
Composer is not about creating and managing a hyperledger fabric network. It is a business network framework that utilises a pre-defined fabric network and requires an already created channel, so will not provide these kinds of hyperledger fabric admin capabilities. As you correctly state the fabric node sdk provides the ability to provide that kind of administrative capability and so that is the API you should use to perform those kind of activities, such as creating channels, joining peers to channels or configuration updates.
As Paul states, it is possible to gain access to the underlying fabric node sdk client instance which it is currently using to interact with the fabric network, but that does require an already existing business network and as such interacting with the node sdk via this route may not be applicable.
I created sample blockchain network. How to allow another user connect to it and make transactions?
If you used the online playground then your network is stored under a "Web Browser" connection and your Business Network is run and stored only within your browser's local storage. However you could Export your network (definition only not data) and share the BNA file with another user who can then import it - but you have separate copies.
If you want to completely share with another user you will need to share an underlying Hyperledger Fabric - then both download and install Playground locally and share Business Network Cards to connect to the same Fabric.
To understand application architecture of composer rest server, I would like to understand following things.
Lets say, We have 4 peers of different organization. Now, What would be recommended approach in context of how we would be managing composer rest server.
1) Having one composer rest server per peer
2) Having one composer rest server per network and all peers will share composer rest server
3) Having one composer rest server per channel
firstly, just to confirm its called 'Hyperledger Composer' and 'Fabric Composer' was its old name from way back.
secondly, the answer is you would have one or more (think HA and availability) REST server instances per Composer business network, per Organisation that participates in that business network. It is also dependent on how each deploys REST server instances within their own infrastructure zones and somewhat dependent what user / user base will be authenticating to it (the likelihood is they would be authenticating their own users / REST clients to consume the REST server APIs - by whatever the chosen Passport strategy is, to authenticate in a multi-user environment - eg. LDAP OAuth2 etc. So, the REST server is not strictly tied to 'peers' per se. The peer information is defined in the connection profile info, in the business network card.
Composer business networks are deployed to a specific channel/ledger - and configured so in the business network cards that access it - the connection info specifies the channel, and the REST server instance is instantiated using an appropriate business network card.
See more on deploying your REST server here:
https://hyperledger.github.io/composer/integrating/deploying-the-rest-server.html
Can we define multiple orderers and ca in connection.json, so that if one orderer is down then client application will automatically connect with the another available orderer? And same with the case of CA server.
The node sdk for hyperledger fabric v1.0 has always supported adding multiple orderers in it's various pre-releases of v1.0 so the hyperledger composer connection profile has always supported being able to add multiple orderers. However with the release of rc1 the comments to the methods have been updated to say that only the first orderer in the list is used (which implies that for 1.0 the node sdk won't support multiple orderers for the v1.0 release) and as an implication of that hyperledger composer only supports a single orderer in it's connection profile (although multiple ones could be defined).
The connection profile also only supports defining a single CA. Hyperledger Composer doesn't provide any sort of concept of HA for the CA.