hyperledger / bevel-operator-fabric

Hyperledger Fabric Kubernetes operator - Hyperledger Fabric operator for Kubernetes (v2.3, v2.4 and v2.5, soon 3.0)
https://hyperledger.github.io/bevel-operator-fabric/
Apache License 2.0
270 stars 91 forks source link

[Chaincode] META-INF indexes not applied to couchdb #44

Closed rrozek closed 2 years ago

rrozek commented 2 years ago

Hi @dviejokfs i'm using your hlf-operator in our deployments and found out that indexes located in chaincode META-INF are not applied to couchdb during chaincode deployment. Could you investigate this issue? If i can help with some logs, i'm more than happy to provide them.

Our chaincode is in js (node). During installation It is packaged fine and META-INF is present in targz archive (i unpacked it on peer from production/lifecycle/chaincodes/<chaincode.tar.gz> and the structure looks like this)

/var/hyperledger/mychaincode # tree .
.
├── code.tar.gz
├── metadata.json
/var/hyperledger/mychaincode # tree .
.
├── META-INF
│   └── statedb
│       └── couchdb
│           └── indexes
│               ├── enforcementDateIndex.json
│               ├── expirationDateIndex.json
│               └── ownerIndex.json
├── code.tar.gz
├── metadata.json
└── src
    ├── README.md
    ├── index.js
    ├── lib
    │   ├── ephemeralUtxo.js
    │   └── utils.js
    ├── package-lock.json
    ├── package.json
    └── test
        ├── MockStateQueryIterator.js
        └── ephemeralUtxo.test.js

i had to manually add indexes by issuing POSTs to couchdb.

Thank you!

dviejokfs commented 2 years ago

Hi @rrozek

I'm glad the operator is helping.

Can you provide me with the YAML of the peer deployment? I suspect that the image version of the peer is not the newest one.

You can see the list of tags for the image with the external builder here, I suggest you try to use the following image:

ghcr.io/kfsoftware/fabric-2.3.0-v0.0.5

rrozek commented 2 years ago

Hi @dviejokfs i can confirm that it works on mentioned ghcr.io/kfsoftware/fabric-2.3.0-v0.0.5 however i had to manually tweak deployment file as peer create didn't take into account --image option. I believe it is already fixed in 1.6.0 as well? (judging by reflog)

thank you very much for your efforts!

dviejokfs commented 2 years ago

@rrozek try upgrading to latest hlf-operator, check https://github.com/kfsoftware/hlf-helm-charts

And try upgrading to latest kubectl-hlf version, which is v1.6.1