Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

Enable Bdls configuration in channel #10

Draft
wants to merge 49 commits into
base: release-bdls
Choose a base branch
from
Draft
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
daf8020
adding bdls package to main branch
ahmed82 Jan 31, 2023
f9bc298
adding BDLS configuration
ahmed82 Feb 24, 2023
6d4d632
adding BDLS configuration
ahmed82 Feb 24, 2023
0926090
extracting the hight from the block
ahmed82 Feb 26, 2023
e48cd13
Merge pull request #11 from BDLS-bft/include-bloackHight
ahmed82 Feb 26, 2023
1fa3dd5
Update the Consenter.go file and make use of the HandleChain() function
ahmed82 Mar 1, 2023
1259b97
adding the block creater file to bdls backage
ahmed82 Mar 1, 2023
793256c
Add the logic for the Chain.configure function.
ahmed82 Mar 2, 2023
1324513
Merge pull request #12 from ahmed82/main-bdls
ahmed82 Mar 8, 2023
80b6ab8
create the struct gc TODO practise for create a snapshotting into a …
ahmed82 Mar 9, 2023
f0288ad
prpose the marshel envelope message to the current BDLS node
ahmed82 Mar 9, 2023
64298b1
fix RPC interface implementation reusing the comentted error fun
ahmed82 Mar 9, 2023
517da41
Merge pull request #13 from ahmed82/main-bdls
ahmed82 Mar 9, 2023
77f0209
Merge pull request #14 from ahmed82/main-bdls
ahmed82 Mar 9, 2023
3bc4949
On branch main-bdls
ahmed82 Mar 10, 2023
112fca9
Merge branch 'BDLS-bft:main-bdls' into main-bdls
ahmed82 Mar 10, 2023
605179b
Merge pull request #15 from ahmed82/main-bdls
ahmed82 Mar 10, 2023
9ad5f72
point to lisr of Identity rather that list of pointer
ahmed82 Mar 12, 2023
8b84355
Merge pull request #16 from ahmed82/main-bdls
ahmed82 Mar 12, 2023
ec9822d
adding run method infra
ahmed82 Mar 21, 2023
8e992eb
enable RPC.SendSubmit in the submit()
ahmed82 Mar 24, 2023
94219bb
restart configuring the run in go routin
ahmed82 Mar 28, 2023
eb908f3
propose the data the consensus and update the blovk height with new h…
ahmed82 Mar 28, 2023
3a35866
enable using the Run() in go routin
ahmed82 Mar 28, 2023
c168cdd
remove the null pram from the consenter interface
ahmed82 Mar 29, 2023
145975c
init adding the BDLS Participants
ahmed82 Mar 31, 2023
e4b7f4b
Merge pull request #17 from ahmed82/bdlsIdentity
ahmed82 Mar 31, 2023
05b7a29
cleanup consensus task example
ahmed82 Apr 1, 2023
4fd164a
Merge pull request #18 from ahmed82/bdlsIdentity
ahmed82 Apr 1, 2023
4ef97f4
refresh BDLS release, using the SubmitRequest function
ahmed82 Apr 8, 2023
55cdba3
Merge pull request #19 from ahmed82/bdlsIdentity
ahmed82 Apr 8, 2023
f3873c2
move to local proto
ahmed82 Apr 21, 2023
249b823
move the Proto files to the BDLS repo to avoid vendor issue
ahmed82 May 2, 2023
dfd22ee
Merge pull request #1 from ahmed82/localproto
ahmed82 May 2, 2023
c8d30d7
Merge pull request #20 from ahmed82/main-bdls
ahmed82 May 2, 2023
56a32f4
adding the initializeBdlsConsenter function - TODO reuse the icr
ahmed82 May 17, 2023
77eed22
Create CITATION.cff
ahmed82 Jun 2, 2023
9d176e2
fix Fabric BDLS profile
ahmed82 Jun 20, 2023
a92c87e
include bdls ordrer config in configtx_template
ahmed82 Jun 20, 2023
efec7fb
fix the makefile
ahmed82 Jun 21, 2023
0b462e7
revert the configtx.yaml file
ahmed82 Jun 21, 2023
cfa0dfb
update the configtx yaml file
ahmed82 Jun 22, 2023
ffcd4ce
Merge pull request #2 from ahmed82/localproto
ahmed82 Jun 22, 2023
75a327d
Merge pull request #21 from ahmed82/main-bdls
ahmed82 Jun 22, 2023
7262ee8
Fix the config file for Bdls
ahmed82 Jun 26, 2023
f050303
Merge pull request #3 from ahmed82/localproto
ahmed82 Jun 26, 2023
223156f
switch the ordererType BDLS to static string in internal/configtxgen/…
ahmed82 Jun 26, 2023
70bb00e
Merge pull request #4 from ahmed82/localproto
ahmed82 Jun 26, 2023
5159353
Merge pull request #22 from ahmed82/main-bdls
ahmed82 Jun 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix Fabric BDLS profile
  • Loading branch information
ahmed82 committed Jun 20, 2023
commit 9d176e27d0c0869c268275e4c8c5dc6e2876233e
6 changes: 2 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -233,10 +233,8 @@ docker: $(RELEASE_IMAGES:%=%-docker) ccaasbuilder
.PHONY: $(RELEASE_IMAGES:%=%-docker)
$(RELEASE_IMAGES:%=%-docker): %-docker: $(BUILD_DIR)/images/%/$(DUMMY)

$(BUILD_DIR)/images/baseos/$(DUMMY): BUILD_CONTEXT=images/baseos
$(BUILD_DIR)/images/ccenv/$(DUMMY): BUILD_CONTEXT=images/ccenv
$(BUILD_DIR)/images/peer/$(DUMMY): BUILD_ARGS=--build-arg GO_TAGS=${GO_TAGS}
$(BUILD_DIR)/images/orderer/$(DUMMY): BUILD_ARGS=--build-arg GO_TAGS=${GO_TAGS}


$(BUILD_DIR)/images/tools/$(DUMMY): BUILD_ARGS=--build-arg GO_TAGS=${GO_TAGS}

$(BUILD_DIR)/images/%/$(DUMMY):
4 changes: 3 additions & 1 deletion internal/configtxgen/genesisconfig/config.go
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ const (
// EtcdRaft The type key for etcd based RAFT consensus.
EtcdRaft = "etcdraft"

// Bdls The type key for etcd based Bdls consensus.
// Bdls The type key for Bdls based consensus.
Bdls = "bdls"
)

@@ -77,6 +77,8 @@ const (
// AdminRoleAdminPrincipal is set as AdminRole to cause the MSP role of
// type Admin to be used as the admin principal default
AdminRoleAdminPrincipal = "Role.ADMIN"

channelUsingBdls = "ChannelUsingBdls"
)

// TopLevel consists of the structs used by the configtxgen tool.
4 changes: 2 additions & 2 deletions orderer/consensus/bdls/chain.go
Original file line number Diff line number Diff line change
@@ -289,8 +289,8 @@ func NewChain(
return c, nil
}

