Option to create channel from Composer - hyperledger-composer

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.

Related

Building Action Based Messaging Extension using Bot Framework and without ngrock

What is the best way to build Teams messaging extension using the bot framework without ngrock. My organization is not even allowing me to use it for testing or development. My web search pointed me to Azure Service Bus, Azure Relay and a dedicated NGINX Linux server with public IP. Just wanted to know what would be the ideal way and the costs associated it if someone has already developed an app?

Custom REST API in spring boot for creating Peers, Orderer, Channels etc in Hyperledger Fabric

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

Azure webapp bot deployed to Application Service Environment

Did anyone deploy Azue Web App Bot using Application Service Environment?
are there any key considerations to be noted? I know we have ASE ILB and ASE External;
Is it possible to host multiple azure webapp bots in one ASE; my question is primarily due to the default lockdown of internet traffice in ASE ILB model and what type of firewall exceptions we will need to ensure
functinally the communication to Azure Bot Service/ Directline happen smoothly.
It is possible to host multiple azure web app bots in one ASE. However, care should be taken on how to have the bot dynamically looks up the pipe name as there a multiple bots inside the same ASE. Also, the normal DirectLine or other channels would require a lot of whitelisting to allow traffic into the ILB, and bot services IPs can change so it would be difficult to maintain long term.
'Test in WebChat' is not expected to work within an ILB ASE. It calls out to the DirectLine channel and causes the channel to send a call to the bot's messaging endpoint. In most ASE or VNET scenarios that call will be blocked, but since we don't have static IP addresses so the customer can't whitelist the incoming calls, either. Other than that, Directline channel and Direct Line App Service Extension(DL ASE) should typically work as expected from within an ILB ASE setup. If you are implementing additional features such as OAuth or SSO, then you will need to add a rule to enable service tags for AzureAD.
For more info on DL ASE, please refer to https://learn.microsoft.com/en-us/azure/bot-service/bot-service-channel-directline-extension?view=azure-bot-service-4.0

Can we create multiple instance of hyperledger composer rest server for same business network?

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

Could Hyperledger composer handle more than one CA (MSP)?

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.

Resources