User Profile
selvaraman
Copper Contributor
Joined 5 years ago
User Widgets
Recent Discussions
How to setup hyperledger fabric explorer | Hyperledger Fabric consortium on Azure Kubernetes Service
I set up hyperledger fabric network by reading this document https://docs.microsoft.com/en-us/azure/blockchain/templates/hyperledger-fabric-consortium-azure-kubernetes-service. Network side everything worked properly. Now I wanted to set up hyperledger fabric explorer for this network. In order to do that, I did the follwing steps, 1. git clone https://github.com/hyperledger/blockchain-explorer.git 2. git checkout tags/v1.0.0-rc2 3. app/persistence/fabric/postgreSQL/db 4. ./createdb.sh 5. ./main.sh install 6. Replaced the connection profile (app/platform/fabric/connection-profile/first-network.json) like the following, { "certificateAuthorities": { "ca.xxxxxxxxxxxxx.eastus.aksapp.io": { "caName": "ca.org1", "tlsCACerts": { "pem": "-----BEGIN CERTIFICATE-----dfsajk-----END CERTIFICATE-----\n" }, "url": "grpcs://ca.xxxxxxxxxxxxx.eastus.aksapp.io:443" } }, "client": { "tlsEnable": true, "adminUser": "admin.org1", "adminPassword": "", "enableAuthentication": false, "connection": { "timeout": { "orderer": "300", "peer": { "endorser": "300" } } }, "organization": "org1" }, "channels": { "hrschannel": { "orderers": ["orderer1.yyyyyyyyyyyyyyyyyyyyy.eastus.aksapp.io"], "peers": { "peer1.xxxxxxxxxxxxx.eastus.aksapp.io": {} } } }, "name": "org1", "organizations": { "org1": { "certificateAuthorities": [ "org1CA" ], "mspid": "org1", "peers": [ "peer1.xxxxxxxxxxxxx.eastus.aksapp.io" ] } }, "peers": { "peer1.xxxxxxxxxxxxx.eastus.aksapp.io": { "grpcOptions": { "hostnameOverride": "peer1.xxxxxxxxxxxxx.eastus.aksapp.io", "ssl-target-name-override": "peer1.xxxxxxxxxxxxx.eastus.aksapp.io" }, "tlsCACerts": { "pem": "-----BEGIN CERTIFICATE-----jjdadjijfifawj-----END CERTIFICATE-----\n" }, "url": "grpcs://peer1.xxxxxxxxxxxxx.eastus.aksapp.io:443" } }, "version": "1.0.0", "wallet": "org1" } But I got the following error here tail -f logs/console/console-2020-07-08.log false 'ssl-certs' '/home/css/delete/blockchain-explorer/ssl-certs' ******* Initialization started for hyperledger fabric platform ******, { 'first-network': { name: 'first-network', profile: './connection-profile/first-network.json' } } client_configs.name first-network client_configs.profile ./connection-profile/first-network.json FabricUtils.createFabricClient config.client.tlsEnable true FabricConfig, this.config.channels hrschannel initializeChannelFromDiscover hrschannel FabricClient.discover_results endpoint { host: 'orderer1.1111111111111111111.eastus.aksapp.io', port: 443 } initializeChannelFromDiscover.discoveryProtocol grpcs requesturl grpcs://orderer1.1111111111111111111.eastus.aksapp.io:443 FabricClient.discover_results endpoint { host: 'orderer2.1111111111111111111.eastus.aksapp.io', port: 443 } initializeChannelFromDiscover.discoveryProtocol grpcs requesturl grpcs://orderer2.1111111111111111111.eastus.aksapp.io:443 FabricClient.discover_results endpoint { host: 'orderer3.1111111111111111111.eastus.aksapp.io', port: 443 } initializeChannelFromDiscover.discoveryProtocol grpcs requesturl grpcs://orderer3.1111111111111111111.eastus.aksapp.io:443 2020-07-08T16:15:30.879Z - error: [Remote.js]: Error: Failed to connect before the deadline URL:grpcs://localhost:443 FabricUtils.createDetachClient initializeListener, client_name, client first-network { name: 'first-network', profile: './connection-profile/first-network.json' } Please open web browser to access :http://localhost:8080/ pid is 13408 Sync process is started for the network : [first-network] and client : [first-network] config.client.tlsEnable true FabricConfig, this.config.channels hrschannel (node:13836) DeprecationWarning: grpc.load: Use the @grpc/proto-loader module with grpc.loadPackageDefinition instead An identity for the admin user: admin.org1 already exists in the wallet initializeChannelFromDiscover hrschannel FabricClient.discover_results endpoint { host: 'orderer1.1111111111111111111.eastus.aksapp.io', port: 443 } initializeChannelFromDiscover.discoveryProtocol grpcs requesturl grpcs://orderer1.1111111111111111111.eastus.aksapp.io:443 FabricClient.discover_results endpoint { host: 'orderer2.1111111111111111111.eastus.aksapp.io', port: 443 } initializeChannelFromDiscover.discoveryProtocol grpcs requesturl grpcs://orderer2.1111111111111111111.eastus.aksapp.io:443 FabricClient.discover_results endpoint { host: 'orderer3.1111111111111111111.eastus.aksapp.io', port: 443 } initializeChannelFromDiscover.discoveryProtocol grpcs requesturl grpcs://orderer3.1111111111111111111.eastus.aksapp.io:443 2020-07-08T16:15:37.490Z - error: [Remote.js]: Error: Failed to connect before the deadline URL:grpcs://localhost:443 SyncServices.synchNetworkConfigToDB client first-network channel_name hrschannel 2020-07-08T16:15:40.744Z - error: [Remote.js]: Error: Failed to connect before the deadline URL:grpcs://localhost:443 <<<<<<<<<<<<<<<<<<<<<<<<<< Synchronizer Error >>>>>>>>>>>>>>>>>>>>> Error: Orderer with name "orderer2.1111111111111111111.eastus.aksapp.io:443" not assigned to this channel at Channel.getOrderer (/home/css/delete/blockchain-explorer/node_modules/fabric-network/node_modules/fabric-client/lib/Channel.js:928:10) at FabricClient.switchOrderer (/home/css/delete/blockchain-explorer/app/platform/fabric/FabricClient.js:681:27) at FabricClient.getGenesisBlock (/home/css/delete/blockchain-explorer/app/platform/fabric/FabricClient.js:611:26) at <anonymous> at process._tickCallback (internal/process/next_tick.js:189:7) <<<<<<<<<<<<<<<<<<<<<<<<<< Closing client processor >>>>>>>>>>>>>>>>>>>>> req.body { user: 'admin', password: 'adminpw', network: 'first-network' } Network: first-network enableAuthentication false Please help me to fix this issue.1.7KViews0likes0CommentsHow to setup REST server to communicate with Hyperledger Fabric consortium on Azure Kubernetes Servi
I set up hyperledger fabric on Hyperledger Fabric consortium on Azure Kubernetes Service (AKS) . I have installed https://github.com/hyperledger/fabric-samples/blob/release-1.4/balance-transfer/artifacts/src/github.com/example_cc/go/example_cc.go on the network. I have tested peer invoke and peer query command on azure-cli. It is working properly. Now I want to communicate with this hyperledger network usinghttps://github.com/hyperledger/fabric-samples/tree/release-1.4/balance-transfer. Help me to set up this REST Server.1.3KViews0likes0CommentsHow to get storage account details | Hyperledger Fabric consortium on Azure Kubernetes Service
I am new to azure and AKS. I am facing the following problem. Help me to fix this. I have created new free account and did the following steps. For Orderer: Basics: subscription: Free Trial Resource Group: hlf Region: East US Resource Prefix: demo Fabric Settings: Organization name: OrdererOrg Fabric Network Component: Ordering Service Number of nodes: 3 Fabric CA username: ca1 Fabric CA password: ******* Certificates: Fabric CA self signed certificate AKS cluster settings: Kubernetes cluster name: demo-HLF-AKS Kubernetes version: default DNS prefix: demo-HLF-AKS-dns Node Size: 1x Standard DS2 v2 2 vcpus, 7 GB memory Node count: 1 Network Configruration: Basic "To manually create a service principal with the Azure CLI follow the documentation here" I clicked on here link. It takes me to https://docs.microsoft.com/en-us/azure/aks/kubernetes-service-principal#manually-create-a-service-principal I clicked on try it. After sigining in, It says no storgage mount. So I clicked on create storage. After that I got the following information. Subscription Id: #####-###-###-####-####### Resource group: cloud-shell-storage-centralindia Storage account: csg1..........a06f File share: cs-iiiii-p-nnnn-mmm-LLLLLLLLL I have used these information to set the following enviromnent variables in future(while building consortium). STORAGE_SUBSCRIPTION=<subscriptionId> STORAGE_RESOURCE_GROUP=<azureFileShareResourceGroup> STORAGE_ACCOUNT=<azureStorageAccountName> STORAGE_LOCATION=<azureStorageAccountLocation> STORAGE_FILE_SHARE=<azureFileShareName> And then I execute the following command in azure cli, az ad sp create-for-rbac --skip-assignment --name myAKSClusterServicePrincipal I got the following output, { "appId": "####-####-####-###-#####", "displayName": "myAKSClusterServicePrincipal", "name": "http://myAKSClusterServicePrincipal", "password": "******-*******-z", "tenant": "1111-11111-1111-1111-11111" } Here I used appId as Service principal client ID and password as Service principal client secret. For Peer: Basics: subscription: Free Trial Resource Group: hlfp Region: East US Resource Prefix: demop Fabric Settings: Organization name: Org1 Fabric Network Component: Peer Nodes Number of nodes: 1 World state database: CouchDB Fabric CA username: ca2 Fabric CA password: ******* Certificates: Fabric CA self signed certificate AKS cluster settings: Kubernetes cluster name: demop-HLF-AKS Kubernetes version: default DNS prefix: demop-HLF-AKS-dns Node Size: 1x Standard DS2 v2 2 vcpus, 7 GB memory Node count: 1 Network Configruration: Basic I have used same Service principal client ID and Service principal client secret which is used while creating Orderer. In azure-cli, I executed the following environment variables, ORDERER_ORG_SUBSCRIPTION="AAAAA-BBB-CCCC-DDDD-CCCCCCC" ORDERER_ORG_RESOURCE_GROUP="hlf" ORDERER_ORG_NAME="OrdererOrg" ORDERER_ADMIN_IDENTITY="admin.$ORDERER_ORG_NAME" CHANNEL_NAME="mychannel" PEER_ORG_SUBSCRIPTION="AAAAA-BBB-CCCC-DDDD-CCCCCCC" PEER_ORG_RESOURCE_GROUP="hlfp" PEER_ORG_NAME="Org1" PEER_ADMIN_IDENTITY="admin.$PEER_ORG_NAME" STORAGE_SUBSCRIPTION="AAAAA-BBB-CCCC-DDDD-CCCCCCC" STORAGE_RESOURCE_GROUP="cloud-shell-storage-centralindia" STORAGE_ACCOUNT="csg1..........a06f" STORAGE_LOCATION="eastus" STORAGE_FILE_SHARE="cs-iiiii-p-nnnn-mmm-LLLLLLLLL" I got these above information, when I click azure-cli 1st time. After this, I executed the following commands in azure-cli. sa@Azure:~/azhlfTool$ az account set --subscription $STORAGE_SUBSCRIPTION sa@Azure:~/azhlfTool$ az group create -l $STORAGE_LOCATION -n $STORAGE_RESOURCE_GROUP Invalid resource group location 'eastus'. The Resource group already exists in location 'centralindia'. sa@Azure:~/azhlfTool$ az storage account create -n $STORAGE_ACCOUNT -g $STORAGE_RESOURCE_GROUP -l $STORAGE_LOCATION --sku Standard_LRS The resource 'csg10032000cc3ca06f' already exists in location 'centralindia' in resource group 'cloud-shell-storage-centralindia'. A resourcewith the same name cannot be created in location 'eastus'. Please select a new resource name. sa@Azure:~/azhlfTool$ STORAGE_KEY=$(az storage account keys list --resource-group $STORAGE_RESOURCE_GROUP --account-name $STORAGE_ACCOUNT --query "[0].value" | tr -d '"') sa@Azure:~/azhlfTool$ az storage share create --account-name $STORAGE_ACCOUNT --account-key $STORAGE_KEY --name $STORAGE_FILE_SHARE { "created": false } sa@Azure:~/azhlfTool$ STORAGE_KEY=$(az storage account keys list --resource-group $STORAGE_RESOURCE_GROUP --account-name $STORAGE_ACCOUNT --query "[0].value" | tr -d '"') sa@Azure:~/azhlfTool$ SAS_TOKEN=$(az storage account generate-sas --account-key $STORAGE_KEY --account-name $STORAGE_ACCOUNT --expiry `date -u -d "1 day" '+%Y-%m-%dT%H:%MZ'` --https-only --permissions lruwd --resource-types sco --services f | tr -d '"') sa@Azure:~/azhlfTool$ AZURE_FILE_CONNECTION_STRING=https://$STORAGE_ACCOUNT.file.core.windows.net/$STORAGE_FILE_SHARE?$SAS_TOKEN sa@Azure:~/azhlfTool$ ./azhlf adminProfile import fromAzure -o $ORDERER_ORG_NAME -g $ORDERER_ORG_RESOURCE_GROUP -s $ORDERER_ORG_SUBSCRIPTION Trying to find requested resource in Azure Blockchain Service... Could not find Azure blockchain Hyperledger Fabric member OrdererOrg in resource group hlf Fallback to marketplace based application... Retrieving information about marketplace based application... Retrieving Admin profile from application... admin.OrdererOrg imported to wallet sa@Azure:~/azhlfTool$ ./azhlf connectionProfile import fromAzure -g $ORDERER_ORG_RESOURCE_GROUP -s $ORDERER_ORG_SUBSCRIPTION -o $ORDERER_ORG_NAME Trying to find requested resource in Azure Blockchain Service... Could not find Azure blockchain Hyperledger Fabric member OrdererOrg in resource group hlf Fallback to marketplace based application... Retrieving information about marketplace based application... Retrieving Connection profile from application... Connection profile for OrdererOrg imported to /home/sa/azhlfTool/stores/connectionprofiles/OrdererOrg.json. sa@Azure:~/azhlfTool$ ./azhlf msp import fromAzure -g $ORDERER_ORG_RESOURCE_GROUP -s $ORDERER_ORG_SUBSCRIPTION -o $ORDERER_ORG_NAME Trying to find requested resource in Azure Blockchain Service... Could not find Azure blockchain Hyperledger Fabric member OrdererOrg in resource group hlf Fallback to marketplace based application... Retrieving information about marketplace based application... Retrieving MSP profile from application... OrdererOrg MSP is imported to /home/sa/azhlfTool/stores/msp/OrdererOrg.json. sa@Azure:~/azhlfTool$ sa@Azure:~/azhlfTool$ ./azhlf adminProfile import fromAzure -g $PEER_ORG_RESOURCE_GROUP -s $PEER_ORG_SUBSCRIPTION -o $PEER_ORG_NAME Trying to find requested resource in Azure Blockchain Service... Could not find Azure blockchain Hyperledger Fabric member Org1 in resource group hlfp Fallback to marketplace based application... Retrieving information about marketplace based application... Retrieving Admin profile from application... ^[admin.Org1 imported to wallet sa@Azure:~/azhlfTool$ ./azhlf connectionProfile import fromAzure -g $PEER_ORG_RESOURCE_GROUP -s $PEER_ORG_SUBSCRIPTION -o $PEER_ORG_NAME Trying to find requested resource in Azure Blockchain Service... Could not find Azure blockchain Hyperledger Fabric member Org1 in resource group hlfp Fallback to marketplace based application... Retrieving information about marketplace based application... Retrieving Connection profile from application... Connection profile for Org1 imported to /home/sa/azhlfTool/stores/connectionprofiles/Org1.json. sa@Azure:~/azhlfTool$ ./azhlf msp import fromAzure -g $PEER_ORG_RESOURCE_GROUP -s $PEER_ORG_SUBSCRIPTION -o $PEER_ORG_NAME Trying to find requested resource in Azure Blockchain Service... Could not find Azure blockchain Hyperledger Fabric member Org1 in resource group hlfp Fallback to marketplace based application... Retrieving information about marketplace based application... Retrieving MSP profile from application... Org1 MSP is imported to /home/sa/azhlfTool/stores/msp/Org1.json. sa@Azure:~/azhlfTool$ sa@Azure:~/azhlfTool$ ./azhlf channel create -c $CHANNEL_NAME -u $ORDERER_ADMIN_IDENTITY -o $ORDERER_ORG_NAME Sending request for channel creation... Channel mychannel successfully created. sa@Azure:~/azhlfTool$ ./azhlf channel setAnchorPeers -c $CHANNEL_NAME -p peer1 -o $PEER_ORG_NAME -u $PEER_ADMIN_IDENTITY Preparing anchor peers list... Retrieving channel's latest configuration block... 2020-06-30T18:09:46.378Z - error: [Channel.js]: Channel:hrschannel received discovery error:access denied 2020-06-30T18:09:46.379Z - error: [Channel.js]: Error: Channel:hrschannel Discovery error:access denied 2020-06-30T18:09:46.380Z - error: [Network]: _initializeInternalChannel: Unable to initialize channel. Attempted to contact 1 Peers. Last error was Error: Channel:hrschannel Discovery error:access denied Error: Unable to initialize channel. Attempted to contact 1 Peers. Last error was Error: Channel:hrschannel Discovery error:access denied at Network._initializeInternalChannel (/home/sa/azhlfTool/node_modules/fabric-network/lib/network.js:112:12) at <anonymous> If no one peer joined the requested channel - provide --ordererOrg parameter to command.1.5KViews0likes0CommentsHow to setup hyperledger fabric
I know concepts of hyperledger fabric. I have experience working in development environment using containers. But I want to learn setup hyperledger fabric in azure. So I followed these steps (https://docs.microsoft.com/en-us/azure/blockchain/templates/hyperledger-fabric-consortium-azure-kubernetes-service#create-channel-command) in free trial. I build 1 ordering service and 1 peer service separately with different resource group name. However I have the followings confusions in building consortium. 1. Where can I get the following details. STORAGE_SUBSCRIPTION=<subscriptionId> STORAGE_RESOURCE_GROUP=<azureFileShareResourceGroup> STORAGE_ACCOUNT=<azureStorageAccountName> STORAGE_LOCATION=<azureStorageAccountLocation> STORAGE_FILE_SHARE=<azureFileShareName> It seems like I have two storage accounts one is created for orderer, one is for peer in recent resources. But here only one of storage details. How to follow this https://docs.microsoft.com/en-us/azure/blockchain/templates/hyperledger-fabric-consortium-azure-kubernetes-service#create-channel-command for store account and connection string steps specified in this document.Solved4.1KViews0likes3CommentsRe: How to setup hyperledger fabric
asifwaquar Thank you very much for helping me. I think I am not asked the question properly. I described my problem here https://techcommunity.microsoft.com/t5/blockchain/how-to-get-storage-account-details-hyperledger-fabric-consortium/m-p/1499802 in details.4KViews0likes1Comment
Groups
Recent Blog Articles
No content to show