/
api.pb.go
executable file
·234 lines (207 loc) · 6.73 KB
/
api.pb.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
// Code generated by protoc-gen-go.
// source: api.proto
// DO NOT EDIT!
/*
Package protos is a generated protocol buffer package.
It is generated from these files:
api.proto
chaincode.proto
devops.proto
events.proto
openchain.proto
server_admin.proto
It has these top-level messages:
BlockchainInfo
BlockNumber
BlockCount
ChaincodeID
ChaincodeInput
ChaincodeSpec
ChaincodeDeploymentSpec
ChaincodeInvocationSpec
ChaincodeIdentifier
ChaincodeRequestContext
ChaincodeExecutionContext
ChaincodeMessage
PutStateInfo
RangeQueryState
RangeQueryStateNext
RangeQueryStateClose
RangeQueryStateKeyValue
RangeQueryStateResponse
Secret
BuildResult
Interest
Register
Generic
OpenchainEvent
Transaction
TransactionBlock
TransactionResult
Block
NonHashData
PeerAddress
PeerID
PeerEndpoint
PeersMessage
HelloMessage
OpenchainMessage
Response
BlockState
SyncBlockRange
SyncBlocks
SyncStateSnapshotRequest
SyncStateSnapshot
SyncStateDeltasRequest
SyncStateDeltas
ServerStatus
*/
package protos
import proto "github.com/golang/protobuf/proto"
import fmt "fmt"
import math "math"
import google_protobuf1 "google/protobuf"
import (
context "golang.org/x/net/context"
grpc "google.golang.org/grpc"
)
// Reference imports to suppress errors if they are not otherwise used.
var _ = proto.Marshal
var _ = fmt.Errorf
var _ = math.Inf
// Contains information about the blockchain ledger such as height, current
// block hash, and previous block hash.
type BlockchainInfo struct {
Height uint64 `protobuf:"varint,1,opt,name=height" json:"height,omitempty"`
CurrentBlockHash []byte `protobuf:"bytes,2,opt,name=currentBlockHash,proto3" json:"currentBlockHash,omitempty"`
PreviousBlockHash []byte `protobuf:"bytes,3,opt,name=previousBlockHash,proto3" json:"previousBlockHash,omitempty"`
}
func (m *BlockchainInfo) Reset() { *m = BlockchainInfo{} }
func (m *BlockchainInfo) String() string { return proto.CompactTextString(m) }
func (*BlockchainInfo) ProtoMessage() {}
// Specifies the block number to be returned from the blockchain.
type BlockNumber struct {
Number uint64 `protobuf:"varint,1,opt,name=number" json:"number,omitempty"`
}
func (m *BlockNumber) Reset() { *m = BlockNumber{} }
func (m *BlockNumber) String() string { return proto.CompactTextString(m) }
func (*BlockNumber) ProtoMessage() {}
// Specifies the current number of blocks in the blockchain.
type BlockCount struct {
Count uint64 `protobuf:"varint,1,opt,name=count" json:"count,omitempty"`
}
func (m *BlockCount) Reset() { *m = BlockCount{} }
func (m *BlockCount) String() string { return proto.CompactTextString(m) }
func (*BlockCount) ProtoMessage() {}
// Reference imports to suppress errors if they are not otherwise used.
var _ context.Context
var _ grpc.ClientConn
// Client API for Openchain service
type OpenchainClient interface {
// GetBlockchainInfo returns information about the blockchain ledger such as
// height, current block hash, and previous block hash.
GetBlockchainInfo(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*BlockchainInfo, error)
// GetBlockByNumber returns the data contained within a specific block in the
// blockchain. The genesis block is block zero.
GetBlockByNumber(ctx context.Context, in *BlockNumber, opts ...grpc.CallOption) (*Block, error)
// GetBlockCount returns the current number of blocks in the blockchain data
// structure.
GetBlockCount(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*BlockCount, error)
}
type openchainClient struct {
cc *grpc.ClientConn
}
func NewOpenchainClient(cc *grpc.ClientConn) OpenchainClient {
return &openchainClient{cc}
}
func (c *openchainClient) GetBlockchainInfo(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*BlockchainInfo, error) {
out := new(BlockchainInfo)
err := grpc.Invoke(ctx, "/protos.Openchain/GetBlockchainInfo", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *openchainClient) GetBlockByNumber(ctx context.Context, in *BlockNumber, opts ...grpc.CallOption) (*Block, error) {
out := new(Block)
err := grpc.Invoke(ctx, "/protos.Openchain/GetBlockByNumber", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *openchainClient) GetBlockCount(ctx context.Context, in *google_protobuf1.Empty, opts ...grpc.CallOption) (*BlockCount, error) {
out := new(BlockCount)
err := grpc.Invoke(ctx, "/protos.Openchain/GetBlockCount", in, out, c.cc, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// Server API for Openchain service
type OpenchainServer interface {
// GetBlockchainInfo returns information about the blockchain ledger such as
// height, current block hash, and previous block hash.
GetBlockchainInfo(context.Context, *google_protobuf1.Empty) (*BlockchainInfo, error)
// GetBlockByNumber returns the data contained within a specific block in the
// blockchain. The genesis block is block zero.
GetBlockByNumber(context.Context, *BlockNumber) (*Block, error)
// GetBlockCount returns the current number of blocks in the blockchain data
// structure.
GetBlockCount(context.Context, *google_protobuf1.Empty) (*BlockCount, error)
}
func RegisterOpenchainServer(s *grpc.Server, srv OpenchainServer) {
s.RegisterService(&_Openchain_serviceDesc, srv)
}
func _Openchain_GetBlockchainInfo_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(google_protobuf1.Empty)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(OpenchainServer).GetBlockchainInfo(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _Openchain_GetBlockByNumber_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(BlockNumber)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(OpenchainServer).GetBlockByNumber(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
func _Openchain_GetBlockCount_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error) (interface{}, error) {
in := new(google_protobuf1.Empty)
if err := dec(in); err != nil {
return nil, err
}
out, err := srv.(OpenchainServer).GetBlockCount(ctx, in)
if err != nil {
return nil, err
}
return out, nil
}
var _Openchain_serviceDesc = grpc.ServiceDesc{
ServiceName: "protos.Openchain",
HandlerType: (*OpenchainServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetBlockchainInfo",
Handler: _Openchain_GetBlockchainInfo_Handler,
},
{
MethodName: "GetBlockByNumber",
Handler: _Openchain_GetBlockByNumber_Handler,
},
{
MethodName: "GetBlockCount",
Handler: _Openchain_GetBlockCount_Handler,
},
},
Streams: []grpc.StreamDesc{},
}