How to check blockchain in Hyperledger Composer - hyperledger-composer

I'm try to learn a Hyperledger Composer.
now, Hyperledger Composer's sample test is working.
How to check blockchain in Hyperledger Composer?, have a some visual tool?

Composer is a development framework and suite of tools that is oriented towards accelerating the ability to write blockchain applications as a developer primarily. It simplifies and expedites the creation of blockchain applications. If you're new to Blockchain, Hyperledger Fabric or Hyperledger Composer, we recommend that you start with the tutorials like the Developer tutorial at the Hyperledger Composer website.
The present Hyperledger Explorer (shows blocks as they're added etc) is being updated to work with v1 of Hyperledger Fabric I understand https://github.com/hyperledger/blockchain-explorer
You therefore don't use composer tools or APIs to get a list of blocks - you need Fabric SDK REST APIs for that. This can help you -> https://github.com/hyperledger/fabric-sdk-rest - some parts are work in progress. But the salient point is the chaincode ID is the business network ID, where deployed Composer business networks are concerned. eg.
$ docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9982c1c7e84b dev-peer0.org1.example.com-vehicle-lifecycle-network-0.11.3 "chaincode -peer.a. " etc etc

You can see every step what composer is doing in the logs. Command is => "docker logs ". you will get container name using "docker ps -a" command(orderer plays an important role).

Related

How to deploy Laravel 8 google cloud run with google cloud database

Iam looking for help to containerize a laravel application with docker, running it locally and make it deployable to gcloud Run, connected to a gcloud database.
My application is an API, build with laravel, and so far i have just used the docker-compose/sail package, that comes with laravel 8, in the development.
Here is what i want to achieve:
Laravel app running on gcloud Run.
Database in gcloud, Mysql, PostgreSQL or SQL server. (prefer Mysql).
Enviroment stored in gcloud.
My problem is can find any info if or how to use/rewrite the docker-composer file i laravel 8, create a Dockerfile or cloudbuild file, and build it for gcloud.
Maybe i could add something like this in a cloudbuild.yml file:
#cloudbuild.yml
steps:
# running docker-compose
- name: 'docker/compose:1.26.2'
args: ['up', '-d']
Any help/guidanceis is appreciated.
As mentioned in the comments to this question you can check this video that explains how you can use docker-composer, laravel to deploy an app to Cloud Run with a step-by-step tutorial.
As per database connection to said app, the Connecting from Cloud Run (fully managed) to Cloud SQL documentation is quite complete on that matter and for secret management I found this article that explains how to implement secret manager into Cloud Run.
I know this answer is basically just links to the documentation and articles, but I believe all the information you need to implement your app into Cloud Run is in those.

How is Hyperledger Composer REST server being updated after changing the blockchain model?

I followed the instructions https://ibm-blockchain.github.io/interacting/
I saw the APIs on Hyperledger Composer REST server.
I then updated the model, script and ACL. The Deployment was successful, but the APIs were still the same, so I ran this script again - no change:
./create/create_composer-rest-server.sh --business-network-card admin#perishable-network

Is it possible to access a GO lang chaincode from Hyperledger Composer script file

This might seem like a weird question . But i want to know if it is possible to access a GO language chaincode installed in the peers from Composer script file .
That is in script.js file of the BNA file is it possible to access the GO Lang chaincode installed in the peers from Hyperledger Fabric side .
I want to invoke a chaincode 'mycc' from the script.js file and try to call 'mycc' functions from Composer
Any suggestions?
Also an example would be good . Thanks !
It is possible to invoke another chaincode from a Composer transaction script. You would need to use the getNativeAPI() function. It is introduced in the Composer documentation halfway down in this document where I think the example uses the native api to access the 'current' network (chaincode).
There is an additional example in this tutorial where the getNativeAPI().invokeChaincode method is used to connect to a different Business Network.
I have not seen other examples, but this should work for connecting to other chaincodes.

hyperledger composer existing network install

composer version v0.19.10
Fabric version 1.1
21 nodes:
3 CLI
3 CA
3 orders
3 www
3 api
6 peers
channel name: common
My fabric network is up and running and I can commit a transaction. But I am trying to add composer playground into the mix. If I try a default install it fails because it wants to use composerchannel. My question is. Is there an way to install composer to an existing fabric deployment.
The Composer Playground uses Business Connection Cards that it finds on your local file system. By default these are under a folder under your home folder e.g. ~/.composer (Maybe you have created a standard PeerAdmin card for a standard 1 peer Development Fabric? )
If you have already connected to the Fabric with Composer, you will have some cards that you already use to commit a transaction. If you have separate machines you can use composer card export on the original machine and composer card import on the machine running Playground.
If you have not connected to the Fabric yet using Composer you might like to look at the Composer Tutorial for MultiOrg which goes through creating cards to connect Composer to the Fabric - it is not your exact scenario, but should provide enough information for you to move forward.
To answer the channel question, one of the files in the "Card" is a connection.json file and in that file the channel to use is specified. (By default composer uses a channel called composerchannel)

Can we create Business Network Card using already created fabric identity from database?

We have implement blockchain application using fabric + fabric java sdk. Currently, We are storing fabric identity(private key + certificate) in off-chain database. Now, We are considering to migrate application using Hyperledger Composer.
As we already have created fabric identity into database, Can we create Business Network Card at runtime using private key and certificate from database?
Assuming your users were created with the Fabric CA - then yes there is a specific Hyperledger Composer CLI command to do just what you want. The command is composer identity bind. The command is documented here and here. But unfortunately the documentation and examples are incomplete. (I will follow up to get them corrected.)
On the composer identity bind command itself you need to add the -e certfilename parameter, and after that you need to use composer card create ... to create a Business Network Card for the user.

Resources