Based Fabric v2.0.1
with v1.x
different version, v2
version of the protos
definitions in a separate warehouse fabric-protos management, and use of protoc
specific language code means it is also used to generate a separate warehouse storage, such as a golang
version of fabric-protos-Go .
一、 Orderer
1. AtomicBroadcast
Service definition to orderer / ab.proto
service AtomicBroadcast {
// broadcast receives a reply of Acknowledgement for each common.Envelope in order, indicating success or type of failure
rpc Broadcast(stream common.Envelope) returns (stream BroadcastResponse);
// deliver first requires an Envelope of type DELIVER_SEEK_INFO with Payload data as a mashaled SeekInfo message, then a stream of block replies is received.
rpc Deliver(stream common.Envelope) returns (stream DeliverResponse);
}
1.1 Broadcast
Broadcast
An interface for receiving messages to be sorted, including ordinary transaction tx
message and a channel
configuration message.
The client transaction message is submitted to endorsing peers
a pre-execution chaincode
and endorsement read result set, return the results to the client to Orderer
be sorted.
1.2 Deliver
Deliver
The interface is used peers
have been sorted distribution block
data peer
node join channel
from the Orderer
sorted acquired block
.
2. Cluster
Service definition to orderer / cluster.proto
// Cluster defines communication between cluster members.
service Cluster {
// Step passes an implementation-specific message to another cluster member.
rpc Step(stream StepRequest) returns (stream StepResponse);
}
Fabric v1.1 supports the following EtcdRaft
consensus algorithm, and using Kafka
consensus algorithms of various orderer
centers of independent connection kafka
cluster different, using the EtcdRaft
consensus algorithm each orderer
consisting of a cluster, Step
for the exchange of messages between cluster nodes.
Two, Peer
1. Endorser
Service definition to peer / peer.proto
service Endorser {
rpc ProcessProposal(SignedProposal) returns (ProposalResponse);
}
ProcessProposal
Transaction message interface for the client to submit the signed endorsing peers
pre-set to perform read and write and endorsement. It refers to the so-called pre-execution performed using current local state books chaincode
generated set of read and write, but the execution result is not written books.
2. Deliver
Service definition to peer / events.proto
service Deliver {
// Deliver first requires an Envelope of type ab.DELIVER_SEEK_INFO with
// Payload data as a marshaled orderer.SeekInfo message,
// then a stream of block replies is received
rpc Deliver (stream common.Envelope) returns (stream DeliverResponse) {
}
// DeliverFiltered first requires an Envelope of type ab.DELIVER_SEEK_INFO with
// Payload data as a marshaled orderer.SeekInfo message,
// then a stream of **filtered** block replies is received
rpc DeliverFiltered (stream common.Envelope) returns (stream DeliverResponse) {
}
// DeliverWithPrivateData first requires an Envelope of type ab.DELIVER_SEEK_INFO with
// Payload data as a marshaled orderer.SeekInfo message,
// then a stream of block and private data replies is received
rpc DeliverWithPrivateData (stream common.Envelope) returns (stream DeliverResponse) {
}
}
2.1 Deliver & DeliverFiltered
Deliver
The client interface is used to distribute the books have been written to the local block
data. The client will endorsing peers
return the results submitted to the orderer
post, waiting for peer
the notification transaction is completed.
2.2 DeliverWithPrivateData
DeliverWithPrivateData
v2.0 version of the new, private data with the distribution of block
data
Three, Chaincode
1. ChaincodeSupport
Service definition to peer / chaincode_shim.proto
// Interface that provides support to chaincode execution. ChaincodeContext
// provides the context necessary for the server to respond appropriately.
service ChaincodeSupport {
rpc Register(stream ChaincodeMessage) returns (stream ChaincodeMessage);
}
Register
For Chaincode
when you start to peer
RegisterChaincode
2. Chaincode
Service definition to peer / chaincode_shim.proto
// Chaincode as a server - peer establishes a connection to the chaincode as a client
// Currently only supports a stream connection.
service Chaincode {
rpc Connect(stream ChaincodeMessage) returns (stream ChaincodeMessage);
}
v2
New service, Chaincode
start and end as a service by peer
via Connect
the connection interfaceChaincode
Four, Gossip
Service definition to gossip / message.proto
// Gossip
service Gossip {
// GossipStream is the gRPC stream used for sending and receiving messages
rpc GossipStream (stream Envelope) returns (stream Envelope);
// Ping is used to probe a remote peer's aliveness
rpc Ping (Empty) returns (Empty);
}
To alleviate Orderer
the pressure, the organization only a few peer
connections orderer
for the latest block
, within each organization peer
through Gossip
the Internet, through the Gossip
exchange of block
data and private data.
五、Discovery
Service definition in discovery / protocol.proto
// Discovery defines a service that serves information about the fabric network
// like which peers, orderers, chaincodes, etc.
service Discovery {
// Discover receives a signed request, and returns a response.
rpc Discover (SignedRequest) returns (Response);
}
Discovery
Convenient service for clients to obtain the overall Fabric
condition of the network, only need to know a query to the initial node can be channel
in the peers
, config
, membership
, chaincode
and so on.
reference: