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
@@ -5,27 +5,27 @@ require 'google/protobuf'
5
5
 
6
6
  require 'common/policies_pb'
7
7
  Google::Protobuf::DescriptorPool.generated_pool.build do
8
- add_message "common.CollectionConfigPackage" do
9
- repeated :config, :message, 1, "common.CollectionConfig"
8
+ add_message 'common.CollectionConfigPackage' do
9
+ repeated :config, :message, 1, 'common.CollectionConfig'
10
10
  end
11
- add_message "common.CollectionConfig" do
11
+ add_message 'common.CollectionConfig' do
12
12
  oneof :payload do
13
- optional :static_collection_config, :message, 1, "common.StaticCollectionConfig"
13
+ optional :static_collection_config, :message, 1, 'common.StaticCollectionConfig'
14
14
  end
15
15
  end
16
- add_message "common.StaticCollectionConfig" do
16
+ add_message 'common.StaticCollectionConfig' do
17
17
  optional :name, :string, 1
18
- optional :member_orgs_policy, :message, 2, "common.CollectionPolicyConfig"
18
+ optional :member_orgs_policy, :message, 2, 'common.CollectionPolicyConfig'
19
19
  optional :required_peer_count, :int32, 3
20
20
  optional :maximum_peer_count, :int32, 4
21
21
  optional :block_to_live, :uint64, 5
22
22
  end
23
- add_message "common.CollectionPolicyConfig" do
23
+ add_message 'common.CollectionPolicyConfig' do
24
24
  oneof :payload do
25
- optional :signature_policy, :message, 1, "common.SignaturePolicyEnvelope"
25
+ optional :signature_policy, :message, 1, 'common.SignaturePolicyEnvelope'
26
26
  end
27
27
  end
28
- add_message "common.CollectionCriteria" do
28
+ add_message 'common.CollectionCriteria' do
29
29
  optional :channel, :string, 1
30
30
  optional :tx_id, :string, 2
31
31
  optional :collection, :string, 3
@@ -34,9 +34,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
34
34
  end
35
35
 
36
36
  module Common
37
- CollectionConfigPackage = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.CollectionConfigPackage").msgclass
38
- CollectionConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.CollectionConfig").msgclass
39
- StaticCollectionConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.StaticCollectionConfig").msgclass
40
- CollectionPolicyConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.CollectionPolicyConfig").msgclass
41
- CollectionCriteria = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.CollectionCriteria").msgclass
37
+ CollectionConfigPackage = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.CollectionConfigPackage').msgclass
38
+ CollectionConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.CollectionConfig').msgclass
39
+ StaticCollectionConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.StaticCollectionConfig').msgclass
40
+ CollectionPolicyConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.CollectionPolicyConfig').msgclass
41
+ CollectionCriteria = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.CollectionCriteria').msgclass
42
42
  end
@@ -5,60 +5,60 @@ require 'google/protobuf'
5
5
 
6
6
  require 'google/protobuf/timestamp_pb'
7
7
  Google::Protobuf::DescriptorPool.generated_pool.build do
8
- add_message "common.LastConfig" do
8
+ add_message 'common.LastConfig' do
9
9
  optional :index, :uint64, 1
10
10
  end
11
- add_message "common.Metadata" do
11
+ add_message 'common.Metadata' do
12
12
  optional :value, :bytes, 1
13
- repeated :signatures, :message, 2, "common.MetadataSignature"
13
+ repeated :signatures, :message, 2, 'common.MetadataSignature'
14
14
  end
15
- add_message "common.MetadataSignature" do
15
+ add_message 'common.MetadataSignature' do
16
16
  optional :signature_header, :bytes, 1
17
17
  optional :signature, :bytes, 2
18
18
  end
19
- add_message "common.Header" do
19
+ add_message 'common.Header' do
20
20
  optional :channel_header, :bytes, 1
21
21
  optional :signature_header, :bytes, 2
22
22
  end
23
- add_message "common.ChannelHeader" do
23
+ add_message 'common.ChannelHeader' do
24
24
  optional :type, :int32, 1
25
25
  optional :version, :int32, 2
26
- optional :timestamp, :message, 3, "google.protobuf.Timestamp"
26
+ optional :timestamp, :message, 3, 'google.protobuf.Timestamp'
27
27
  optional :channel_id, :string, 4
28
28
  optional :tx_id, :string, 5
29
29
  optional :epoch, :uint64, 6
30
30
  optional :extension, :bytes, 7
31
31
  optional :tls_cert_hash, :bytes, 8
32
32
  end
33
- add_message "common.SignatureHeader" do
33
+ add_message 'common.SignatureHeader' do
34
34
  optional :creator, :bytes, 1
35
35
  optional :nonce, :bytes, 2
36
36
  end
37
- add_message "common.Payload" do
38
- optional :header, :message, 1, "common.Header"
37
+ add_message 'common.Payload' do
38
+ optional :header, :message, 1, 'common.Header'
39
39
  optional :data, :bytes, 2
40
40
  end
41
- add_message "common.Envelope" do
41
+ add_message 'common.Envelope' do
42
42
  optional :payload, :bytes, 1
43
43
  optional :signature, :bytes, 2
44
44
  end
45
- add_message "common.Block" do
46
- optional :header, :message, 1, "common.BlockHeader"
47
- optional :data, :message, 2, "common.BlockData"
48
- optional :metadata, :message, 3, "common.BlockMetadata"
45
+ add_message 'common.Block' do
46
+ optional :header, :message, 1, 'common.BlockHeader'
47
+ optional :data, :message, 2, 'common.BlockData'
48
+ optional :metadata, :message, 3, 'common.BlockMetadata'
49
49
  end
50
- add_message "common.BlockHeader" do
50
+ add_message 'common.BlockHeader' do
51
51
  optional :number, :uint64, 1
52
52
  optional :previous_hash, :bytes, 2
53
53
  optional :data_hash, :bytes, 3
54
54
  end
55
- add_message "common.BlockData" do
55
+ add_message 'common.BlockData' do
56
56
  repeated :data, :bytes, 1
57
57
  end
58
- add_message "common.BlockMetadata" do
58
+ add_message 'common.BlockMetadata' do
59
59
  repeated :metadata, :bytes, 1
60
60
  end
61
- add_enum "common.Status" do
61
+ add_enum 'common.Status' do
62
62
  value :UNKNOWN, 0
63
63
  value :SUCCESS, 200
64
64
  value :BAD_REQUEST, 400
@@ -69,7 +69,7 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
69
69
  value :NOT_IMPLEMENTED, 501
70
70
  value :SERVICE_UNAVAILABLE, 503
71
71
  end
72
- add_enum "common.HeaderType" do
72
+ add_enum 'common.HeaderType' do
73
73
  value :MESSAGE, 0
74
74
  value :CONFIG, 1
75
75
  value :CONFIG_UPDATE, 2
@@ -78,8 +78,9 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
78
78
  value :DELIVER_SEEK_INFO, 5
79
79
  value :CHAINCODE_PACKAGE, 6
80
80
  value :PEER_ADMIN_OPERATION, 8
81
+ value :TOKEN_TRANSACTION, 9
81
82
  end
82
- add_enum "common.BlockMetadataIndex" do
83
+ add_enum 'common.BlockMetadataIndex' do
83
84
  value :SIGNATURES, 0
84
85
  value :LAST_CONFIG, 1
85
86
  value :TRANSACTIONS_FILTER, 2
@@ -88,19 +89,19 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
88
89
  end
89
90
 
90
91
  module Common
91
- LastConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.LastConfig").msgclass
92
- Metadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.Metadata").msgclass
93
- MetadataSignature = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.MetadataSignature").msgclass
94
- Header = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.Header").msgclass
95
- ChannelHeader = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.ChannelHeader").msgclass
96
- SignatureHeader = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.SignatureHeader").msgclass
97
- Payload = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.Payload").msgclass
98
- Envelope = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.Envelope").msgclass
99
- Block = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.Block").msgclass
100
- BlockHeader = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.BlockHeader").msgclass
101
- BlockData = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.BlockData").msgclass
102
- BlockMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.BlockMetadata").msgclass
103
- Status = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.Status").enummodule
104
- HeaderType = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.HeaderType").enummodule
105
- BlockMetadataIndex = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.BlockMetadataIndex").enummodule
92
+ LastConfig = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.LastConfig').msgclass
93
+ Metadata = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.Metadata').msgclass
94
+ MetadataSignature = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.MetadataSignature').msgclass
95
+ Header = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.Header').msgclass
96
+ ChannelHeader = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.ChannelHeader').msgclass
97
+ SignatureHeader = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.SignatureHeader').msgclass
98
+ Payload = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.Payload').msgclass
99
+ Envelope = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.Envelope').msgclass
100
+ Block = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.Block').msgclass
101
+ BlockHeader = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.BlockHeader').msgclass
102
+ BlockData = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.BlockData').msgclass
103
+ BlockMetadata = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.BlockMetadata').msgclass
104
+ Status = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.Status').enummodule
105
+ HeaderType = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.HeaderType').enummodule
106
+ BlockMetadataIndex = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.BlockMetadataIndex').enummodule
106
107
  end
@@ -0,0 +1,71 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: common/configtx.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'common/common_pb'
7
+ require 'common/policies_pb'
8
+ Google::Protobuf::DescriptorPool.generated_pool.build do
9
+ add_message 'common.ConfigEnvelope' do
10
+ optional :config, :message, 1, 'common.Config'
11
+ optional :last_update, :message, 2, 'common.Envelope'
12
+ end
13
+ add_message 'common.ConfigGroupSchema' do
14
+ map :groups, :string, :message, 1, 'common.ConfigGroupSchema'
15
+ map :values, :string, :message, 2, 'common.ConfigValueSchema'
16
+ map :policies, :string, :message, 3, 'common.ConfigPolicySchema'
17
+ end
18
+ add_message 'common.ConfigValueSchema' do
19
+ end
20
+ add_message 'common.ConfigPolicySchema' do
21
+ end
22
+ add_message 'common.Config' do
23
+ optional :sequence, :uint64, 1
24
+ optional :channel_group, :message, 2, 'common.ConfigGroup'
25
+ end
26
+ add_message 'common.ConfigUpdateEnvelope' do
27
+ optional :config_update, :bytes, 1
28
+ repeated :signatures, :message, 2, 'common.ConfigSignature'
29
+ end
30
+ add_message 'common.ConfigUpdate' do
31
+ optional :channel_id, :string, 1
32
+ optional :read_set, :message, 2, 'common.ConfigGroup'
33
+ optional :write_set, :message, 3, 'common.ConfigGroup'
34
+ map :isolated_data, :string, :bytes, 5
35
+ end
36
+ add_message 'common.ConfigGroup' do
37
+ optional :version, :uint64, 1
38
+ map :groups, :string, :message, 2, 'common.ConfigGroup'
39
+ map :values, :string, :message, 3, 'common.ConfigValue'
40
+ map :policies, :string, :message, 4, 'common.ConfigPolicy'
41
+ optional :mod_policy, :string, 5
42
+ end
43
+ add_message 'common.ConfigValue' do
44
+ optional :version, :uint64, 1
45
+ optional :value, :bytes, 2
46
+ optional :mod_policy, :string, 3
47
+ end
48
+ add_message 'common.ConfigPolicy' do
49
+ optional :version, :uint64, 1
50
+ optional :policy, :message, 2, 'common.Policy'
51
+ optional :mod_policy, :string, 3
52
+ end
53
+ add_message 'common.ConfigSignature' do
54
+ optional :signature_header, :bytes, 1
55
+ optional :signature, :bytes, 2
56
+ end
57
+ end
58
+
59
+ module Common
60
+ ConfigEnvelope = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.ConfigEnvelope').msgclass
61
+ ConfigGroupSchema = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.ConfigGroupSchema').msgclass
62
+ ConfigValueSchema = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.ConfigValueSchema').msgclass
63
+ ConfigPolicySchema = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.ConfigPolicySchema').msgclass
64
+ Config = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.Config').msgclass
65
+ ConfigUpdateEnvelope = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.ConfigUpdateEnvelope').msgclass
66
+ ConfigUpdate = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.ConfigUpdate').msgclass
67
+ ConfigGroup = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.ConfigGroup').msgclass
68
+ ConfigValue = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.ConfigValue').msgclass
69
+ ConfigPolicy = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.ConfigPolicy').msgclass
70
+ ConfigSignature = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.ConfigSignature').msgclass
71
+ end
@@ -4,30 +4,30 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "common.HashingAlgorithm" do
7
+ add_message 'common.HashingAlgorithm' do
8
8
  optional :name, :string, 1
