PIVT icon indicating copy to clipboard operation
PIVT copied to clipboard

How i can migrate my Fabric Network 1.4.3 to 2.0 ?

Open rahul-edx opened this issue 4 years ago • 11 comments

rahul-edx avatar Oct 12 '20 11:10 rahul-edx

Anyone can help with this one ?

Marek00Malik avatar Oct 15 '20 07:10 Marek00Malik

see this issue

raftAtGit avatar Oct 15 '20 08:10 raftAtGit

I am sure we need to change entire chaincode life cycle work-flow to newer one (fabric 2.0) older one(1.4.x) : install and instantiate newer one(2.0) : package , install , approve, commit. @mr-rooftop would you like to add something how we can achieve it?

rahulEth avatar Oct 16 '20 06:10 rahulEth

@hyfen-nl @LudoNieuw @raftAtGit when you are planing to upgrade your sources for hyperledger fabric 2.0 ? It's been long time now we should move to next version.

rahulEth avatar Oct 16 '20 06:10 rahulEth

Hi there,

We have not planned this at least until the new year. Pull requests are as always very welcome.

Op vr 16 okt. 2020 om 08:38 schreef rahul saini [email protected]

@hyfen-nl https://github.com/hyfen-nl when you are planing to upgrade your sources for hyperledger fabric 2.0 ? It's been long time now we should move to next version.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/hyfen-nl/PIVT/issues/92#issuecomment-709844777, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMGK5NRLOCLRKKUASBGZ32TSK7S5XANCNFSM4SMWHBCQ .

LudoNieuw avatar Oct 16 '20 08:10 LudoNieuw

i am using Fabric v2.2.1 . facing ENDORSEMENT_POLICY_FAILURE error while using approveformyorg command -

peer lifecycle chaincode approveformyorg -o orderer0.example.com:7050 --tls --cafile /hlf_config/orderer-tlsca/tlscacert.pem --channelID mychannel --name mychaincode --version 1.0 --init-required --package-id $CC_PACKAGE_ID --sequence 1 --signature-policy "OR ('org1MSP.peer','org2MSP.peer', 'org3MSP.peer')" –init-required

Error : 2020-10-30 12:49:33.369 UTC [chaincodeCmd] ClientWait -> INFO 001 txid [517f3cf02cb8d8edda46e4d213cd1716dc093539d6a498922216ddb12481568c] committed with status (ENDORSEMENT_POLICY_FAILURE) at peer0.org1.com:7051 Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE)

Do someone have any idea about it?

rahul-edx avatar Nov 04 '20 04:11 rahul-edx

I assume you are running with TLS? Check that you have set the right CORE_PEER_TLS_CERT_FILE, CORE_PEER_TLS_KEY_FILE, CORE_PEER_TLS_ROOTCERT_FILE env. variables. This is how my approval step looks like, note I have not added the signature policy, but you may simply add it to the execution at the bottom.

- name: maybe-approve-chaincode--{{ $chaincode.name }}-{{ $version | replace "." "-" }}--{{ $org.Name }}--{{ $peer }}
    # chaincode: {{ $chaincode.name }}
    # version: {{ $version }}
    # org: {{ $org.Name }}
    # peer: {{ $peer }}
    inputs:
    retryStrategy:
      limit: {{ $.Values.retryCount }}
    script:
      image: hyperledger/fabric-tools:{{ $.Values.hyperledgerVersion }}
      command: [sh]
      source: |

          peer lifecycle chaincode queryapproved --channelID {{ $channel.name }} --name {{ $chaincode.name }} --sequence {{ $sequence }} --output json \
            {{- if $.Values.tlsEnabled }}
                  --tls --cafile /hlf_config/orderer-tlsca/tlscacert.pem \
            {{- end }}
            >&queryApproved.txt

          echo '-- QueryApprovals response:'
          cat queryApproved.txt

          if grep -q 'could not fetch approved chaincode definition' queryApproved.txt; then
              echo 'Chaincode {{ $chaincode.name }}, version {{ $version }} was not approved by any organization yet!'
          else
            echo '-- checking if chaincode already approved'
            chaincodeApproved=$(jq 'if .version == "{{ $version }}" and .sequence == {{ $sequence }} and (.source.Type.LocalPackage.package_id | contains("{{ printf "%s.%s" $chaincode.name $version }}")) then true else false end' queryApproved.txt)

            if $chaincodeApproved; then
              echo "Chaincode {{ $chaincode.name }} with version {{ $version }} has already been approved"
              exit 0
            fi;
          fi;

          echo 'Chaincode was not approved for version {{ $version }}, getting latest installed {{ $chaincode.name }} chaincode'
          packageId=$(peer lifecycle chaincode queryinstalled --output json | jq -r '.installed_chaincodes[-1] | select(.label == "{{ printf "%s.%s" $chaincode.name $version }}").package_id')

          echo "Sending Approval for chaincode {{ $chaincode.name }} in version {{ $version }} and sequence {{ $sequence }} by Org {{ $org.Name }}. Approval send for packageId = ${packageId}"

          peer lifecycle chaincode approveformyorg --channelID {{ $channel.name }} --name {{ $chaincode.name }} --version {{ $version }} --sequence {{ $sequence }} \
              {{- if $.Values.tlsEnabled }}
              --tls --cafile /hlf_config/orderer-tlsca/tlscacert.pem \
              {{- end }}
              --connTimeout {{ $.Values.flow.chaincode.timeout }} --package-id $packageId

      volumeMounts:
        - mountPath: /hlf_config/orderer-tlsca
          name: orderer-tlsca
        - mountPath: /etc/hyperledger/fabric/tls/
          name: peer-{{ $org.Name | lower }}-{{ $peer | lower }}-tls
        - mountPath: /etc/hyperledger/fabric/msp/
          name: peer-{{ $org.Name | lower }}-admin-msp
        - mountPath: /hlf_config/chaincode/
          name: chaincode-{{ $chaincode.name | lower }}

      env:
        - name: CORE_PEER_ADDRESS
          value: |-
            {{- if $.Values.useActualDomains }}
              {{ $peer }}.{{ $org.Domain }}:7051
            {{- else }}
              hlf-peer--{{ $org.Name | lower }}--{{ $peer | lower }}:7051
            {{- end }}
        - name: CORE_PEER_TLS_ENABLED
          value: {{ $.Values.tlsEnabled | quote }}
        - name: FABRIC_LOGGING_SPEC
          value: {{ $.Values.logLevel }}
        - name: CORE_PEER_LOCALMSPID
          value: {{ $org.Name }}MSP
        - name: CORE_PEER_TLS_CERT_FILE
          value: /etc/hyperledger/fabric/tls/server.crt
        - name: CORE_PEER_TLS_KEY_FILE
          value: /etc/hyperledger/fabric/tls/server.key
        - name: CORE_PEER_TLS_ROOTCERT_FILE
          value: /etc/hyperledger/fabric/tls/ca.crt

Marek00Malik avatar Nov 05 '20 08:11 Marek00Malik

@Marek00Malik still getting the same error

peer lifecycle chaincode approveformyorg -o orderer0.edexa1.edx:7050 --tls --cafile /hlf_config/orderer-tlsca/tlscacert.pem --channelID banji --name banji --version 1 --package-id banji_1:b15df12393b167607223dceb4432f659931f0b0b9a0d80b2722b3b67dbf40c67

2020-11-10 05:03:15.486 UTC [msp] getPemMaterialFromDir -> WARN 001 Failed reading file /etc/hyperledger/fabric/msp/admincerts/cert.pem: no pem content for file /etc/hyperledger/fabric/msp/admincerts/cert.pem 2020-11-10 05:03:15.486 UTC [msp] loadCertificateAt -> WARN 002 Failed loading ClientOU certificate at [/etc/hyperledger/fabric/msp/cacerts/ca.edexaorg00001.edx-cert.pem]: [could not read file /etc/hyperledger/fabric/msp/cacerts/ca.edexaorg00001.edx-cert.pem: open /etc/hyperledger/fabric/msp/cacerts/ca.edexaorg00001.edx-cert.pem: no such file or directory] 2020-11-10 05:03:15.486 UTC [msp] loadCertificateAt -> WARN 003 Failed loading PeerOU certificate at [/etc/hyperledger/fabric/msp/cacerts/ca.edexaorg00001.edx-cert.pem]: [could not read file /etc/hyperledger/fabric/msp/cacerts/ca.edexaorg00001.edx-cert.pem: open /etc/hyperledger/fabric/msp/cacerts/ca.edexaorg00001.edx-cert.pem: no such file or directory] 2020-11-10 05:03:15.486 UTC [msp] loadCertificateAt -> WARN 004 Failed loading AdminOU certificate at [/etc/hyperledger/fabric/msp/cacerts/ca.edexaorg00001.edx-cert.pem]: [could not read file /etc/hyperledger/fabric/msp/cacerts/ca.edexaorg00001.edx-cert.pem: open /etc/hyperledger/fabric/msp/cacerts/ca.edexaorg00001.edx-cert.pem: no such file or directory] 2020-11-10 05:03:15.486 UTC [msp] loadCertificateAt -> WARN 005 Failed loading OrdererOU certificate at [/etc/hyperledger/fabric/msp/cacerts/ca.edexaorg00001.edx-cert.pem]: [could not read file /etc/hyperledger/fabric/msp/cacerts/ca.edexaorg00001.edx-cert.pem: open /etc/hyperledger/fabric/msp/cacerts/ca.edexaorg00001.edx-cert.pem: no such file or directory] 2020-11-10 05:03:16.581 UTC [chaincodeCmd] ClientWait -> INFO 006 txid [2fcae743de48ad5cc41ecdb1ba391147d98ce8ea035f0433f4566533ac38c0a9] committed with status (ENDORSEMENT_POLICY_FAILURE) at Error: transaction invalidated with status (ENDORSEMENT_POLICY_FAILURE)

rahul-edx avatar Nov 10 '20 05:11 rahul-edx

Do you have your admin-msp secret ?

The error states that there is no such file on dir like /etc/hyperledger/fabric/msp/cacerts/ca.edexaorg00001.edx-cert.pem

Marek00Malik avatar Nov 12 '20 07:11 Marek00Malik

Is there any update on this from Core Team? It would be nice to know if there is a specific timeline if it is planned.

sillysachin avatar Dec 18 '20 07:12 sillysachin

Hi there No news at this moment concerning when and how we migrate to hlf 2.0 This will be part of next quarter’s discussions, probably. If there’s news to share, we will let you all know!

Regards,

Ludo

Op vr 18 dec. 2020 om 08:24 schreef Sachin Shekhar R < [email protected]>

Is there any update on this from Core Team? It would be nice to know if there is a specific timeline if it is planned.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/hyfen-nl/PIVT/issues/92#issuecomment-747918960, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMGK5NRU4CSM775PZ6EBKV3SVL7TDANCNFSM4SMWHBCQ .

LudoNieuw avatar Dec 18 '20 07:12 LudoNieuw