Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
Signed-off-by: David VIEJO <[email protected]>
  • Loading branch information
dviejokfs committed Oct 31, 2024
1 parent c144c5f commit f45cee8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 37 deletions.
32 changes: 7 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,8 @@ To install helm: [https://helm.sh/docs/intro/install/](https://helm.sh/docs/intr
```bash
helm repo add kfs https://kfsoftware.github.io/hlf-helm-charts --force-update

helm install hlf-operator --version=1.10.0 -- kfs/hlf-operator
helm install hlf-operator --version=1.11.0-beta8-1 -- kfs/hlf-operator
helm upgrade hlf-operator --version=1.11.0-beta8-1 -- kfs/hlf-operator
```


Expand Down Expand Up @@ -218,7 +219,7 @@ EOF
## Deploy a `Peer` organization


### Environment Variables for AMD (Default)
### Environment Variables

```bash
export PEER_IMAGE=hyperledger/fabric-peer
Expand All @@ -231,23 +232,6 @@ export CA_IMAGE=hyperledger/fabric-ca
export CA_VERSION=1.5.13
```


### Environment Variables for ARM (Mac M1)

```bash
export PEER_IMAGE=hyperledger/fabric-peer
export PEER_VERSION=3.0.0

export ORDERER_IMAGE=hyperledger/fabric-orderer
export ORDERER_VERSION=3.0.0

export CA_IMAGE=hyperledger/fabric-ca
export CA_VERSION=1.5.13

```



### Configure Internal DNS

```bash
Expand Down Expand Up @@ -704,8 +688,6 @@ echo "PACKAGE_ID=$PACKAGE_ID"

kubectl hlf chaincode install --path=./chaincode.tgz \
--config=org1.yaml --language=golang --label=$CHAINCODE_LABEL --user=admin --peer=org1-peer0.default
kubectl hlf chaincode install --path=./chaincode.tgz \
--config=org1.yaml --language=golang --label=$CHAINCODE_LABEL --user=admin --peer=org1-peer1.default

```

Expand Down Expand Up @@ -735,14 +717,14 @@ export VERSION="1.0"
kubectl hlf chaincode approveformyorg --config=org1.yaml --user=admin --peer=org1-peer0.default \
--package-id=$PACKAGE_ID \
--version "$VERSION" --sequence "$SEQUENCE" --name=asset \
--policy="OR('Org1MSP.member')" --channel=testbft02
--policy="OR('Org1MSP.member')" --channel=demo
```

## Commit chaincode
```bash
kubectl hlf chaincode commit --config=org1.yaml --user=admin --mspid=Org1MSP \
--version "$VERSION" --sequence "$SEQUENCE" --name=asset \
--policy="OR('Org1MSP.member')" --channel=testbft02
--policy="OR('Org1MSP.member')" --channel=demo
```


Expand All @@ -751,7 +733,7 @@ kubectl hlf chaincode commit --config=org1.yaml --user=admin --mspid=Org1MSP \
```bash
kubectl hlf chaincode invoke --config=org1.yaml \
--user=admin --peer=org1-peer0.default \
--chaincode=asset --channel=testbft02 \
--chaincode=asset --channel=demo \
--fcn=initLedger -a '[]'
```

Expand All @@ -760,7 +742,7 @@ kubectl hlf chaincode invoke --config=org1.yaml \
```bash
kubectl hlf chaincode query --config=org1.yaml \
--user=admin --peer=org1-peer0.default \
--chaincode=asset --channel=testbft02 \
--chaincode=asset --channel=demo \
--fcn=GetAllAssets -a '[]'
```

Expand Down
17 changes: 5 additions & 12 deletions controllers/mainchannel/mainchannel_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -876,11 +876,9 @@ func (r *FabricMainChannelReconciler) mapToConfigTX(channel *hlfv1alpha1.FabricM
},
}
// if etcdraft, add BlockValidation policy
if channel.Spec.ChannelConfig.Orderer.OrdererType == hlfv1alpha1.OrdererConsensusEtcdraft {
adminOrdererPolicies["BlockValidation"] = configtx.Policy{
Type: "ImplicitMeta",
Rule: "ANY Writers",
}
adminOrdererPolicies["BlockValidation"] = configtx.Policy{
Type: "ImplicitMeta",
Rule: "ANY Writers",
}

var state orderer.ConsensusState
Expand Down Expand Up @@ -919,7 +917,6 @@ func (r *FabricMainChannelReconciler) mapToConfigTX(channel *hlfv1alpha1.FabricM
ServerTlsCert: utils.EncodeX509Certificate(serverTLSCert),
})
}
//

leader_rotation := sb.Options_ROTATION_ON
if channel.Spec.ChannelConfig.Orderer.SmartBFT.LeaderRotation == sb.Options_ROTATION_ON {
Expand Down Expand Up @@ -977,7 +974,7 @@ func (r *FabricMainChannelReconciler) mapToConfigTX(channel *hlfv1alpha1.FabricM
ordConfigtx := configtx.Orderer{
OrdererType: ordererType,
Organizations: ordererOrgs,
ConsenterMapping: consenterMapping, // TODO: map from channel.Spec.ConssenterMapping
ConsenterMapping: consenterMapping,
SmartBFT: smartBFTOptions,
EtcdRaft: etcdRaft,
Policies: adminOrdererPolicies,
Expand Down Expand Up @@ -1429,10 +1426,6 @@ func updateOrdererChannelConfigTx(currentConfigTX configtx.ConfigTx, newConfigTx
}
}
} else if newConfigTx.Orderer.OrdererType == orderer.ConsensusTypeBFT {
err = currentConfigTX.Orderer().SetConfiguration(newConfigTx.Orderer)
if err != nil {
return errors.Wrapf(err, "failed to set orderer configuration")
}
var consenterMapping []*cb.Consenter
for _, consenter := range newConfigTx.Orderer.ConsenterMapping {
consenterMapping = append(consenterMapping, &cb.Consenter{
Expand All @@ -1452,7 +1445,7 @@ func updateOrdererChannelConfigTx(currentConfigTX configtx.ConfigTx, newConfigTx
}

// update
if ord.OrdererType == "BFT" {
if ord.OrdererType == orderer.ConsensusTypeBFT {
err = currentConfigTX.Orderer().SetConfiguration(newConfigTx.Orderer)
if err != nil {
return errors.Wrapf(err, "failed to set orderer configuration")
Expand Down

0 comments on commit f45cee8

Please sign in to comment.