Forum Discussion

selvaraman's avatar
selvaraman
Copper Contributor
Jun 26, 2020

How 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. 

 

  • 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 

  • asifwaquar's avatar
    asifwaquar
    Copper Contributor

    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-template-part-2/

     

    thank you 

    Asif

     

     

     

     

     

      • asifwaquar's avatar
        asifwaquar
        Copper Contributor

        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 

Resources