Documentation ¶
Overview ¶
Package message is a generated protocol buffer package.
It is generated from these files:
common.proto service.proto stream.proto
It has these top-level messages:
Empty Transaction TxData Params Envelope StreamMessage Block ConnectionEstablish PeerTable Peer ConsensusMessage View ElectionMessage
Index ¶
- Variables
- func RegisterPeerServiceServer(s *grpc.Server, srv PeerServiceServer)
- func RegisterStreamServiceServer(s *grpc.Server, srv StreamServiceServer)
- func RegisterTransactionServiceServer(s *grpc.Server, srv TransactionServiceServer)
- type Block
- type ConnectionEstablish
- type ConsensusMessage
- func (*ConsensusMessage) Descriptor() ([]byte, []int)
- func (m *ConsensusMessage) GetBlock() *Block
- func (m *ConsensusMessage) GetConsensusID() string
- func (m *ConsensusMessage) GetMsgType() int32
- func (m *ConsensusMessage) GetSenderID() string
- func (m *ConsensusMessage) GetSequenceID() int64
- func (m *ConsensusMessage) GetView() *View
- func (*ConsensusMessage) ProtoMessage()
- func (m *ConsensusMessage) Reset()
- func (m *ConsensusMessage) String() string
- type ElectionMessage
- func (*ElectionMessage) Descriptor() ([]byte, []int)
- func (m *ElectionMessage) GetLastBlockHash() string
- func (m *ElectionMessage) GetMsgType() int32
- func (m *ElectionMessage) GetPeerIDs() []string
- func (m *ElectionMessage) GetSenderID() string
- func (m *ElectionMessage) GetTerm() int64
- func (*ElectionMessage) ProtoMessage()
- func (m *ElectionMessage) Reset()
- func (m *ElectionMessage) String() string
- type Empty
- type Envelope
- func (*Envelope) Descriptor() ([]byte, []int)
- func (envelope *Envelope) GetMessage() (*StreamMessage, error)
- func (m *Envelope) GetPayload() []byte
- func (m *Envelope) GetPubkey() []byte
- func (m *Envelope) GetSignature() []byte
- func (*Envelope) ProtoMessage()
- func (m *Envelope) Reset()
- func (m *Envelope) String() string
- type Params
- type Peer
- type PeerServiceClient
- type PeerServiceServer
- type PeerTable
- type StreamMessage
- func (*StreamMessage) Descriptor() ([]byte, []int)
- func (m *StreamMessage) GetBlock() *Block
- func (m *StreamMessage) GetChannel() []byte
- func (m *StreamMessage) GetConnectionEstablish() *ConnectionEstablish
- func (m *StreamMessage) GetConsensusMessage() *ConsensusMessage
- func (m *StreamMessage) GetContent() isStreamMessage_Content
- func (m *StreamMessage) GetElectionMessage() *ElectionMessage
- func (m *StreamMessage) GetPeer() *Peer
- func (m *StreamMessage) GetPeerTable() *PeerTable
- func (m *StreamMessage) GetTransaction() *Transaction
- func (*StreamMessage) ProtoMessage()
- func (m *StreamMessage) Reset()
- func (m *StreamMessage) String() string
- func (*StreamMessage) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, ...)
- type StreamMessage_Block
- type StreamMessage_ConnectionEstablish
- type StreamMessage_ConsensusMessage
- type StreamMessage_ElectionMessage
- type StreamMessage_Peer
- type StreamMessage_PeerTable
- type StreamMessage_Transaction
- type StreamServiceClient
- type StreamServiceServer
- type StreamService_StreamClient
- type StreamService_StreamServer
- type Transaction
- func (*Transaction) Descriptor() ([]byte, []int)
- func (m *Transaction) GetInvokePeerID() string
- func (m *Transaction) GetTimeStamp() int64
- func (m *Transaction) GetTransactionHash() string
- func (m *Transaction) GetTransactionID() string
- func (m *Transaction) GetTransactionStatus() Transaction_Status
- func (m *Transaction) GetTransactionType() int32
- func (m *Transaction) GetTxData() *TxData
- func (*Transaction) ProtoMessage()
- func (m *Transaction) Reset()
- func (m *Transaction) String() string
- type TransactionServiceClient
- type TransactionServiceServer
- type Transaction_Status
- type TxData
- type TxData_TxDataType
- type View
Constants ¶
This section is empty.
Variables ¶
View Source
var Transaction_Status_name = map[int32]string{
0: "UNCONFIRMED",
1: "CONFIRMED",
2: "UNKNOWN",
}
View Source
var Transaction_Status_value = map[string]int32{
"UNCONFIRMED": 0,
"CONFIRMED": 1,
"UNKNOWN": 2,
}
View Source
var TxData_TxDataType_name = map[int32]string{
0: "Invoke",
1: "Query",
}
View Source
var TxData_TxDataType_value = map[string]int32{
"Invoke": 0,
"Query": 1,
}
Functions ¶
func RegisterPeerServiceServer ¶
func RegisterPeerServiceServer(s *grpc.Server, srv PeerServiceServer)
func RegisterStreamServiceServer ¶
func RegisterStreamServiceServer(s *grpc.Server, srv StreamServiceServer)
func RegisterTransactionServiceServer ¶
func RegisterTransactionServiceServer(s *grpc.Server, srv TransactionServiceServer)
Types ¶
type Block ¶
type Block struct {
Data []byte `protobuf:"bytes,1,opt,name=data,proto3" json:"data,omitempty"`
}
func (*Block) Descriptor ¶
func (*Block) ProtoMessage ¶
func (*Block) ProtoMessage()
type ConnectionEstablish ¶
type ConnectionEstablish struct { }
func (*ConnectionEstablish) Descriptor ¶
func (*ConnectionEstablish) Descriptor() ([]byte, []int)
func (*ConnectionEstablish) ProtoMessage ¶
func (*ConnectionEstablish) ProtoMessage()
func (*ConnectionEstablish) Reset ¶
func (m *ConnectionEstablish) Reset()
func (*ConnectionEstablish) String ¶
func (m *ConnectionEstablish) String() string
type ConsensusMessage ¶
type ConsensusMessage struct { ConsensusID string `protobuf:"bytes,1,opt,name=ConsensusID" json:"ConsensusID,omitempty"` View *View `protobuf:"bytes,2,opt,name=View" json:"View,omitempty"` SequenceID int64 `protobuf:"varint,3,opt,name=SequenceID" json:"SequenceID,omitempty"` Block *Block `protobuf:"bytes,4,opt,name=Block" json:"Block,omitempty"` SenderID string `protobuf:"bytes,5,opt,name=SenderID" json:"SenderID,omitempty"` MsgType int32 `protobuf:"varint,6,opt,name=MsgType" json:"MsgType,omitempty"` }
func (*ConsensusMessage) Descriptor ¶
func (*ConsensusMessage) Descriptor() ([]byte, []int)
func (*ConsensusMessage) GetBlock ¶
func (m *ConsensusMessage) GetBlock() *Block
func (*ConsensusMessage) GetConsensusID ¶
func (m *ConsensusMessage) GetConsensusID() string
func (*ConsensusMessage) GetMsgType ¶
func (m *ConsensusMessage) GetMsgType() int32
func (*ConsensusMessage) GetSenderID ¶
func (m *ConsensusMessage) GetSenderID() string
func (*ConsensusMessage) GetSequenceID ¶
func (m *ConsensusMessage) GetSequenceID() int64
func (*ConsensusMessage) GetView ¶
func (m *ConsensusMessage) GetView() *View
func (*ConsensusMessage) ProtoMessage ¶
func (*ConsensusMessage) ProtoMessage()
func (*ConsensusMessage) Reset ¶
func (m *ConsensusMessage) Reset()
func (*ConsensusMessage) String ¶
func (m *ConsensusMessage) String() string
type ElectionMessage ¶
type ElectionMessage struct { LastBlockHash string `protobuf:"bytes,1,opt,name=LastBlockHash" json:"LastBlockHash,omitempty"` SenderID string `protobuf:"bytes,2,opt,name=SenderID" json:"SenderID,omitempty"` MsgType int32 `protobuf:"varint,3,opt,name=MsgType" json:"MsgType,omitempty"` Term int64 `protobuf:"varint,4,opt,name=Term" json:"Term,omitempty"` PeerIDs []string `protobuf:"bytes,5,rep,name=PeerIDs" json:"PeerIDs,omitempty"` }
func (*ElectionMessage) Descriptor ¶
func (*ElectionMessage) Descriptor() ([]byte, []int)
func (*ElectionMessage) GetLastBlockHash ¶
func (m *ElectionMessage) GetLastBlockHash() string
func (*ElectionMessage) GetMsgType ¶
func (m *ElectionMessage) GetMsgType() int32
func (*ElectionMessage) GetPeerIDs ¶
func (m *ElectionMessage) GetPeerIDs() []string
func (*ElectionMessage) GetSenderID ¶
func (m *ElectionMessage) GetSenderID() string
func (*ElectionMessage) GetTerm ¶
func (m *ElectionMessage) GetTerm() int64
func (*ElectionMessage) ProtoMessage ¶
func (*ElectionMessage) ProtoMessage()
func (*ElectionMessage) Reset ¶
func (m *ElectionMessage) Reset()
func (*ElectionMessage) String ¶
func (m *ElectionMessage) String() string
type Empty ¶
type Empty struct { }
func (*Empty) Descriptor ¶
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
type Envelope ¶
type Envelope struct { // marshalled Message Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` // signed Message Signature []byte `protobuf:"bytes,2,opt,name=signature,proto3" json:"signature,omitempty"` // sender's public key Pubkey []byte `protobuf:"bytes,3,opt,name=pubkey,proto3" json:"pubkey,omitempty"` }
func (*Envelope) Descriptor ¶
func (*Envelope) GetMessage ¶
func (envelope *Envelope) GetMessage() (*StreamMessage, error)
func (*Envelope) GetPayload ¶
func (*Envelope) GetSignature ¶
func (*Envelope) ProtoMessage ¶
func (*Envelope) ProtoMessage()
type Params ¶
type Params struct { ParamsType int32 `protobuf:"varint,1,opt,name=ParamsType" json:"ParamsType,omitempty"` Function string `protobuf:"bytes,2,opt,name=Function" json:"Function,omitempty"` Args []string `protobuf:"bytes,3,rep,name=Args" json:"Args,omitempty"` }
func (*Params) Descriptor ¶
func (*Params) GetFunction ¶
func (*Params) GetParamsType ¶
func (*Params) ProtoMessage ¶
func (*Params) ProtoMessage()
type Peer ¶
type Peer struct { IpAddress string `protobuf:"bytes,1,opt,name=ipAddress" json:"ipAddress,omitempty"` Port string `protobuf:"bytes,2,opt,name=port" json:"port,omitempty"` PeerID string `protobuf:"bytes,3,opt,name=peerID" json:"peerID,omitempty"` HeartBeat int32 `protobuf:"varint,4,opt,name=heartBeat" json:"heartBeat,omitempty"` PubKey []byte `protobuf:"bytes,5,opt,name=pubKey,proto3" json:"pubKey,omitempty"` }
func (*Peer) Descriptor ¶
func (*Peer) GetHeartBeat ¶
func (*Peer) GetIpAddress ¶
func (*Peer) ProtoMessage ¶
func (*Peer) ProtoMessage()
type PeerServiceClient ¶
type PeerServiceClient interface {
GetPeer(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*Peer, error)
}
func NewPeerServiceClient ¶
func NewPeerServiceClient(cc *grpc.ClientConn) PeerServiceClient
type PeerServiceServer ¶
type PeerTable ¶
type PeerTable struct { MyID string `protobuf:"bytes,1,opt,name=MyID" json:"MyID,omitempty"` PeerMap map[string]*Peer `` /* 134-byte string literal not displayed */ }
func (*PeerTable) Descriptor ¶
func (*PeerTable) GetPeerMap ¶
func (*PeerTable) ProtoMessage ¶
func (*PeerTable) ProtoMessage()
type StreamMessage ¶
type StreamMessage struct { Channel []byte `protobuf:"bytes,1,opt,name=channel,proto3" json:"channel,omitempty"` // Types that are valid to be assigned to Content: // *StreamMessage_Block // *StreamMessage_Transaction // *StreamMessage_PeerTable // *StreamMessage_ConsensusMessage // *StreamMessage_Peer // *StreamMessage_ConnectionEstablish // *StreamMessage_ElectionMessage Content isStreamMessage_Content `protobuf_oneof:"content"` }
func (*StreamMessage) Descriptor ¶
func (*StreamMessage) Descriptor() ([]byte, []int)
func (*StreamMessage) GetBlock ¶
func (m *StreamMessage) GetBlock() *Block
func (*StreamMessage) GetChannel ¶
func (m *StreamMessage) GetChannel() []byte
func (*StreamMessage) GetConnectionEstablish ¶
func (m *StreamMessage) GetConnectionEstablish() *ConnectionEstablish
func (*StreamMessage) GetConsensusMessage ¶
func (m *StreamMessage) GetConsensusMessage() *ConsensusMessage
func (*StreamMessage) GetContent ¶
func (m *StreamMessage) GetContent() isStreamMessage_Content
func (*StreamMessage) GetElectionMessage ¶
func (m *StreamMessage) GetElectionMessage() *ElectionMessage
func (*StreamMessage) GetPeer ¶
func (m *StreamMessage) GetPeer() *Peer
func (*StreamMessage) GetPeerTable ¶
func (m *StreamMessage) GetPeerTable() *PeerTable
func (*StreamMessage) GetTransaction ¶
func (m *StreamMessage) GetTransaction() *Transaction
func (*StreamMessage) ProtoMessage ¶
func (*StreamMessage) ProtoMessage()
func (*StreamMessage) Reset ¶
func (m *StreamMessage) Reset()
func (*StreamMessage) String ¶
func (m *StreamMessage) String() string
func (*StreamMessage) XXX_OneofFuncs ¶
func (*StreamMessage) XXX_OneofFuncs() (func(msg proto.Message, b *proto.Buffer) error, func(msg proto.Message, tag, wire int, b *proto.Buffer) (bool, error), func(msg proto.Message) (n int), []interface{})
XXX_OneofFuncs is for the internal use of the proto package.
type StreamMessage_Block ¶
type StreamMessage_Block struct {
Block *Block `protobuf:"bytes,2,opt,name=block,oneof"`
}
type StreamMessage_ConnectionEstablish ¶
type StreamMessage_ConnectionEstablish struct {
ConnectionEstablish *ConnectionEstablish `protobuf:"bytes,7,opt,name=connectionEstablish,oneof"`
}
type StreamMessage_ConsensusMessage ¶
type StreamMessage_ConsensusMessage struct {
ConsensusMessage *ConsensusMessage `protobuf:"bytes,5,opt,name=consensusMessage,oneof"`
}
type StreamMessage_ElectionMessage ¶
type StreamMessage_ElectionMessage struct {
ElectionMessage *ElectionMessage `protobuf:"bytes,8,opt,name=electionMessage,oneof"`
}
type StreamMessage_Peer ¶
type StreamMessage_Peer struct {
Peer *Peer `protobuf:"bytes,6,opt,name=peer,oneof"`
}
type StreamMessage_PeerTable ¶
type StreamMessage_PeerTable struct {
PeerTable *PeerTable `protobuf:"bytes,4,opt,name=peerTable,oneof"`
}
type StreamMessage_Transaction ¶
type StreamMessage_Transaction struct {
Transaction *Transaction `protobuf:"bytes,3,opt,name=transaction,oneof"`
}
type StreamServiceClient ¶
type StreamServiceClient interface {
Stream(ctx context.Context, opts ...grpc.CallOption) (StreamService_StreamClient, error)
}
func NewStreamServiceClient ¶
func NewStreamServiceClient(cc *grpc.ClientConn) StreamServiceClient
type StreamServiceServer ¶
type StreamServiceServer interface {
Stream(StreamService_StreamServer) error
}
type Transaction ¶
type Transaction struct { InvokePeerID string `protobuf:"bytes,1,opt,name=InvokePeerID" json:"InvokePeerID,omitempty"` TransactionID string `protobuf:"bytes,2,opt,name=TransactionID" json:"TransactionID,omitempty"` TransactionStatus Transaction_Status `protobuf:"varint,3,opt,name=TransactionStatus,enum=message.Transaction_Status" json:"TransactionStatus,omitempty"` TransactionHash string `protobuf:"bytes,4,opt,name=TransactionHash" json:"TransactionHash,omitempty"` TxData *TxData `protobuf:"bytes,5,opt,name=TxData" json:"TxData,omitempty"` TransactionType int32 `protobuf:"varint,6,opt,name=TransactionType" json:"TransactionType,omitempty"` TimeStamp int64 `protobuf:"varint,7,opt,name=TimeStamp" json:"TimeStamp,omitempty"` }
func (*Transaction) Descriptor ¶
func (*Transaction) Descriptor() ([]byte, []int)
func (*Transaction) GetInvokePeerID ¶
func (m *Transaction) GetInvokePeerID() string
func (*Transaction) GetTimeStamp ¶
func (m *Transaction) GetTimeStamp() int64
func (*Transaction) GetTransactionHash ¶
func (m *Transaction) GetTransactionHash() string
func (*Transaction) GetTransactionID ¶
func (m *Transaction) GetTransactionID() string
func (*Transaction) GetTransactionStatus ¶
func (m *Transaction) GetTransactionStatus() Transaction_Status
func (*Transaction) GetTransactionType ¶
func (m *Transaction) GetTransactionType() int32
func (*Transaction) GetTxData ¶
func (m *Transaction) GetTxData() *TxData
func (*Transaction) ProtoMessage ¶
func (*Transaction) ProtoMessage()
func (*Transaction) Reset ¶
func (m *Transaction) Reset()
func (*Transaction) String ¶
func (m *Transaction) String() string
type TransactionServiceClient ¶
type TransactionServiceClient interface {
PostTransaction(ctx context.Context, in *TxData, opts ...grpc.CallOption) (*Transaction, error)
}
func NewTransactionServiceClient ¶
func NewTransactionServiceClient(cc *grpc.ClientConn) TransactionServiceClient
type TransactionServiceServer ¶
type TransactionServiceServer interface {
PostTransaction(context.Context, *TxData) (*Transaction, error)
}
type Transaction_Status ¶
type Transaction_Status int32
const ( Transaction_UNCONFIRMED Transaction_Status = 0 Transaction_CONFIRMED Transaction_Status = 1 Transaction_UNKNOWN Transaction_Status = 2 )
func (Transaction_Status) EnumDescriptor ¶
func (Transaction_Status) EnumDescriptor() ([]byte, []int)
func (Transaction_Status) String ¶
func (x Transaction_Status) String() string
type TxData ¶
type TxData struct { Jsonrpc string `protobuf:"bytes,1,opt,name=Jsonrpc" json:"Jsonrpc,omitempty"` Method TxData_TxDataType `protobuf:"varint,2,opt,name=Method,enum=message.TxData_TxDataType" json:"Method,omitempty"` Params *Params `protobuf:"bytes,3,opt,name=Params" json:"Params,omitempty"` ContractID string `protobuf:"bytes,4,opt,name=ContractID" json:"ContractID,omitempty"` }
func (*TxData) Descriptor ¶
func (*TxData) GetContractID ¶
func (*TxData) GetJsonrpc ¶
func (*TxData) GetMethod ¶
func (m *TxData) GetMethod() TxData_TxDataType
func (*TxData) ProtoMessage ¶
func (*TxData) ProtoMessage()
type TxData_TxDataType ¶
type TxData_TxDataType int32
const ( TxData_Invoke TxData_TxDataType = 0 TxData_Query TxData_TxDataType = 1 )
func (TxData_TxDataType) EnumDescriptor ¶
func (TxData_TxDataType) EnumDescriptor() ([]byte, []int)
func (TxData_TxDataType) String ¶
func (x TxData_TxDataType) String() string
type View ¶
type View struct { ViewID string `protobuf:"bytes,1,opt,name=ViewID" json:"ViewID,omitempty"` LeaderID string `protobuf:"bytes,2,opt,name=LeaderID" json:"LeaderID,omitempty"` PeerID []string `protobuf:"bytes,3,rep,name=PeerID" json:"PeerID,omitempty"` }
func (*View) Descriptor ¶
func (*View) GetLeaderID ¶
func (*View) ProtoMessage ¶
func (*View) ProtoMessage()
Click to show internal directories.
Click to hide internal directories.