hyperledger-fabric-sdk 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (95) hide show
  1. checksums.yaml +4 -4
  2. data/lib/fabric/block_decoder.rb +299 -0
  3. data/lib/fabric/chaincode_response.rb +47 -0
  4. data/lib/fabric/channel.rb +55 -34
  5. data/lib/fabric/client.rb +107 -25
  6. data/lib/fabric/configuration.rb +12 -4
  7. data/lib/fabric/constants.rb +1 -1
  8. data/lib/fabric/crypto_suite.rb +145 -0
  9. data/lib/fabric/enumerator_queue.rb +26 -0
  10. data/lib/fabric/error.rb +52 -0
  11. data/lib/fabric/event_hub.rb +81 -0
  12. data/lib/fabric/helper.rb +31 -0
  13. data/lib/fabric/identity.rb +25 -19
  14. data/lib/fabric/logger.rb +37 -0
  15. data/lib/fabric/orderer.rb +18 -2
  16. data/lib/fabric/peer.rb +15 -36
  17. data/lib/fabric/proposal.rb +100 -0
  18. data/lib/{protos → fabric/protos}/common/collection_pb.rb +14 -14
  19. data/lib/{protos → fabric/protos}/common/common_pb.rb +37 -36
  20. data/lib/fabric/protos/common/configtx_pb.rb +71 -0
  21. data/lib/{protos → fabric/protos}/common/configuration_pb.rb +13 -13
  22. data/lib/{protos → fabric/protos}/common/ledger_pb.rb +2 -2
  23. data/lib/{protos → fabric/protos}/common/policies_pb.rb +19 -19
  24. data/lib/fabric/protos/discovery/protocol_pb.rb +120 -0
  25. data/lib/{protos → fabric/protos}/discovery/protocol_services_pb.rb +0 -1
  26. data/lib/fabric/protos/gossip/message_pb.rb +233 -0
  27. data/lib/{protos → fabric/protos}/gossip/message_services_pb.rb +0 -1
  28. data/lib/{protos → fabric/protos}/idemix/idemix_pb.rb +37 -37
  29. data/lib/{protos → fabric/protos}/ledger/queryresult/kv_query_result_pb.rb +5 -5
  30. data/lib/fabric/protos/ledger/rwset/kvrwset/kv_rwset_pb.rb +85 -0
  31. data/lib/fabric/protos/ledger/rwset/rwset_pb.rb +46 -0
  32. data/lib/{protos → fabric/protos}/msp/identities_pb.rb +4 -4
  33. data/lib/{protos → fabric/protos}/msp/msp_config_pb.rb +27 -27
  34. data/lib/{protos → fabric/protos}/msp/msp_principal_pb.rb +20 -20
  35. data/lib/fabric/protos/orderer/ab_pb.rb +52 -0
  36. data/lib/{protos → fabric/protos}/orderer/ab_services_pb.rb +0 -1
  37. data/lib/fabric/protos/orderer/cluster_pb.rb +31 -0
  38. data/lib/fabric/protos/orderer/cluster_services_pb.rb +31 -0
  39. data/lib/{protos → fabric/protos}/orderer/configuration_pb.rb +11 -10
  40. data/lib/fabric/protos/orderer/etcdraft/configuration_pb.rb +21 -0
  41. data/lib/{protos → fabric/protos}/orderer/kafka_pb.rb +16 -16
  42. data/lib/{protos → fabric/protos}/peer/admin_pb.rb +12 -12
  43. data/lib/{protos → fabric/protos}/peer/admin_services_pb.rb +0 -1
  44. data/lib/{protos → fabric/protos}/peer/chaincode_event_pb.rb +2 -2
  45. data/lib/fabric/protos/peer/chaincode_pb.rb +60 -0
  46. data/lib/fabric/protos/peer/chaincode_shim_pb.rb +129 -0
  47. data/lib/{protos → fabric/protos}/peer/chaincode_shim_services_pb.rb +0 -1
  48. data/lib/{protos → fabric/protos}/peer/configuration_pb.rb +10 -10
  49. data/lib/fabric/protos/peer/events_pb.rb +45 -0
  50. data/lib/fabric/protos/peer/events_services_pb.rb +34 -0
  51. data/lib/{protos → fabric/protos}/peer/peer_pb.rb +5 -5
  52. data/lib/{protos → fabric/protos}/peer/peer_services_pb.rb +0 -1
  53. data/lib/{protos → fabric/protos}/peer/proposal_pb.rb +13 -13
  54. data/lib/{protos → fabric/protos}/peer/proposal_response_pb.rb +11 -11
  55. data/lib/{protos → fabric/protos}/peer/query_pb.rb +10 -10
  56. data/lib/{protos → fabric/protos}/peer/resources_pb.rb +12 -12
  57. data/lib/{protos → fabric/protos}/peer/signed_cc_dep_spec_pb.rb +3 -3
  58. data/lib/{protos → fabric/protos}/peer/transaction_pb.rb +22 -18
  59. data/lib/fabric/protos/token/prover_pb.rb +66 -0
  60. data/lib/fabric/protos/token/prover_services_pb.rb +33 -0
  61. data/lib/fabric/protos/token/transaction_pb.rb +41 -0
  62. data/lib/{protos → fabric/protos}/transientstore/transientstore_pb.rb +4 -4
  63. data/lib/fabric/queue.rb +26 -0
  64. data/lib/fabric/transaction.rb +51 -0
  65. data/lib/fabric/transaction_info.rb +20 -0
  66. data/lib/fabric/version.rb +1 -1
  67. data/lib/fabric.rb +74 -0
  68. data/lib/fabric_ca/attribute.rb +7 -0
  69. data/lib/fabric_ca/client.rb +11 -19
  70. data/lib/fabric_ca/configuration.rb +4 -2
  71. data/lib/fabric_ca/connection.rb +22 -20
  72. data/lib/fabric_ca/error.rb +3 -2
  73. data/lib/fabric_ca/faraday_middleware/basic_auth.rb +3 -3
  74. data/lib/fabric_ca/faraday_middleware/raise_http_exception.rb +13 -13
  75. data/lib/fabric_ca/faraday_middleware/token_auth.rb +10 -12
  76. data/lib/fabric_ca/request.rb +13 -24
  77. data/lib/fabric_ca/version.rb +1 -1
  78. data/lib/fabric_ca.rb +16 -0
  79. data/lib/hyperledger-fabric-sdk.rb +2 -47
  80. metadata +161 -61
  81. data/lib/crypto_suite/ecdsa_aes.rb +0 -86
  82. data/lib/fabric/peer_endorser.rb +0 -85
  83. data/lib/fabric/transaction_id.rb +0 -11
  84. data/lib/fabric/user.rb +0 -24
  85. data/lib/fabric_ca/tools.rb +0 -35
  86. data/lib/protos/common/configtx_pb.rb +0 -71
  87. data/lib/protos/discovery/protocol_pb.rb +0 -119
  88. data/lib/protos/gossip/message_pb.rb +0 -233
  89. data/lib/protos/ledger/rwset/kvrwset/kv_rwset_pb.rb +0 -85
  90. data/lib/protos/ledger/rwset/rwset_pb.rb +0 -46
  91. data/lib/protos/orderer/ab_pb.rb +0 -52
  92. data/lib/protos/peer/chaincode_pb.rb +0 -60
  93. data/lib/protos/peer/chaincode_shim_pb.rb +0 -94
  94. data/lib/protos/peer/events_pb.rb +0 -98
  95. data/lib/protos/peer/events_services_pb.rb +0 -59