9
9
  end
10
- add_message "common.BlockDataHashingStructure" do
10
+ add_message 'common.BlockDataHashingStructure' do
11
11
  optional :width, :uint32, 1
12
12
  end
13
- add_message "common.OrdererAddresses" do
13
+ add_message 'common.OrdererAddresses' do
14
14
  repeated :addresses, :string, 1
15
15
  end
16
- add_message "common.Consortium" do
16
+ add_message 'common.Consortium' do
17
17
  optional :name, :string, 1
18
18
  end
19
- add_message "common.Capabilities" do
20
- map :capabilities, :string, :message, 1, "common.Capability"
19
+ add_message 'common.Capabilities' do
20
+ map :capabilities, :string, :message, 1, 'common.Capability'
21
21
  end
22
- add_message "common.Capability" do
22
+ add_message 'common.Capability' do
23
23
  end
24
24
  end
25
25
 
26
26
  module Common
27
- HashingAlgorithm = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.HashingAlgorithm").msgclass
28
- BlockDataHashingStructure = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.BlockDataHashingStructure").msgclass
29
- OrdererAddresses = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.OrdererAddresses").msgclass
30
- Consortium = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.Consortium").msgclass
31
- Capabilities = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.Capabilities").msgclass
32
- Capability = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.Capability").msgclass
27
+ HashingAlgorithm = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.HashingAlgorithm').msgclass
28
+ BlockDataHashingStructure = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.BlockDataHashingStructure').msgclass
29
+ OrdererAddresses = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.OrdererAddresses').msgclass
30
+ Consortium = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.Consortium').msgclass
31
+ Capabilities = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.Capabilities').msgclass
32
+ Capability = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.Capability').msgclass
33
33
  end
@@ -4,7 +4,7 @@
4
4
  require 'google/protobuf'
5
5
 
6
6
  Google::Protobuf::DescriptorPool.generated_pool.build do
7
- add_message "common.BlockchainInfo" do
7
+ add_message 'common.BlockchainInfo' do
8
8
  optional :height, :uint64, 1
9
9
  optional :currentBlockHash, :bytes, 2
10
10
  optional :previousBlockHash, :bytes, 3
@@ -12,5 +12,5 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
12
12
  end
13
13
 
14
14
  module Common
15
- BlockchainInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.BlockchainInfo").msgclass
15
+ BlockchainInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.BlockchainInfo').msgclass
16
16
  end
@@ -5,36 +5,36 @@ require 'google/protobuf'
5
5
 
6
6
  require 'msp/msp_principal_pb'
7
7
  Google::Protobuf::DescriptorPool.generated_pool.build do
8
- add_message "common.Policy" do
8
+ add_message 'common.Policy' do
9
9
  optional :type, :int32, 1
10
10
  optional :value, :bytes, 2
11
11
  end
12
- add_enum "common.Policy.PolicyType" do
12
+ add_enum 'common.Policy.PolicyType' do
13
13
  value :UNKNOWN, 0
14
14
  value :SIGNATURE, 1
15
15
  value :MSP, 2
16
16
  value :IMPLICIT_META, 3
17
17
  end
18
- add_message "common.SignaturePolicyEnvelope" do
18
+ add_message 'common.SignaturePolicyEnvelope' do
19
19
  optional :version, :int32, 1
20
- optional :rule, :message, 2, "common.SignaturePolicy"
21
- repeated :identities, :message, 3, "common.MSPPrincipal"
20
+ optional :rule, :message, 2, 'common.SignaturePolicy'
21
+ repeated :identities, :message, 3, 'common.MSPPrincipal'
22
22
  end
23
- add_message "common.SignaturePolicy" do
23
+ add_message 'common.SignaturePolicy' do
24
24
  oneof :Type do
25
25
  optional :signed_by, :int32, 1
26
- optional :n_out_of, :message, 2, "common.SignaturePolicy.NOutOf"
26
+ optional :n_out_of, :message, 2, 'common.SignaturePolicy.NOutOf'
27
27
  end
28
28
  end
29
- add_message "common.SignaturePolicy.NOutOf" do
29
+ add_message 'common.SignaturePolicy.NOutOf' do
30
30
  optional :n, :int32, 1
31
- repeated :rules, :message, 2, "common.SignaturePolicy"
31
+ repeated :rules, :message, 2, 'common.SignaturePolicy'
32
32
  end
33
- add_message "common.ImplicitMetaPolicy" do
33
+ add_message 'common.ImplicitMetaPolicy' do
34
34
  optional :sub_policy, :string, 1
35
- optional :rule, :enum, 2, "common.ImplicitMetaPolicy.Rule"
35
+ optional :rule, :enum, 2, 'common.ImplicitMetaPolicy.Rule'
36
36
  end
37
- add_enum "common.ImplicitMetaPolicy.Rule" do
37
+ add_enum 'common.ImplicitMetaPolicy.Rule' do
38
38
  value :ANY, 0
39
39
  value :ALL, 1
40
40
  value :MAJORITY, 2
@@ -42,11 +42,11 @@ Google::Protobuf::DescriptorPool.generated_pool.build do
42
42
  end
43
43
 
44
44
  module Common
45
- Policy = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.Policy").msgclass
46
- Policy::PolicyType = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.Policy.PolicyType").enummodule
47
- SignaturePolicyEnvelope = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.SignaturePolicyEnvelope").msgclass
48
- SignaturePolicy = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.SignaturePolicy").msgclass
49
- SignaturePolicy::NOutOf = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.SignaturePolicy.NOutOf").msgclass
50
- ImplicitMetaPolicy = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.ImplicitMetaPolicy").msgclass
51
- ImplicitMetaPolicy::Rule = Google::Protobuf::DescriptorPool.generated_pool.lookup("common.ImplicitMetaPolicy.Rule").enummodule
45
+ Policy = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.Policy').msgclass
46
+ Policy::PolicyType = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.Policy.PolicyType').enummodule
47
+ SignaturePolicyEnvelope = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.SignaturePolicyEnvelope').msgclass
48
+ SignaturePolicy = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.SignaturePolicy').msgclass
49
+ SignaturePolicy::NOutOf = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.SignaturePolicy.NOutOf').msgclass
50
+ ImplicitMetaPolicy = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.ImplicitMetaPolicy').msgclass
51
+ ImplicitMetaPolicy::Rule = Google::Protobuf::DescriptorPool.generated_pool.lookup('common.ImplicitMetaPolicy.Rule').enummodule
52
52
  end
@@ -0,0 +1,120 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: discovery/protocol.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ require 'gossip/message_pb'
7
+ require 'msp/msp_config_pb'
8
+ require 'msp/identities_pb'
9
+ Google::Protobuf::DescriptorPool.generated_pool.build do
10
+ add_message 'discovery.SignedRequest' do
11
+ optional :payload, :bytes, 1
12
+ optional :signature, :bytes, 2
13
+ end
14
+ add_message 'discovery.Request' do
15
+ optional :authentication, :message, 1, 'discovery.AuthInfo'
16
+ repeated :queries, :message, 2, 'discovery.Query'
17
+ end
18
+ add_message 'discovery.Response' do
19
+ repeated :results, :message, 1, 'discovery.QueryResult'
20
+ end
21
+ add_message 'discovery.AuthInfo' do
22
+ optional :client_identity, :bytes, 1
23
+ optional :client_tls_cert_hash, :bytes, 2
24
+ end
25
+ add_message 'discovery.Query' do
26
+ optional :channel, :string, 1
27
+ oneof :query do
28
+ optional :config_query, :message, 2, 'discovery.ConfigQuery'
29
+ optional :peer_query, :message, 3, 'discovery.PeerMembershipQuery'
30
+ optional :cc_query, :message, 4, 'discovery.ChaincodeQuery'
31
+ optional :local_peers, :message, 5, 'discovery.LocalPeerQuery'
32
+ end
33
+ end
34
+ add_message 'discovery.QueryResult' do
35
+ oneof :result do
36
+ optional :error, :message, 1, 'discovery.Error'
37
+ optional :config_result, :message, 2, 'discovery.ConfigResult'
38
+ optional :cc_query_res, :message, 3, 'discovery.ChaincodeQueryResult'
39
+ optional :members, :message, 4, 'discovery.PeerMembershipResult'
40
+ end
41
+ end
42
+ add_message 'discovery.ConfigQuery' do
43
+ end
44
+ add_message 'discovery.ConfigResult' do
45
+ map :msps, :string, :message, 1, 'msp.FabricMSPConfig'
46
+ map :orderers, :string, :message, 2, 'discovery.Endpoints'
47
+ end
48
+ add_message 'discovery.PeerMembershipQuery' do
49
+ optional :filter, :message, 1, 'discovery.ChaincodeInterest'
50
+ end
51
+ add_message 'discovery.PeerMembershipResult' do
52
+ map :peers_by_org, :string, :message, 1, 'discovery.Peers'
53
+ end
54
+ add_message 'discovery.ChaincodeQuery' do
55
+ repeated :interests, :message, 1, 'discovery.ChaincodeInterest'
56
+ end
57
+ add_message 'discovery.ChaincodeInterest' do
58
+ repeated :chaincodes, :message, 1, 'discovery.ChaincodeCall'
59
+ end
60
+ add_message 'discovery.ChaincodeCall' do
61
+ optional :name, :string, 1
62
+ repeated :collection_names, :string, 2
63
+ end
64
+ add_message 'discovery.ChaincodeQueryResult' do
65
+ repeated :content, :message, 1, 'discovery.EndorsementDescriptor'
66
+ end
67
+ add_message 'discovery.LocalPeerQuery' do
68
+ end
69
+ add_message 'discovery.EndorsementDescriptor' do
70
+ optional :chaincode, :string, 1
71
+ map :endorsers_by_groups, :string, :message, 2, 'discovery.Peers'
72
+ repeated :layouts, :message, 3, 'discovery.Layout'
73
+ end
74
+ add_message 'discovery.Layout' do
75
+ map :quantities_by_group, :string, :uint32, 1
76
+ end
77
+ add_message 'discovery.Peers' do
78
+ repeated :peers, :message, 1, 'discovery.Peer'
79
+ end
80
+ add_message 'discovery.Peer' do
81
+ optional :state_info, :message, 1, 'gossip.Envelope'
82
+ optional :membership_info, :message, 2, 'gossip.Envelope'
83
+ optional :identity, :bytes, 3
84
+ end
85
+ add_message 'discovery.Error' do
86
+ optional :content, :string, 1
87
+ end
88
+ add_message 'discovery.Endpoints' do
89
+ repeated :endpoint, :message, 1, 'discovery.Endpoint'
90
+ end
91
+ add_message 'discovery.Endpoint' do
92
+ optional :host, :string, 1
93
+ optional :port, :uint32, 2
94
+ end
95
+ end
96
+
97
+ module Discovery
98
+ SignedRequest = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.SignedRequest').msgclass
99
+ Request = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.Request').msgclass
100
+ Response = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.Response').msgclass
101
+ AuthInfo = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.AuthInfo').msgclass
102
+ Query = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.Query').msgclass
103
+ QueryResult = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.QueryResult').msgclass
104
+ ConfigQuery = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.ConfigQuery').msgclass
105
+ ConfigResult = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.ConfigResult').msgclass
106
+ PeerMembershipQuery = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.PeerMembershipQuery').msgclass
107
+ PeerMembershipResult = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.PeerMembershipResult').msgclass
108
+ ChaincodeQuery = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.ChaincodeQuery').msgclass
109
+ ChaincodeInterest = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.ChaincodeInterest').msgclass
110
+ ChaincodeCall = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.ChaincodeCall').msgclass
111
+ ChaincodeQueryResult = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.ChaincodeQueryResult').msgclass
112
+ LocalPeerQuery = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.LocalPeerQuery').msgclass
113
+ EndorsementDescriptor = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.EndorsementDescriptor').msgclass
114
+ Layout = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.Layout').msgclass
115
+ Peers = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.Peers').msgclass
116
+ Peer = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.Peer').msgclass
117
+ Error = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.Error').msgclass
118
+ Endpoints = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.Endpoints').msgclass
119
+ Endpoint = Google::Protobuf::DescriptorPool.generated_pool.lookup('discovery.Endpoint').msgclass
120
+ end
@@ -14,7 +14,6 @@ module Discovery
14
14
  # Discovery defines a service that serves information about the fabric network
15
15
  # like which peers, orderers, chaincodes, etc.
16
16
  class Service
17
-
18
17
  include GRPC::GenericService
19
18
 
20
19
  self.marshal_class_method = :encode