SOLVED

How to setup hyperledger fabric

%3CLINGO-SUB%20id%3D%22lingo-sub-1492487%22%20slang%3D%22en-US%22%3EHow%20to%20setup%20hyperledger%20fabric%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1492487%22%20slang%3D%22en-US%22%3E%3CP%3EI%20know%20concepts%20of%20hyperledger%20fabric.%20I%20have%20experience%20working%20in%20development%20environment%20using%20containers.%20But%20I%20want%20to%20learn%20setup%20hyperledger%20fabric%20in%20azure.%20So%20I%20followed%20these%20steps%20(%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fblockchain%2Ftemplates%2Fhyperledger-fabric-consortium-azure-kubernetes-service%23create-channel-command%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fblockchain%2Ftemplates%2Fhyperledger-fabric-consortium-azure-kubernetes-service%23create-channel-command%3C%2FA%3E)%20in%20free%20trial.%26nbsp%3B%20I%20build%201%20ordering%20service%20and%201%20peer%20service%20separately%20with%20different%20resource%20group%20name.%20However%20I%20have%20the%20followings%20confusions%20in%20building%20consortium.%26nbsp%3B%26nbsp%3B%3C%2FP%3E%3CP%3E1.%20Where%20can%20I%20get%20the%20following%20details.%3C%2FP%3E%3CP%3ESTORAGE_SUBSCRIPTION%3D%3CSUBSCRIPTIONID%3E%3CBR%20%2F%3ESTORAGE_RESOURCE_GROUP%3D%3CAZUREFILESHARERESOURCEGROUP%3E%3CBR%20%2F%3ESTORAGE_ACCOUNT%3D%3CAZURESTORAGEACCOUNTNAME%3E%3CBR%20%2F%3ESTORAGE_LOCATION%3D%3CAZURESTORAGEACCOUNTLOCATION%3E%3CBR%20%2F%3ESTORAGE_FILE_SHARE%3D%3CAZUREFILESHARENAME%3E%3C%2FAZUREFILESHARENAME%3E%3C%2FAZURESTORAGEACCOUNTLOCATION%3E%3C%2FAZURESTORAGEACCOUNTNAME%3E%3C%2FAZUREFILESHARERESOURCEGROUP%3E%3C%2FSUBSCRIPTIONID%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIt%20seems%20like%20I%20have%20two%20storage%20accounts%20one%20is%20created%20for%20orderer%2C%20one%20is%20for%20peer%20in%20recent%20resources.%20But%20here%20only%20one%20of%20storage%20details.%20How%20to%20follow%20this%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fblockchain%2Ftemplates%2Fhyperledger-fabric-consortium-azure-kubernetes-service%23create-channel-command%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noreferrer%22%3Ehttps%3A%2F%2Fdocs.microsoft.com%2Fen-us%2Fazure%2Fblockchain%2Ftemplates%2Fhyperledger-fabric-consortium-azure-kubernetes-service%23create-channel-command%3C%2FA%3E%26nbsp%3Bfor%20store%20account%20and%20connection%20string%20steps%20specified%20in%20this%20document.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1494817%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20setup%20hyperledger%20fabric%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1494817%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F710441%22%20target%3D%22_blank%22%3E%40selvaraman%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20have%20existing%20storage%20account%20you%20may%20setup%20environment%20variable%20first%20with%20existing%20storage%20account%20details%20but%20make%20sure%20you%20have%20created%20file%20share%20for%20that%20account%20(That%20single%20account%20can%20save%20both%20orderer%20and%20peer%20details)%20.%20%26nbsp%3BIn%20this%20case%20creating%20new%20account%20and%20file%20share%20can%20be%20skipped.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20may%20get%20details%20of%20storage%20from%20storage%20resources%20if%20you%20have%20existing%20%2Cplease%20refer%20attached%20pic.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20you%20don't%20have%20any%20storage%20account%20then%20you%20need%20to%20create%20new%20storage%20account%20with%20file%20share%20.%20In%20this%20case%20after%20setting%20up%20environment%20variable%20.%20Proceed%20to%20execute%20below%20command%20.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Eaz%20account%20set%20--subscription%20%24STORAGE_SUBSCRIPTION%3CBR%20%2F%3Eaz%20group%20create%20-l%20%24STORAGE_LOCATION%20-n%20%24STORAGE_RESOURCE_GROUP%3CBR%20%2F%3Eaz%20storage%20account%20create%20-n%20%24STORAGE_ACCOUNT%20-g%20%24STORAGE_RESOURCE_GROUP%20-l%20%24STORAGE_LOCATION%20--sku%20Standard_LRS%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E--%20for%20file%20share%20---%3C%2FP%3E%3CP%3ESTORAGE_KEY%3D%24(az%20storage%20account%20keys%20list%20--resource-group%20%24STORAGE_RESOURCE_GROUP%20--account-name%20%24STORAGE_ACCOUNT%20--query%20%22%5B0%5D.value%22%20%7C%20tr%20-d%20'%22')%3CBR%20%2F%3Eaz%20storage%20share%20create%20--account-name%20%24STORAGE_ACCOUNT%20--account-key%20%24STORAGE_KEY%20--name%20%24STORAGE_FILE_SHARE%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20more%20detailed%20reference%20you%20may%20refer%20below%20blog.%3C%2FP%3E%3CP%3E%3CA%20href%3D%22http%3A%2F%2Fasifwaquar.com%2Fcreate-hyperledger-fabric-consortium-using-azure-kubernetes-service-aks-template-part-2%2F%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttp%3A%2F%2Fasifwaquar.com%2Fcreate-hyperledger-fabric-consortium-using-azure-kubernetes-service-aks-template-part-2%2F%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3Ethank%20you%26nbsp%3B%3C%2FP%3E%3CP%3EAsif%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1499817%22%20slang%3D%22en-US%22%3ERe%3A%20How%20to%20setup%20hyperledger%20fabric%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1499817%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F645962%22%20target%3D%22_blank%22%3E%40asifwaquar%3C%2FA%3E%26nbsp%3B%20Thank%20you%20very%20much%20for%20helping%20me.%20I%20think%20I%20am%20not%20asked%20the%20question%20properly.%20I%26nbsp%3Bdescribed%20my%20problem%20here%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fblockchain%2Fhow-to-get-storage-account-details-hyperledger-fabric-consortium%2Fm-p%2F1499802%22%20target%3D%22_blank%22%3Ehttps%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fblockchain%2Fhow-to-get-storage-account-details-hyperledger-fabric-consortium%2Fm-p%2F1499802%3C%2FA%3E%26nbsp%3Bin%20details.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

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-kube...) 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-kube... for store account and connection string steps specified in this document. 

 