@@ -4,51 +4,51 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "common.MSPPrincipal" do
8
- optional :principal_classification, :enum, 1, "common.MSPPrincipal.Classification"
7
+ add_message 'common.MSPPrincipal' do
8
+ optional :principal_classification, :enum, 1, 'common.MSPPrincipal.Classification'
9
9
  optional :principal, :bytes, 2
10
10
  end
11
- add_enum "common.MSPPrincipal.Classification" do
11
+ add_enum 'common.MSPPrincipal.Classification' do
12
12
  value :ROLE, 0
13
13
  value :ORGANIZATION_UNIT, 1
14
14
  value :IDENTITY, 2
15
15
  value :ANONYMITY, 3
16
16
  value :COMBINED, 4
17
17
  end
18
- add_message "common.OrganizationUnit" do
18
+ add_message 'common.OrganizationUnit' do
19
19
  optional :msp_identifier, :string, 1
20
20
  optional :organizational_unit_identifier, :string, 2
21
21
  optional :certifiers_identifier, :bytes, 3
22
22
  end
23
- add_message "common.MSPRole" do
23
+ add_message 'common.MSPRole' do
24
24
  optional :msp_identifier, :string, 1
25
- optional :role, :enum, 2, "common.MSPRole.MSPRoleType"
25
+ optional :role, :enum, 2, 'common.MSPRole.MSPRoleType'
26
26
  end
27
- add_enum "common.MSPRole.MSPRoleType" do
27
+ add_enum 'common.MSPRole.MSPRoleType' do
28
28
  value :MEMBER, 0
29
29
  value :ADMIN, 1
30
30
  value :CLIENT, 2
31
31
  value :PEER, 3
32
32
  end
