I am developing a nodejs client for a business network. I install the network version 100 . after I make some changes I redeployed it however the changes did not effect at least the nodejs client still logs it is connected to version 100. I increment the version 101 restart the nodejs still got 100 in the log.
what is the procedure to update the network?
deploy command
composer network deploy -a network.bna -p hlfv1 -i PeerAdmin -s anything
oepn connection
this.bizNetworkConnection.connect(this.CONNECTION_PROFILE_NAME, this.businessNetworkIdentifier, participantId, participantPwd)
log network identifier
LOG.info('KYC:', 'businessNetworkDefinition obtained', this.businessNetworkDefinition.getIdentifier());
I think you need composer network update to update the version of an already deployed network.
Related
We're thinking about migration from Hyperledger Composer v0.13.0 to the latest one (v0.16.5), so I have tried to create and deploy business network according tutorial below.
https://hyperledger.github.io/composer/latest/tutorials/developer-tutorial
But at the Step 4, composer runtime install command doesn't work.
Here is the error occured.
✖ Installing runtime for business network <<MY_BUSINESS_NETWORK>>. This may take a minute...
Error: Error trying to ping. Error: Error trying to query business network. Error: could not find chaincode with name '<<MY_BUSINESS_NETWORK>>' - make sure the chaincode <<MY_BUSINESS_NETWORK>> has been successfully instantiated and try again
Command failed
But I'm not sure where instantiation should be done.
I guess that composer runtime install and composer network start are counterparts of composer network deploy in v0.13.0, but is it wrong? In v0.13.0, I didn't need to execute "instantiate" command explicitly.
I would appreciate any suggestions or information, thanks.
My procedure
1. prepare credentials,channenl-artifacts and connection profile then start dockers.
2. create channel and make peers joined.
3. create BNA & card Files.
4. import the card of PeerAdmin then confirm with composer card list command.
5. execute composer install runtime command.
Environment
Ubuntu : 16.04
hyperledger composer : 0.16.5
ibmblockchain/fabric-tools 1.0.5
ibmblockchain/fabric-ca 1.0.5
ibmblockchain/fabric-peer 1.0.5
ibmblockchain/fabric-orderer 1.0.5
ibmblockchain/fabric-couchdb 1.0.5
the runtime install and network start (as you correctly understood) are two separate tasks that are likely to be performed by a Peer administrator and a network administrator (two separate roles) and hence why they are broken out - demarcation of duty. network deploy is deprecated from old days.
On tutorial - I suggest to do a 'teardown' from the fabric-tools directory and clear out your $HOME/.composer cards directory. I assume you downloaded a new fabric tools afresh? Did you also make sure to update your pre-requisites if/as required per the documentation https://hyperledger.github.io/composer/latest/installing/installing-prereqs.html
The error you posted related to << MY_BUSINESS NETWORK >> I assume, is because you've obfuscated the real network name - understandable) otherwise is an unusual error and not the name given in the tutorial - if you follow the tutorial it should deployed as follows (ie cut and paste from tutorial):
runtime install:
composer runtime install --card PeerAdmin#hlfv1 --businessNetworkName tutorial-network
network start:
composer network start --card PeerAdmin#hlfv1 --networkAdmin admin --networkAdminEnrollSecret adminpw --archiveFile tutorial-network#0.0.1.bna --file networkadmin.card
https://hyperledger.github.io/composer/latest/tutorials/developer-tutorial.html and this has been working fine for ages.
Are you trying to build your own Fabric network, single-org or multi-org, on same virtual host or across different physical/virtual machines ? Because the Fabric Dev server setup provided by Composer does 1 and 2 for you. You can also create the PeerAdmin card for that, as instructed in our docs (run a script).
Based on your procedure I would add first:
Do a teardown and remove old cards (as mentioned above)
do your steps 1 and 2 (and then create your Fabric network if that's what you want to do)
After your [custom] Fabric is up and running:
step 3. Test your custom Fabric Network to validate the configuration using the Fabric marbles sample chaincode. If that works, proceed to build your own PeerAdmin card
step 4. deploy the Business network by installing Composer runtime on all peers first then doing a network start of the bna on the channel you configured
step 5. Create Composer BN cards, connection profiles, identities and participants etc
I'm developing a POC over IBM HyperLedger Blockchain. I have a business network developed and deployed in IBM Cloud. I can generate a working local API REST, but cannot make it work on cloud, on the deployed IP.
I'm following this guide:
https://ibm-blockchain.github.io/interacting/
You just have to execute the following command:
./create/create_composer-rest-server.sh --business-network-card MY_BIZNET_CARD_NAME
But it doesn't deploy anything, and get the following (more related to kubernetes than blockchain).
Preparing yaml file for create composer-rest-server
Creating composer-rest-server pod
Running: kubectl create -f /Users/sm/jsblock/ibm-container-service/cs-offerings/scripts/../kube-configs/composer-rest-server.yaml
The connection to the server localhost:8080 was refused - did you specify the right host or port?
the server doesn't have a resource type "svc"
Creating composer-rest-server service
Running: kubectl create -f /Users/sm/jsblock/ibm-container-service/cs-offerings/scripts/../kube-configs/composer-rest-server-services-free.yaml
The connection to the server localhost:8080 was refused - did you specify the right host or port?
Composer rest server created successfully
Any ideas? Thanks too much.
You need to ensure you have a correct kube config setup. Step 10 in https://ibm-blockchain.github.io/setup/ provides the details to set up KUBECONFIG as the error suggests that either it is not configured or not configured correctly.
The document you refer to https://ibm-blockchain.github.io/interacting/ is being updated and should be available soon.
When you run the command ./create/create_composer-rest-server.sh --business-network-card MY_BIZNET_CARD_NAME - should be the name of the Network Admin for the network you deployed, NOT the PeerAdmin card so it will be something like ./create/create_composer-rest-server.sh --business-network-card admin#perishable-network
Look like it's an issue of acceess control. You should make sure again you are running with Local Admin configuration.it will help you to run queries
I am trying follow the steps of Composer Playground tutorial for local version of the playground and using local fabric peer.
I have done prescribed sequence of steps: downloadFabric.sh, startFabric.sh, createPeerAdminCard.sh. Once I bring up the playground, I can see network card PeerAdmin#hlfv1 showing no business network attached to it.
Then I click on Deploy a New Business Network, and select "vehicles-lifecycle-network" example. The dialog looks similar to the one in tutorial, but it has additional fields asking for credentials for network administrator, and I am not sure what to put there.
I tried copying in key and certificate that were generated by createPeerAdminCard script, and I also tried using ID and Secret option putting in PeerAdmin or PeerAdmin#hlfv1. I found this answer which indicates that it does not matter what secret you specify as the user is already imported into the keystore -- not sure if it is relevant. It certainly did not make any difference.
When I click deploy, the new network seems to appear in the composer dashboard. However, if I click on "Connect Now", a popup shows "Error trying to login and get user context" and [[{"code":400,"message":"Authorization Failure"}]].
It seems I am missing something very basic, but cannot really figure it out on my own.
Edit:
Simple steps to reproduce (assuming basic-sample-network.bna is available locally):
> composer runtime install -c PeerAdmin#hlfv1 -n basic-sample-network
> composer network start -a <path to basic-sample-network.bna> -A admin -c PeerAdmin#hlfv1 -C <path to PeerAdmin certificate> -f admin.card
> composer card import -f admin.card
> composer network ping -c admin#basic-sample-network
Last command produces the same error as above in the console.
Edit 2:
If I open up ~/.composer/cards/PeerAdmin#hlfv1/metadata.json and add "businessNetwork":"basic-sample-network" parameter, I am able to do composer network ping -c PeerAdmin#hlfv1 successfully, and also can connect to the network from the Playground -- this will do as a workaround for now. However, I must be doing something wrong with the way I create new network and its admin card.
The Playground Tutorial assumes that you are connecting to an Online Hosted Playground hosted on IBM Cloud (Bluemix). For the Online Playground the underlying Fabric is 'Web' - i.e. the Fabric is stored only in the local browser. This document may help explain the different Fabric Runtimes: Typical Solution Architecture
The Local Playground gives you the additional option of deploying a Business Network to an hlfv1 Fabric, using the PeerAdmin card that you created with the createPeerAdmin.sh script.
After creating the PeerAdmin card you should be able to start Playground locally with the composer-playground command and you should be able to deploy a Business Network. In this development scenario the Credentials for the Network Administrator should be Id and Secret specifying admin / adminpw. There is no need to run CLI commands prior to starting local playground. (createPeerAdminCard.sh is not a CLI command but is a Dev environment setup script - and it should be run.)
If you want to go down the CLI route please see the Developer Tutorial
I have a business network which has deployed no problem in the past, now when I try to deploy using the command
composer network deploy -a test.bna -i PeerAdmin -s adminpw -p hlfv1
I get
Deploying business network from archive: test.bna
Business network definition:
Identifier: test#0.0.1
Description: Test Network
✖ Deploying business network definition. This may take a minute...
Error: error trying deploy. Error: Failed to deserialize creator
identity, err MSP Org1MSP is unknown
Command failed
what is the problem ?
This error could be the result of a problem to create the channel and join the peer to the channel.
If you followed the hyperledger composer guides and downloaded the hyperledger fabric development server then you must ensure you have a version of docker equal or greater to version 17.03. The channel will fail to be created on older versions of docker.
It seems also a problem related to the connection profile and the new changes on identities. Check https://hyperledger.github.io/composer/business-network/bnd-deploy.html and Trying to deploy a business network onto hyperledger fabric 1.0 beta fails to install chaincode
Installed playground with the steps from:
Using playground locally
Trying for 2 days now to get the composer-rest-server starting.
Steps done:
Changed all the ca/peer/orderer urls from "localhost" to their specific docker IPs in the ~/.composer-connection-profiles/hlfv1/connection.json, otherwise i just get a connection timeout when starting the composer-rest-server
Deployed the "digitalproperty-network" with composer
Got myself a new identity via composer and the secret
Now when i run:
> composer-rest-server -p hlfv1 -n digitalproperty-network -i baderth -s omgDBCimVAbB -N always
Im just getting:
Discovering types from business network definition ...
Error: failed to obtain cds for digitalproperty-network - transaction
not found digitalproperty-network/mychannel
at /usr/lib/node_modules/composer-rest-server/node_modules/fabric-client/node_modules/grpc/src/node/src/client.js:434:17 code: 2, metadata: Metadata { _internal_repr: {} } }
Same error also shown in the latest file in the /logs directory.
I have no clue what "transaction not found digitalproperty-network/mychannel" means and what i should provide the rest server with if not the digitalproperty-network, which i deployed.
You should follow the install instructions for setting up a Development Environment, and then the Developer Guide:
https://hyperledger.github.io/composer/installing/development-tools.html
https://hyperledger.github.io/composer/tutorials/developer-guide.html