What is purpose of "CORE_PEER_CHAINCODELISTENADDRESS" environment variable? - hyperledger-fabric

In core.yaml
for peer we can define env. variable as chaincodelistenaddress (CORE_PEER_CHAINCODELISTENADDRESS).
what is purpose of this environment variable ?
Can we use this variable for instead of DEV mode ?
Currently I am trying to deploy network on Openshift platform. In this case when I set variable as CORE_PEER_CHAINCODELISTENADDRESS : peer01.local.com:7051 as same as CORE_PEER_ADDRESS :peer01.local.com:7051
it gives me error as address already bind while starting peer container.
If i assign different port CORE_PEER_CHAINCODELISTENADDRESS : peer01.local.com:7052
it gives me error as can not assign address peer01.local.com:7052.

This refers to the endpoint that the peer would listen to with regarding for the chaincode service.
Yes, you can use the variable when using dev-mode.
With regarding the errors - please specify your fabric version as things have changed slightly in the master branch.
In v1.0.0 (release branch), you can make your chaincode bind to the same port as the peer.
Also - please upload your core.yaml and the peer log for further information.
Alternatively you can seek advice in the fabric channel in https://chat.hyperledger.org/channel/fabric

Related

Minifabric problem with apiserver and fabric 2.2.1 error join on the channel in multihost configuration

I had created a custom network with my organizations and my peers running 100% on a host with which I was interfacing via an ApiServer based on this: https://kctheservant.medium.com/rework-an-implementation-of-api-server-for-hyperledger-fabric-network-fabric-v2-2-a747884ce3dc The problem is when I switched to using networking on 2 hosts using docker swarm. When I join the channel from the second host I get the error: "unable to contact the endpoint". So I switched to using "minifabri" which promises easy use, and in fact the network is customized in a short time, even there it gave me an error when joining the channel of the second host, solved by setting the variable EXPOSE_ENDPOINT = true. The problem is that now nmon I can no longer get my apiserver to work, what I did is (as indicated in the Readme) replace the contents of the "main.js" file with my server code and run the "apprun" command. This gives me an error if I leave the server listening on a port, while it is successful if I comment out the last 2 lines of the code. The problem is that I don't have how to query the server if I don't have a listening port. Summarizing my questions are:
how can I create an api server done like that on minifabric?
alternatively how can I solve the problem on the Fabric base (I can't find an EXPOSE_ENDPOINT variable to set), probably the problem will be the same as the one I had on minifabric. Thanks to those who will help me.

How does Fabric cli get ip of peer/orderer in the example of byfn?

Could any body tell me how the cli knows the IPs of other peers and orders just according to the Host in the configtx.yaml?
When does the DNS information generated?
Can anybody also tell me some more information about the configuration below "CORE_VM_ENDPOINT=unix:///host/var/run/docker.sock"?
When you run fabric example, it always refer default credentials or already confirugred fabric configuration.
For example, if you use basic fabric example, you will run [your directory]/fabric-dev-servers/startFabric.sh
this file refer already configured information. One of them is connection profile. If you look at createPeerAdmin.sh file, you can find DevServer_connection.json. This file contains connection information for the fabric network.
As you are using byfn.sh, you can add the host ip address using "extra_hosts" in docker-compose.yaml file.
As there is no definition about this, it will use localhost as default.
https://medium.com/1950labs/setup-hyperledger-fabric-in-multiple-physical-machines-d8f3710ed9b4
like this,
extra_hosts:
- "peer0.org1.example.com:192.168.1.10"
- "ca.org1.example.com:192.168.1.15"
- "peer0.org2.example.com:192.168.1.20"
- "ca.org2.example.com:192.168.1.25"

Is there Some Good document or article to get info on how to identify Hyper ledger Peers IP dynamically

As of now I have used confix tx generator to generate config material of muliple peers and have changed the createPeerAdmin card to include the IP address of all Peer nodes so that connection.json file produced contains the IP address of all the peer nodes in my network , Is there a way in which i can add 1 more peer node and it could be connected with my already running network.
Yes, there is.
You should read about service discovery feature.
There are client side APIs in the SDKs you can use to utilize this feature and have the peers be selected dynamically.

Not able to create hyperledger fabric network using cello

I started cello and i am able to open user dashboard on 8081 but not the operator dashboard (I checked the port and found docker-proxy named service is running). Now on user dashboard i am trying to create a new network. But it's throwing error Apply Chain myorg fail. I have attached the screenshot. . I checked the post request reponse and it shows {"success":false,"message":"System maintenance, please try again later!"}
The Cello system is suggested to be deployed on multiple servers, at least 1 Master Node + 1 Worker Node.
Make sure that you have done installation of worker
http://hyperledger-cello.readthedocs.io/en/latest/installation_worker_docker/
Then make sure you added worker hosts in operator dashboard and chains are active.
http://localhost:8080/view/hosts (Add hosts)
http://localhost:8080/view/clusters?type=active (Check chains active or not)
For more information on cello installation refer: Hyperledger Cello Installation

What's the semantics of ETCD_PEER_KEY_FILE in cloud-config

An etcd instance can have multiple peers. According to the CoreOS doc I can configure a parameter ETCD_PEER_KEY_FILE=/path/to/peers.key. If I interpret this parameter according to its name, I can put the private keys of a peer (or more peer_s_) in that file. What's the rational behind this? Can someone explain, what this parameter really means (didn't find any documentation).
Got it. Documentation is here
--cert-file=<path>: Certificate used for SSL/TLS connections to etcd.
--peer-cert-file=<path>: Certificate used for SSL/TLS connections between peers. This will be used both for listening on the peer address as well as sending requests to other peers.

Resources