33
- add_message "common.MSPIdentityAnonymity" do
34
- optional :anonymity_type, :enum, 1, "common.MSPIdentityAnonymity.MSPIdentityAnonymityType"
33
+ add_message 'common.MSPIdentityAnonymity' do
34
+ optional :anonymity_type, :enum, 1, 'common.MSPIdentityAnonymity.MSPIdentityAnonymityType'
35
35
  end
36
- add_enum "common.MSPIdentityAnonymity.MSPIdentityAnonymityType" do
36
+ add_enum 'common.MSPIdentityAnonymity.MSPIdentityAnonymityType' do
37
37
  value :NOMINAL, 0
38
38
  value :ANONYMOUS, 1
39
39
  end
40
- add_message "common.CombinedPrincipal" do
41
- repeated :principals, :message, 1, "common.MSPPrincipal"
40
+ add_message 'common.CombinedPrincipal' do
41
+ repeated :principals, :message, 1, 'common.MSPPrincipal'
42
42
  end
43
43
  end
44
44
 
45
45
  module Common
46
- MSPPrincipal = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.MSPPrincipal").msgclass
47
- MSPPrincipal::Classification = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.MSPPrincipal.Classification").enummodule
48
- OrganizationUnit = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.OrganizationUnit").msgclass
49
- MSPRole = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.MSPRole").msgclass
50
- MSPRole::MSPRoleType = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.MSPRole.MSPRoleType").enummodule
51
- MSPIdentityAnonymity = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.MSPIdentityAnonymity").msgclass
52
- MSPIdentityAnonymity::MSPIdentityAnonymityType = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.MSPIdentityAnonymity.MSPIdentityAnonymityType").enummodule
53
- CombinedPrincipal = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.CombinedPrincipal").msgclass
46
+ MSPPrincipal = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.MSPPrincipal').msgclass
47
+ MSPPrincipal::Classification = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.MSPPrincipal.Classification').enummodule
48
+ OrganizationUnit = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.OrganizationUnit').msgclass
49
+ MSPRole = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.MSPRole').msgclass
50
+ MSPRole::MSPRoleType = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.MSPRole.MSPRoleType').enummodule
51
+ MSPIdentityAnonymity = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.MSPIdentityAnonymity').msgclass
52
+ MSPIdentityAnonymity::MSPIdentityAnonymityType = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.MSPIdentityAnonymity.MSPIdentityAnonymityType').enummodule
53
+ CombinedPrincipal = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.CombinedPrincipal').msgclass
54
54
  end
@@ -0,0 +1,52 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: orderer/ab.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'common/common_pb'
7
+ Google::Protobuf::DescriptorPool.generated_pool.build do
8
+ add_message 'orderer.BroadcastResponse' do
9
+ optional :status, :enum, 1, 'common.Status'
10
+ optional :info, :string, 2
11
+ end
12
+ add_message 'orderer.SeekNewest' do
13
+ end
14
+ add_message 'orderer.SeekOldest' do
15
+ end
16
+ add_message 'orderer.SeekSpecified' do
17
+ optional :number, :uint64, 1
18
+ end
19
+ add_message 'orderer.SeekPosition' do
20
+ oneof :Type do
21
+ optional :newest, :message, 1, 'orderer.SeekNewest'
22
+ optional :oldest, :message, 2, 'orderer.SeekOldest'
23
+ optional :specified, :message, 3, 'orderer.SeekSpecified'
24
+ end
25
+ end
26
+ add_message 'orderer.SeekInfo' do
27
+ optional :start, :message, 1, 'orderer.SeekPosition'
28
+ optional :stop, :message, 2, 'orderer.SeekPosition'
29
+ optional :behavior, :enum, 3, 'orderer.SeekInfo.SeekBehavior'
30
+ end
31
+ add_enum 'orderer.SeekInfo.SeekBehavior' do
32
+ value :BLOCK_UNTIL_READY, 0
33
+ value :FAIL_IF_NOT_READY, 1
34
+ end
35
+ add_message 'orderer.DeliverResponse' do
36
+ oneof :Type do
37
+ optional :status, :enum, 1, 'common.Status'
38
+ optional :block, :message, 2, 'common.Block'
39
+ end
40
+ end
41
+ end
42
+
43
+ module Orderer
44
+ BroadcastResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.BroadcastResponse').msgclass
45
+ SeekNewest = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.SeekNewest').msgclass
46
+ SeekOldest = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.SeekOldest').msgclass
47
+ SeekSpecified = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.SeekSpecified').msgclass
48
+ SeekPosition = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.SeekPosition').msgclass
49
+ SeekInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.SeekInfo').msgclass
50
+ SeekInfo::SeekBehavior = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.SeekInfo.SeekBehavior').enummodule
51
+ DeliverResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.DeliverResponse').msgclass
52
+ end
@@ -23,7 +23,6 @@ require 'orderer/ab_pb'
23
23
  module Orderer
24
24
  module AtomicBroadcast
25
25
  class Service
26
-
27
26
  include GRPC::GenericService
28
27
 
29
28
  self.marshal_class_method = :encode
@@ -0,0 +1,31 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: orderer/cluster.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'common/common_pb'
7
+ Google::Protobuf::DescriptorPool.generated_pool.build do
8
+ add_message 'orderer.StepRequest' do
9
+ optional :channel, :string, 1
10
+ optional :payload, :bytes, 2
11
+ end
12
+ add_message 'orderer.StepResponse' do
13
+ optional :payload, :bytes, 1
14
+ end
15
+ add_message 'orderer.SubmitRequest' do
16
+ optional :channel, :string, 1
17
+ optional :last_validation_seq, :uint64, 2
18
+ optional :content, :message, 3, 'common.Envelope'
19
+ end
20
+ add_message 'orderer.SubmitResponse' do
21
+ optional :status, :enum, 1, 'common.Status'
22
+ optional :info, :string, 2
23
+ end
24
+ end
25
+
26
+ module Orderer
27
+ StepRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.StepRequest').msgclass
28
+ StepResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.StepResponse').msgclass
29
+ SubmitRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.SubmitRequest').msgclass
30
+ SubmitResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.SubmitResponse').msgclass
31
+ end
@@ -0,0 +1,31 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: orderer/cluster.proto for package 'orderer'
3
+ # Original file comments:
4
+ #
5
+ # Copyright IBM Corp. All Rights Reserved.
6
+ #
7
+ # SPDX-License-Identifier: Apache-2.0
8
+ #
9
+
10
+ require 'grpc'
11
+ require 'orderer/cluster_pb'
12
+
13
+ module Orderer
14
+ module Cluster
15
+ # Cluster defines communication between cluster members.
16
+ class Service
17
+ include GRPC::GenericService
18
+
19
+ self.marshal_class_method = :encode
20
+ self.unmarshal_class_method = :decode
21
+ self.service_name = 'orderer.Cluster'
22
+
23
+ # Submit submits transactions to a cluster member
24
+ rpc :Submit, stream(SubmitRequest), stream(SubmitResponse)
25
+ # Step passes an implementation-specific message to another cluster member.
26
+ rpc :Step, StepRequest, StepResponse
27
+ end
28
+
29
+ Stub = Service.rpc_stub_class
30
+ end
31
+ end
@@ -4,29 +4,30 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "orderer.ConsensusType" do
7
+ add_message 'orderer.ConsensusType' do
8
8
  optional :type, :string, 1
9
+ optional :metadata, :bytes, 2
9
10
  end
10
- add_message "orderer.BatchSize" do
11
+ add_message 'orderer.BatchSize' do
11
12
  optional :max_message_count, :uint32, 1
12
13
  optional :absolute_max_bytes, :uint32, 2
13
14
  optional :preferred_max_bytes, :uint32, 3
14
15
  end
15
- add_message "orderer.BatchTimeout" do
16
+ add_message 'orderer.BatchTimeout' do
16
17
  optional :timeout, :string, 1
17
18
  end
18
- add_message "orderer.KafkaBrokers" do
19
+ add_message 'orderer.KafkaBrokers' do
19
20
  repeated :brokers, :string, 1
20
21
  end
21
- add_message "orderer.ChannelRestrictions" do
22
+ add_message 'orderer.ChannelRestrictions' do
22
23
  optional :max_count, :uint64, 1
23
24
  end
24
25
  end
25
26
 
26
27
  module Orderer
27
- ConsensusType = Google::Protobuf::DescriptorPool.generated_pool.lookup("orderer.ConsensusType").msgclass
28
- BatchSize = Google::Protobuf::DescriptorPool.generated_pool.lookup("orderer.BatchSize").msgclass
29
- BatchTimeout = Google::Protobuf::DescriptorPool.generated_pool.lookup("orderer.BatchTimeout").msgclass
30
- KafkaBrokers = Google::Protobuf::DescriptorPool.generated_pool.lookup("orderer.KafkaBrokers").msgclass
31
- ChannelRestrictions = Google::Protobuf::DescriptorPool.generated_pool.lookup("orderer.ChannelRestrictions").msgclass
28
+ ConsensusType = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.ConsensusType').msgclass
29
+ BatchSize = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.BatchSize').msgclass
30
+ BatchTimeout = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.BatchTimeout').msgclass
31
+ KafkaBrokers = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.KafkaBrokers').msgclass
32
+ ChannelRestrictions = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.ChannelRestrictions').msgclass
32
33
  end
@@ -0,0 +1,21 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: orderer/etcdraft/configuration.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_message 'etcdraft.Metadata' do
8
+ repeated :consenters, :message, 1, 'etcdraft.Consenter'
9
+ end
10
+ add_message 'etcdraft.Consenter' do
11
+ optional :host, :string, 1
12
+ optional :port, :uint32, 2
13
+ optional :client_tls_cert, :bytes, 3
14
+ optional :server_tls_cert, :bytes, 4
15
+ end
16
+ end
17
+
18
+ module Etcdraft
19
+ Metadata = Google::Protobuf::DescriptorPool.generated_pool.lookup('etcdraft.Metadata').msgclass
20
+ Consenter = Google::Protobuf::DescriptorPool.generated_pool.lookup('etcdraft.Consenter').msgclass
21
+ end
@@ -4,31 +4,31 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "orderer.KafkaMessage" do
7
+ add_message 'orderer.KafkaMessage' do
8
8
  oneof :Type do
9
- optional :regular, :message, 1, "orderer.KafkaMessageRegular"
10
- optional :time_to_cut, :message, 2, "orderer.KafkaMessageTimeToCut"
11
- optional :connect, :message, 3, "orderer.KafkaMessageConnect"
9
+ optional :regular, :message, 1, 'orderer.KafkaMessageRegular'
10
+ optional :time_to_cut, :message, 2, 'orderer.KafkaMessageTimeToCut'
11
+ optional :connect, :message, 3, 'orderer.KafkaMessageConnect'
12
12
  end
13
13
  end
14
- add_message "orderer.KafkaMessageRegular" do
14
+ add_message 'orderer.KafkaMessageRegular' do
15
15
  optional :payload, :bytes, 1
16
16
  optional :config_seq, :uint64, 2
17
- optional :class, :enum, 3, "orderer.KafkaMessageRegular.Class"
17
+ optional :class, :enum, 3, 'orderer.KafkaMessageRegular.Class'
18
18
  optional :original_offset, :int64, 4
19
19
  end
20
- add_enum "orderer.KafkaMessageRegular.Class" do
20
+ add_enum 'orderer.KafkaMessageRegular.Class' do
21
21
  value :UNKNOWN, 0
22
22
  value :NORMAL, 1
23
23
  value :CONFIG, 2
24
24
  end
25
- add_message "orderer.KafkaMessageTimeToCut" do
25
+ add_message 'orderer.KafkaMessageTimeToCut' do
26
26
  optional :block_number, :uint64, 1
27
27
  end
28
- add_message "orderer.KafkaMessageConnect" do
28
+ add_message 'orderer.KafkaMessageConnect' do
29
29
  optional :payload, :bytes, 1
30
30
  end
31
- add_message "orderer.KafkaMetadata" do
31
+ add_message 'orderer.KafkaMetadata' do
32
32
  optional :last_offset_persisted, :int64, 1
33
33
  optional :last_original_offset_processed, :int64, 2
34
34
  optional :last_resubmitted_config_offset, :int64, 3
@@ -36,10 +36,10 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
36
36
  end
37
37
 
38
38
  module Orderer
39
- KafkaMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup("orderer.KafkaMessage").msgclass
40
- KafkaMessageRegular = Google::Protobuf::DescriptorPool.generated_pool.lookup("orderer.KafkaMessageRegular").msgclass
41
- KafkaMessageRegular::Class = Google::Protobuf::DescriptorPool.generated_pool.lookup("orderer.KafkaMessageRegular.Class").enummodule
42
- KafkaMessageTimeToCut = Google::Protobuf::DescriptorPool.generated_pool.lookup("orderer.KafkaMessageTimeToCut").msgclass
43
- KafkaMessageConnect = Google::Protobuf::DescriptorPool.generated_pool.lookup("orderer.KafkaMessageConnect").msgclass
44
- KafkaMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("orderer.KafkaMetadata").msgclass
39
+ KafkaMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.KafkaMessage').msgclass
40
+ KafkaMessageRegular = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.KafkaMessageRegular').msgclass
41
+ KafkaMessageRegular::Class = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.KafkaMessageRegular.Class').enummodule
42
+ KafkaMessageTimeToCut = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.KafkaMessageTimeToCut').msgclass
43
+ KafkaMessageConnect = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.KafkaMessageConnect').msgclass
44
+ KafkaMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup('orderer.KafkaMetadata').msgclass
45
45
  end
@@ -6,10 +6,10 @@ require 'google/protobuf'
6
6
  require 'google/protobuf/empty_pb'
7
7
  require 'common/common_pb'
8
8
  Google::Protobuf::DescriptorPool.generated_pool.build do
9
- add_message "protos.ServerStatus" do
10
- optional :status, :enum, 1, "protos.ServerStatus.StatusCode"
9
+ add_message 'protos.ServerStatus' do
10
+ optional :status, :enum, 1, 'protos.ServerStatus.StatusCode'
11
11
  end
12
- add_enum "protos.ServerStatus.StatusCode" do
12
+ add_enum 'protos.ServerStatus.StatusCode' do
13
13
  value :UNDEFINED, 0
14
14
  value :STARTED, 1
15
15
  value :STOPPED, 2
@@ -17,25 +17,25 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
17
17
  value :ERROR, 4
18
18
  value :UNKNOWN, 5
19
19
  end
20
- add_message "protos.LogLevelRequest" do
20
+ add_message 'protos.LogLevelRequest' do
21
21
  optional :log_module, :string, 1
22
22
  optional :log_level, :string, 2
23
23
  end
24
- add_message "protos.LogLevelResponse" do
24
+ add_message 'protos.LogLevelResponse' do
25
25
  optional :log_module, :string, 1
26
26
  optional :log_level, :string, 2
27
27
  end
28
- add_message "protos.AdminOperation" do
28
+ add_message 'protos.AdminOperation' do
29
29
  oneof :content do
30
- optional :logReq, :message, 1, "protos.LogLevelRequest"
30
+ optional :logReq, :message, 1, 'protos.LogLevelRequest'
31
31
  end
32
32
  end
33
33
  end
34
34
 
35
35
  module Protos
36
- ServerStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup("protos.ServerStatus").msgclass
37
- ServerStatus::StatusCode = Google::Protobuf::DescriptorPool.generated_pool.lookup("protos.ServerStatus.StatusCode").enummodule
38
- LogLevelRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup("protos.LogLevelRequest").msgclass
39
- LogLevelResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup("protos.LogLevelResponse").msgclass
40
- AdminOperation = Google::Protobuf::DescriptorPool.generated_pool.lookup("protos.AdminOperation").msgclass
36
+ ServerStatus = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.ServerStatus').msgclass
37
+ ServerStatus::StatusCode = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.ServerStatus.StatusCode').enummodule
38
+ LogLevelRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.LogLevelRequest').msgclass
39
+ LogLevelResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.LogLevelResponse').msgclass
40
+ AdminOperation = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.AdminOperation').msgclass
41
41
  end
@@ -14,7 +14,6 @@ module Protos
14
14
  module Admin
15
15
  # Interface exported by the server.
16
16
  class Service
17
-
18
17
  include GRPC::GenericService
19
18
 
20
19
  self.marshal_class_method = :encode
@@ -4,7 +4,7 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "protos.ChaincodeEvent" do
7
+ add_message 'protos.ChaincodeEvent' do
8
8
  optional :chaincode_id, :string, 1
9
9
  optional :tx_id, :string, 2
10
10
  optional :event_name, :string, 3
@@ -13,5 +13,5 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
13
13
  end
14
14
 
15
15
  module Protos
16
- ChaincodeEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup("protos.ChaincodeEvent").msgclass
16
+ ChaincodeEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.ChaincodeEvent').msgclass
17
17
  end
@@ -0,0 +1,60 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: peer/chaincode.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_message 'protos.ChaincodeID' do
8
+ optional :path, :string, 1
9
+ optional :name, :string, 2
10
+ optional :version, :string, 3
11
+ end
12
+ add_message 'protos.ChaincodeInput' do
13
+ repeated :args, :bytes, 1
14
+ map :decorations, :string, :bytes, 2
15
+ end
16
+ add_message 'protos.ChaincodeSpec' do
17
+ optional :type, :enum, 1, 'protos.ChaincodeSpec.Type'
18
+ optional :chaincode_id, :message, 2, 'protos.ChaincodeID'
19
+ optional :input, :message, 3, 'protos.ChaincodeInput'
20
+ optional :timeout, :int32, 4
21
+ end
22
+ add_enum 'protos.ChaincodeSpec.Type' do
23
+ value :UNDEFINED, 0
24
+ value :GOLANG, 1
25
+ value :NODE, 2
26
+ value :CAR, 3
27
+ value :JAVA, 4
28
+ end
29
+ add_message 'protos.ChaincodeDeploymentSpec' do
30
+ optional :chaincode_spec, :message, 1, 'protos.ChaincodeSpec'
31
+ optional :code_package, :bytes, 3
32
+ optional :exec_env, :enum, 4, 'protos.ChaincodeDeploymentSpec.ExecutionEnvironment'
33
+ end
34
+ add_enum 'protos.ChaincodeDeploymentSpec.ExecutionEnvironment' do
35
+ value :DOCKER, 0
36
+ value :SYSTEM, 1
37
+ end
38
+ add_message 'protos.ChaincodeInvocationSpec' do
39
+ optional :chaincode_spec, :message, 1, 'protos.ChaincodeSpec'
40
+ end
41
+ add_message 'protos.LifecycleEvent' do
42
+ optional :chaincode_name, :string, 1
43
+ end
44
+ add_enum 'protos.ConfidentialityLevel' do
45
+ value :PUBLIC, 0
46
+ value :CONFIDENTIAL, 1
47
+ end
48
+ end
49
+
50
+ module Protos
51
+ ChaincodeID = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.ChaincodeID').msgclass
52
+ ChaincodeInput = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.ChaincodeInput').msgclass
53
+ ChaincodeSpec = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.ChaincodeSpec').msgclass
54
+ ChaincodeSpec::Type = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.ChaincodeSpec.Type').enummodule
55
+ ChaincodeDeploymentSpec = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.ChaincodeDeploymentSpec').msgclass
56
+ ChaincodeDeploymentSpec::ExecutionEnvironment = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.ChaincodeDeploymentSpec.ExecutionEnvironment').enummodule
57
+ ChaincodeInvocationSpec = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.ChaincodeInvocationSpec').msgclass
58
+ LifecycleEvent = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.LifecycleEvent').msgclass
59
+ ConfidentialityLevel = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.ConfidentialityLevel').enummodule
60
+ end
@@ -0,0 +1,129 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: peer/chaincode_shim.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'peer/chaincode_event_pb'
7
+ require 'peer/proposal_pb'
8
+ require 'google/protobuf/timestamp_pb'
9
+ Google::Protobuf::DescriptorPool.generated_pool.build do
10
+ add_message 'protos.ChaincodeMessage' do
11
+ optional :type, :enum, 1, 'protos.ChaincodeMessage.Type'
12
+ optional :timestamp, :message, 2, 'google.protobuf.Timestamp'
13
+ optional :payload, :bytes, 3
14
+ optional :txid, :string, 4
15
+ optional :proposal, :message, 5, 'protos.SignedProposal'
16
+ optional :chaincode_event, :message, 6, 'protos.ChaincodeEvent'
17
+ optional :channel_id, :string, 7
18
+ end
19
+ add_enum 'protos.ChaincodeMessage.Type' do
20
+ value :UNDEFINED, 0
21
+ value :REGISTER, 1
22
+ value :REGISTERED, 2
23
+ value :INIT, 3
24
+ value :READY, 4
25
+ value :TRANSACTION, 5
26
+ value :COMPLETED, 6
27
+ value :ERROR, 7
28
+ value :GET_STATE, 8
29
+ value :PUT_STATE, 9
30
+ value :DEL_STATE, 10
31
+ value :INVOKE_CHAINCODE, 11
32
+ value :RESPONSE, 13
33
+ value :GET_STATE_BY_RANGE, 14
34
+ value :GET_QUERY_RESULT, 15
35
+ value :QUERY_STATE_NEXT, 16
36
+ value :QUERY_STATE_CLOSE, 17
37
+ value :KEEPALIVE, 18
38
+ value :GET_HISTORY_FOR_KEY, 19
39
+ value :GET_STATE_METADATA, 20
40
+ value :PUT_STATE_METADATA, 21
41
+ end
42
+ add_message 'protos.GetState' do
43
+ optional :key, :string, 1
44
+ optional :collection, :string, 2
45
+ end
46
+ add_message 'protos.GetStateMetadata' do
47
+ optional :key, :string, 1
48
+ optional :collection, :string, 2
49
+ end
50
+ add_message 'protos.PutState' do
51
+ optional :key, :string, 1
52
+ optional :value, :bytes, 2
53
+ optional :collection, :string, 3
54
+ end
55
+ add_message 'protos.PutStateMetadata' do
56
+ optional :key, :string, 1
57
+ optional :collection, :string, 3
58
+ optional :metadata, :message, 4, 'protos.StateMetadata'
59
+ end
60
+ add_message 'protos.DelState' do
61
+ optional :key, :string, 1
62
+ optional :collection, :string, 2
63
+ end
64
+ add_message 'protos.GetStateByRange' do
65
+ optional :startKey, :string, 1
66
+ optional :endKey, :string, 2
67
+ optional :collection, :string, 3
68
+ optional :metadata, :bytes, 4
69
+ end
70
+ add_message 'protos.GetQueryResult' do
71
+ optional :query, :string, 1
72
+ optional :collection, :string, 2
73
+ optional :metadata, :bytes, 3
74
+ end
75
+ add_message 'protos.QueryMetadata' do
76
+ optional :pageSize, :int32, 1
77
+ optional :bookmark, :string, 2
78
+ end
79
+ add_message 'protos.GetHistoryForKey' do
80
+ optional :key, :string, 1
81
+ end
82
+ add_message 'protos.QueryStateNext' do
83
+ optional :id, :string, 1
84
+ end
85
+ add_message 'protos.QueryStateClose' do
86
+ optional :id, :string, 1
87
+ end
88
+ add_message 'protos.QueryResultBytes' do
89
+ optional :resultBytes, :bytes, 1
90
+ end
91
+ add_message 'protos.QueryResponse' do
92
+ repeated :results, :message, 1, 'protos.QueryResultBytes'
93
+ optional :has_more, :bool, 2
94
+ optional :id, :string, 3
95
+ optional :metadata, :bytes, 4
96
+ end
97
+ add_message 'protos.QueryResponseMetadata' do
98
+ optional :fetched_records_count, :int32, 1
99
+ optional :bookmark, :string, 2
100
+ end
101
+ add_message 'protos.StateMetadata' do
102
+ optional :metakey, :string, 1
103
+ optional :value, :bytes, 2
104
+ end
105
+ add_message 'protos.StateMetadataResult' do
106
+ repeated :entries, :message, 1, 'protos.StateMetadata'
107
+ end
108
+ end
109
+
110
+ module Protos
111
+ ChaincodeMessage = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.ChaincodeMessage').msgclass
112
+ ChaincodeMessage::Type = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.ChaincodeMessage.Type').enummodule
113
+ GetState = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.GetState').msgclass
114
+ GetStateMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.GetStateMetadata').msgclass
115
+ PutState = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.PutState').msgclass
116
+ PutStateMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.PutStateMetadata').msgclass
117
+ DelState = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.DelState').msgclass
118
+ GetStateByRange = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.GetStateByRange').msgclass
119
+ GetQueryResult = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.GetQueryResult').msgclass
120
+ QueryMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.QueryMetadata').msgclass
121
+ GetHistoryForKey = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.GetHistoryForKey').msgclass
122
+ QueryStateNext = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.QueryStateNext').msgclass
123
+ QueryStateClose = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.QueryStateClose').msgclass
124
+ QueryResultBytes = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.QueryResultBytes').msgclass
125
+ QueryResponse = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.QueryResponse').msgclass
126
+ QueryResponseMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.QueryResponseMetadata').msgclass
127
+ StateMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.StateMetadata').msgclass
128
+ StateMetadataResult = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.StateMetadataResult').msgclass
129
+ end
@@ -15,7 +15,6 @@ module Protos
15
15
  # Interface that provides support to chaincode execution. ChaincodeContext
16
16
  # provides the context necessary for the server to respond appropriately.
17
17
  class Service
18
-
19
18
  include GRPC::GenericService
20
19
 
21
20
  self.marshal_class_method = :encode
@@ -4,24 +4,24 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "protos.AnchorPeers" do
8
- repeated :anchor_peers, :message, 1, "protos.AnchorPeer"
7
+ add_message 'protos.AnchorPeers' do
8
+ repeated :anchor_peers, :message, 1, 'protos.AnchorPeer'
9
9
  end
10
- add_message "protos.AnchorPeer" do
10
+ add_message 'protos.AnchorPeer' do
11
11
  optional :host, :string, 1
12
12
  optional :port, :int32, 2
13
13
  end
14
- add_message "protos.APIResource" do
14
+ add_message 'protos.APIResource' do
15
15
  optional :policy_ref, :string, 1
16
16
  end
17
- add_message "protos.ACLs" do
18
- map :acls, :string, :message, 1, "protos.APIResource"
17
+ add_message 'protos.ACLs' do
18
+ map :acls, :string, :message, 1, 'protos.APIResource'
19
19
  end
20
20
  end
21
21
 
22
22
  module Protos
23
- AnchorPeers = Google::Protobuf::DescriptorPool.generated_pool.lookup("protos.AnchorPeers").msgclass
24
- AnchorPeer = Google::Protobuf::DescriptorPool.generated_pool.lookup("protos.AnchorPeer").msgclass
25
- APIResource = Google::Protobuf::DescriptorPool.generated_pool.lookup("protos.APIResource").msgclass
26
- ACLs = Google::Protobuf::DescriptorPool.generated_pool.lookup("protos.ACLs").msgclass
23
+ AnchorPeers = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.AnchorPeers').msgclass
24
+ AnchorPeer = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.AnchorPeer').msgclass
25
+ APIResource = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.APIResource').msgclass
26
+ ACLs = Google::Protobuf::DescriptorPool.generated_pool.lookup('protos.ACLs').msgclass
27
27
  end