// GetLatestState returns latest state
func (c *Chain) GetLatestState() (height uint64, round uint64, data bdls.State) {
// GetLatestBdlsState returns latest state
func (c *Chain) GetLatestBdlsState() (height uint64, round uint64, data bdls.State) {
c.statusReportMutex.Lock()
defer c.statusReportMutex.Unlock()
return c.consensus.CurrentState()
188 changes: 34 additions & 154 deletions sampleconfig/configtx.yaml
Original file line number Diff line number Diff line change
@@ -257,130 +257,10 @@ Application: &ApplicationDefaults
################################################################################
Orderer: &OrdererDefaults

# Orderer Type: The orderer implementation to start.
# Available types are "solo", "kafka" and "etcdraft".
OrdererType: solo

# Addresses used to be the list of orderer addresses that clients and peers
# could connect to. However, this does not allow clients to associate orderer
# addresses and orderer organizations which can be useful for things such
# as TLS validation. The preferred way to specify orderer addresses is now
# to include the OrdererEndpoints item in your org definition
Addresses:
# - 127.0.0.1:7050

# Batch Timeout: The amount of time to wait before creating a batch.
BatchTimeout: 2s

# Batch Size: Controls the number of messages batched into a block.
# The orderer views messages opaquely, but typically, messages may
# be considered to be Fabric transactions. The 'batch' is the group
# of messages in the 'data' field of the block. Blocks will be a few kb
# larger than the batch size, when signatures, hashes, and other metadata
# is applied.
BatchSize:

# Max Message Count: The maximum number of messages to permit in a
# batch. No block will contain more than this number of messages.
MaxMessageCount: 500

# Absolute Max Bytes: The absolute maximum number of bytes allowed for
# the serialized messages in a batch. The maximum block size is this value
# plus the size of the associated metadata (usually a few KB depending
# upon the size of the signing identities). Any transaction larger than
# this value will be rejected by ordering.
# It is recommended not to exceed 49 MB, given the default grpc max message size of 100 MB
# configured on orderer and peer nodes (and allowing for message expansion during communication).
AbsoluteMaxBytes: 10 MB

# Preferred Max Bytes: The preferred maximum number of bytes allowed
# for the serialized messages in a batch. Roughly, this field may be considered
# the best effort maximum size of a batch. A batch will fill with messages
# until this size is reached (or the max message count, or batch timeout is
# exceeded). If adding a new message to the batch would cause the batch to
# exceed the preferred max bytes, then the current batch is closed and written
# to a block, and a new batch containing the new message is created. If a
# message larger than the preferred max bytes is received, then its batch
# will contain only that message. Because messages may be larger than
# preferred max bytes (up to AbsoluteMaxBytes), some batches may exceed
# the preferred max bytes, but will always contain exactly one transaction.
PreferredMaxBytes: 2 MB

# Max Channels is the maximum number of channels to allow on the ordering
# network. When set to 0, this implies no maximum number of channels.
MaxChannels: 0

ConsenterMapping:
- ID: 1
Host: bft0.example.com
Port: 7050
MSPID: OrdererOrg1
Identity: /path/to/identity
- ID: 2
Host: bft1.example.com
Port: 7050
MSPID: OrdererOrg2
Identity: /path/to/identity
- ID: 3
Host: bft2.example.com
Port: 7050
MSPID: OrdererOrg3
Identity: /path/to/identity
- ID: 4
Host: bft3.example.com
Port: 7050
MSPID: OrdererOrg4
Identity: /path/to/identity

# EtcdRaft defines configuration which must be set when the "etcdraft"
# orderertype is chosen.
EtcdRaft:
# The set of Raft replicas for this network. For the etcd/raft-based
# implementation, we expect every replica to also be an OSN. Therefore,
# a subset of the host:port items enumerated in this list should be
# replicated under the Orderer.Addresses key above.
Consenters:
- Host: raft0.example.com
Port: 7050
ClientTLSCert: path/to/ClientTLSCert0
ServerTLSCert: path/to/ServerTLSCert0
- Host: raft1.example.com
Port: 7050
ClientTLSCert: path/to/ClientTLSCert1
ServerTLSCert: path/to/ServerTLSCert1
- Host: raft2.example.com
Port: 7050
ClientTLSCert: path/to/ClientTLSCert2
ServerTLSCert: path/to/ServerTLSCert2

# Options to be specified for all the etcd/raft nodes. The values here
# are the defaults for all new channels and can be modified on a
# per-channel basis via configuration updates.
Options:
# TickInterval is the time interval between two Node.Tick invocations.
TickInterval: 500ms

# ElectionTick is the number of Node.Tick invocations that must pass
# between elections. That is, if a follower does not receive any
# message from the leader of current term before ElectionTick has
# elapsed, it will become candidate and start an election.
# ElectionTick must be greater than HeartbeatTick.
ElectionTick: 10

# HeartbeatTick is the number of Node.Tick invocations that must
# pass between heartbeats. That is, a leader sends heartbeat
# messages to maintain its leadership every HeartbeatTick ticks.
HeartbeatTick: 1

# MaxInflightBlocks limits the max number of in-flight append messages
# during optimistic replication phase.
MaxInflightBlocks: 5

# SnapshotIntervalSize defines number of bytes per which a snapshot is taken
SnapshotIntervalSize: 16 MB

# Bdls defines configuration which must be set when the "Bdls"
# orderertype is chosen.
OrdererType: Bdls

Bdls:
# The set of Bdls replicas for this network. For the Bdls-based
# implementation, we expect every replica to also be an OSN. Therefore,
@@ -409,8 +289,6 @@ Orderer: &OrdererDefaults
# per-channel basis via configuration updates.
Options:

Epoch: 500ms

CurrentHeight: 0

# Organizations lists the orgs participating on the orderer side of the
@@ -653,13 +531,23 @@ Profiles:
Type: Signature
Rule: "OR('SampleOrg.member')"

# SampleDevModeBdls defines a configuration that differs from the
# SampleDevModeSolo one only in that it uses the Bdls-based orderer.
SampleDevModeBdls:

# SampleAppChannelInsecureSolo defines an application channel configuration
# which uses the Solo orderer and contains no MSP definitions.
SampleAppChannelInsecureSolo:
<<: *ChannelDefaults
Orderer:
<<: *OrdererDefaults
OrdererType: Bdls
Application:
<<: *ApplicationDefaults

# SampleAppChannelEtcdRaft defines an application channel configuration
# that uses the etcd/raft-based orderer.
SampleAppChannelEtcdRaft:
<<: *ChannelDefaults
Orderer:
<<: *OrdererDefaults
OrdererType: etcdraft
Organizations:
- <<: *SampleOrg
Policies:
@@ -676,32 +564,15 @@ Profiles:
Admins:
Type: Signature
Rule: "OR('SampleOrg.member')"
Consortiums:
SampleConsortium:
Organizations:
- <<: *SampleOrg
Policies:
<<: *SampleOrgPolicies
Admins:
Type: Signature
Rule: "OR('SampleOrg.member')"

# SampleAppChannelInsecureSolo defines an application channel configuration
# which uses the Solo orderer and contains no MSP definitions.
SampleAppChannelInsecureSolo:
<<: *ChannelDefaults
Orderer:
<<: *OrdererDefaults
Application:
<<: *ApplicationDefaults

# SampleAppChannelEtcdRaft defines an application channel configuration
# that uses the etcd/raft-based orderer.
SampleAppChannelEtcdRaft:
# SampleAppChannelBdls defines an application channel configuration
# that uses the Bdls-based orderer.
SampleAppChannelBdls:
<<: *ChannelDefaults
Consortium: SampleConsortium
Orderer:
<<: *OrdererDefaults
OrdererType: etcdraft
# OrdererType: Bdls
Organizations:
- <<: *SampleOrg
Policies:
@@ -718,10 +589,9 @@ Profiles:
Admins:
Type: Signature
Rule: "OR('SampleOrg.member')"

# SampleAppChannelBdls defines an application channel configuration
# that uses the Bdls-based orderer.
SampleAppChannelBdls:
# SampleDevModeBdls defines a configuration that differs from the
# SampleDevModeSolo one only in that it uses the Bdls-based orderer.
SampleDevModeBdls:
<<: *ChannelDefaults
Orderer:
<<: *OrdererDefaults
@@ -742,3 +612,13 @@ Profiles:
Admins:
Type: Signature
Rule: "OR('SampleOrg.member')"
Consortiums:
SampleConsortium:
Organizations:
- <<: *SampleOrg
Policies:
<<: *SampleOrgPolicies
Admins:
Type: Signature
Rule: "OR('SampleOrg.member')"

77 changes: 0 additions & 77 deletions sampleconfig/orderer.yaml
Original file line number Diff line number Diff line change
@@ -12,83 +12,6 @@
#
################################################################################
General:
# Listen address: The IP on which to bind to listen.
ListenAddress: 127.0.0.1

# Listen port: The port on which to bind to listen.
ListenPort: 7050

# TLS: TLS settings for the GRPC server.
TLS:
# Require server-side TLS
Enabled: false
# PrivateKey governs the file location of the private key of the TLS certificate.
PrivateKey: tls/server.key
# Certificate governs the file location of the server TLS certificate.
Certificate: tls/server.crt
# RootCAs contains a list of additional root certificates used for verifying certificates
# of other orderer nodes during outbound connections.
# It is not required to be set, but can be used to augment the set of TLS CA certificates
# available from the MSPs of each channel’s configuration.
RootCAs:
- tls/ca.crt
# Require client certificates / mutual TLS for inbound connections.
ClientAuthRequired: false
# If mutual TLS is enabled, ClientRootCAs contains a list of additional root certificates
# used for verifying certificates of client connections.
# It is not required to be set, but can be used to augment the set of TLS CA certificates
# available from the MSPs of each channel’s configuration.
ClientRootCAs:
# Keepalive settings for the GRPC server.
Keepalive:
# ServerMinInterval is the minimum permitted time between client pings.
# If clients send pings more frequently, the server will
# disconnect them.
ServerMinInterval: 60s
# ServerInterval is the time between pings to clients.
ServerInterval: 7200s
# ServerTimeout is the duration the server waits for a response from
# a client before closing the connection.
ServerTimeout: 20s

# Since all nodes should be consistent it is recommended to keep
# the default value of 100MB for MaxRecvMsgSize & MaxSendMsgSize
# Max message size in bytes the GRPC server and client can receive
MaxRecvMsgSize: 104857600
# Max message size in bytes the GRPC server and client can send
MaxSendMsgSize: 104857600

# Cluster settings for ordering service nodes that communicate with other ordering service nodes
# such as Raft based ordering service.
Cluster:
# SendBufferSize is the maximum number of messages in the egress buffer.
# Consensus messages are dropped if the buffer is full, and transaction
# messages are waiting for space to be freed.
SendBufferSize: 100

# ClientCertificate governs the file location of the client TLS certificate
# used to establish mutual TLS connections with other ordering service nodes.
# If not set, the server General.TLS.Certificate is re-used.
ClientCertificate:
# ClientPrivateKey governs the file location of the private key of the client TLS certificate.
# If not set, the server General.TLS.PrivateKey is re-used.
ClientPrivateKey:

# The below 4 properties should be either set together, or be unset together.
# If they are set, then the orderer node uses a separate listener for intra-cluster
# communication. If they are unset, then the general orderer listener is used.
# This is useful if you want to use a different TLS server certificates on the
# client-facing and the intra-cluster listeners.

# ListenPort defines the port on which the cluster listens to connections.
ListenPort:
# ListenAddress defines the IP on which to listen to intra-cluster communication.
ListenAddress:
# ServerCertificate defines the file location of the server TLS certificate used for intra-cluster
# communication.
ServerCertificate:
# ServerPrivateKey defines the file location of the private key of the TLS certificate.
ServerPrivateKey:

# Bootstrap method: The method by which to obtain the bootstrap block
# system channel is specified. The option can be one of: