Skip to content

Commit

Permalink
Implement changes to 3.0
Browse files Browse the repository at this point in the history
Signed-off-by: David VIEJO <[email protected]>
  • Loading branch information
dviejokfs committed Aug 19, 2024
1 parent 4c2d670 commit 610ce76
Show file tree
Hide file tree
Showing 13 changed files with 659 additions and 57 deletions.
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ 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.1 -- kfs/hlf-operator
helm install hlf-operator --version=1.10.0 -- kfs/hlf-operator
```


Expand Down Expand Up @@ -146,6 +146,9 @@ Install Istio on the Kubernetes cluster:

kubectl create namespace istio-system

export ISTIO_PATH=$(echo $PWD/istio-*/bin)
export PATH="$PATH:$ISTIO_PATH"

istioctl operator init

kubectl apply -f - <<EOF
Expand Down
51 changes: 49 additions & 2 deletions api/hlf.kungfusoftware.es/v1alpha1/hlf_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ package v1alpha1
import (
"fmt"

sb "github.com/hyperledger/fabric-protos-go/orderer/smartbft"
"github.com/kfsoftware/hlf-operator/pkg/status"
"k8s.io/api/networking/v1beta1"
kubeclock "k8s.io/utils/clock"
Expand Down Expand Up @@ -2375,7 +2376,7 @@ type FabricMainChannelApplicationConfig struct {
type FabricMainChannelOrdererConfig struct {
// OrdererType of the consensus, default "etcdraft"
// +kubebuilder:default:="etcdraft"
OrdererType string `json:"ordererType"`
OrdererType OrdererConsensusType `json:"ordererType"`
// Capabilities of the channel
// +kubebuilder:default:={"V2_0"}
Capabilities []string `json:"capabilities"`
Expand All @@ -2398,8 +2399,37 @@ type FabricMainChannelOrdererConfig struct {
// +kubebuilder:validation:Optional
// +optional
EtcdRaft *FabricMainChannelEtcdRaft `json:"etcdRaft"`
// +nullable
// +kubebuilder:validation:Optional
// +optional
SmartBFT *FabricMainChannelSmartBFT `json:"smartBFT"`
// +nullable
// +kubebuilder:validation:Optional
// +optional
// +kubebuilder:validation:Default={}
ConsenterMapping []FabricMainChannelConsenterItem `json:"consenterMapping"`
}

type FabricMainChannelSmartBFT struct {
RequestBatchMaxCount uint64 `json:"request_batch_max_count,omitempty"`
RequestBatchMaxBytes uint64 `json:"request_batch_max_bytes,omitempty"`
RequestBatchMaxInterval string `json:"request_batch_max_interval,omitempty"`
IncomingMessageBufferSize uint64 `json:"incoming_message_buffer_size,omitempty"`
RequestPoolSize uint64 `json:"request_pool_size,omitempty"`
RequestForwardTimeout string `json:"request_forward_timeout,omitempty"`
RequestComplainTimeout string `json:"request_complain_timeout,omitempty"`
RequestAutoRemoveTimeout string `json:"request_auto_remove_timeout,omitempty"`
RequestMaxBytes uint64 `json:"request_max_bytes,omitempty"`
ViewChangeResendInterval string `json:"view_change_resend_interval,omitempty"`
ViewChangeTimeout string `json:"view_change_timeout,omitempty"`
LeaderHeartbeatTimeout string `json:"leader_heartbeat_timeout,omitempty"`
LeaderHeartbeatCount uint64 `json:"leader_heartbeat_count,omitempty"`
CollectTimeout string `json:"collect_timeout,omitempty"`
SyncOnStart bool `json:"sync_on_start,omitempty"`
SpeedUpViewChange bool `json:"speed_up_view_change,omitempty"`
LeaderRotation sb.Options_Rotation `json:"leader_rotation,omitempty"`
DecisionsPerLeader uint64 `json:"decisions_per_leader,omitempty"`
}

type FabricMainChannelEtcdRaft struct {
// +nullable
// +kubebuilder:validation:Optional
Expand All @@ -2422,6 +2452,14 @@ type FabricMainChannelEtcdRaftOptions struct {
// +kubebuilder:default:=16777216
SnapshotIntervalSize uint32 `json:"snapshotIntervalSize"`
}

type OrdererConsensusType string

const (
OrdererConsensusEtcdraft OrdererConsensusType = "etcdraft"
OrdererConsensusBFT OrdererConsensusType = "BFT"
)

type FabricMainChannelConsensusState string

const (
Expand Down Expand Up @@ -2460,6 +2498,15 @@ type FabricMainChannelIdentity struct {
SecretKey string `json:"secretKey"`
}

type FabricMainChannelConsenterItem struct {
Id uint32 `json:"id,omitempty"`
Host string `json:"host,omitempty"`
Port uint32 `json:"port,omitempty"`
MspId string `json:"msp_id,omitempty"`
Identity string `json:"identity,omitempty"`
ClientTlsCert string `json:"client_tls_cert,omitempty"`
ServerTlsCert string `json:"server_tls_cert,omitempty"`
}
type FabricMainChannelConsenter struct {
// Orderer host of the consenter
Host string `json:"host"`
Expand Down
40 changes: 40 additions & 0 deletions api/hlf.kungfusoftware.es/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

70 changes: 70 additions & 0 deletions config/crd/bases/hlf.kungfusoftware.es_fabricmainchannels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,28 @@ spec:
items:
type: string
type: array
consenterMapping:
items:
properties:
client_tls_cert:
type: string
host:
type: string
id:
format: int32
type: integer
identity:
type: string
msp_id:
type: string
port:
format: int32
type: integer
server_tls_cert:
type: string
type: object
nullable: true
type: array
etcdRaft:
nullable: true
properties:
Expand Down Expand Up @@ -222,6 +244,54 @@ spec:
description: Policies of the orderer section of the channel
nullable: true
type: object
smartBFT:
nullable: true
properties:
collect_timeout:
type: string
decisions_per_leader:
format: int64
type: integer
incoming_message_buffer_size:
format: int64
type: integer
leader_heartbeat_count:
format: int64
type: integer
leader_heartbeat_timeout:
type: string
leader_rotation:
format: int32
type: integer
request_auto_remove_timeout:
type: string
request_batch_max_bytes:
format: int64
type: integer
request_batch_max_count:
format: int64
type: integer
request_batch_max_interval:
type: string
request_complain_timeout:
type: string
request_forward_timeout:
type: string
request_max_bytes:
format: int64
type: integer
request_pool_size:
format: int64
type: integer
speed_up_view_change:
type: boolean
sync_on_start:
type: boolean
view_change_resend_interval:
type: string
view_change_timeout:
type: string
type: object
state:
default: STATE_NORMAL
description: State about the channel, can only be `STATE_NORMAL`
Expand Down
2 changes: 1 addition & 1 deletion config/default/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- ../crd
# - ../rbac
- ../rbac
- ../manager
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: Kustomization
images:
- name: controller
newName: kfsoftware/hlf-operator
newTag: 1.11.0-support-chaincodes-17237171893N
newTag: dev-1724072591
Loading

0 comments on commit 610ce76

Please sign in to comment.