3 Replies

Hi @selvaraman ,

 

If you have existing storage account you may setup environment variable first with existing storage account details but make sure you have created file share for that account (That single account can save both orderer and peer details) .  In this case creating new account and file share can be skipped.

 

You may get details of storage from storage resources if you have existing ,please refer attached pic.

 

If you don't have any storage account then you need to create new storage account with file share . In this case after setting up environment variable . Proceed to execute below command .

 

az account set --subscription $STORAGE_SUBSCRIPTION
az group create -l $STORAGE_LOCATION -n $STORAGE_RESOURCE_GROUP
az storage account create -n $STORAGE_ACCOUNT -g $STORAGE_RESOURCE_GROUP -l $STORAGE_LOCATION --sku Standard_LRS

 

-- for file share ---

STORAGE_KEY=$(az storage account keys list --resource-group $STORAGE_RESOURCE_GROUP --account-name $STORAGE_ACCOUNT --query "[0].value" | tr -d '"')
az storage share create --account-name $STORAGE_ACCOUNT --account-key $STORAGE_KEY --name $STORAGE_FILE_SHARE

 

For more detailed reference you may refer below blog.

http://asifwaquar.com/create-hyperledger-fabric-consortium-using-azure-kubernetes-service-aks-templa...

 

thank you 

Asif

 

 

 

 

 

@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-fab... in details.

best response confirmed by selvaraman (Occasional Contributor)
Solution

Hi @selvaraman,

 

For creating location in same eastus region ,you need to choose advance setting option from cloud shell.It will give you option to choose location ,storage name and account .

 

Currently your storage is creating in default location central India although you are creating your orderer service and peer in eastus location. So it is giving error . I would recommend you choose location also in eastus by choosing advance setting and then try again .

 

Let me know if you still face issue because storage is very important part to generate file share string and saving your details.

 

Please refer screenshot attached below for choosing advance setting option and changing location of your storage account.

 

thank you