lnrpc 0.9.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/Gemfile.lock +24 -24
  4. data/README.md +30 -16
  5. data/examples.rb +13 -6
  6. data/generate-grpc-service-files.sh +29 -0
  7. data/lib/grpc_services/autopilotrpc/autopilot_pb.rb +48 -0
  8. data/lib/grpc_services/autopilotrpc/autopilot_services_pb.rb +40 -0
  9. data/lib/grpc_services/chainrpc/chainnotifier_pb.rb +67 -0
  10. data/lib/grpc_services/chainrpc/chainnotifier_services_pb.rb +51 -0
  11. data/lib/grpc_services/invoicesrpc/invoices_pb.rb +48 -0
  12. data/lib/grpc_services/invoicesrpc/invoices_services_pb.rb +41 -0
  13. data/lib/grpc_services/lnclipb/lncli_pb.rb +18 -0
  14. data/lib/grpc_services/routerrpc/router_pb.rb +277 -0
  15. data/lib/grpc_services/routerrpc/router_services_pb.rb +105 -0
  16. data/lib/grpc_services/rpc_pb.rb +1388 -0
  17. data/lib/{lnrpc → grpc_services}/rpc_services_pb.rb +165 -178
  18. data/lib/grpc_services/signrpc/signer_pb.rb +84 -0
  19. data/lib/grpc_services/signrpc/signer_services_pb.rb +69 -0
  20. data/lib/grpc_services/verrpc/verrpc_pb.rb +27 -0
  21. data/lib/grpc_services/verrpc/verrpc_services_pb.rb +27 -0
  22. data/lib/grpc_services/walletrpc/walletkit_pb.rb +254 -0
  23. data/lib/grpc_services/walletrpc/walletkit_services_pb.rb +188 -0
  24. data/lib/grpc_services/walletunlocker_pb.rb +57 -0
  25. data/lib/grpc_services/walletunlocker_services_pb.rb +72 -0
  26. data/lib/grpc_services/watchtowerrpc/watchtower_pb.rb +21 -0
  27. data/lib/grpc_services/watchtowerrpc/watchtower_services_pb.rb +28 -0
  28. data/lib/grpc_services/wtclientrpc/wtclient_pb.rb +83 -0
  29. data/lib/grpc_services/wtclientrpc/wtclient_services_pb.rb +43 -0
  30. data/lib/lnrpc.rb +19 -3
  31. data/lib/lnrpc/client.rb +62 -46
  32. data/lib/lnrpc/grpc_wrapper.rb +43 -0
  33. data/lib/lnrpc/version.rb +1 -1
  34. data/lnrpc.gemspec +7 -5
  35. metadata +41 -17
  36. data/lib/lnrpc/rpc.proto +0 -3075
  37. data/lib/lnrpc/rpc_pb.rb +0 -1082
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 353271a0231be5f99b2979774980f7f7500846efaafefe95d04beb2fe7d4b8a5
4
- data.tar.gz: e5b0b419399029853b50d2738aa299f5cd17403b2eee55dd354c0ca6ef8f0c43
3
+ metadata.gz: 6d2fb416e8943338d511be049cc495ca6bd3cb2c2b46ff370034a54645504966
4
+ data.tar.gz: 60a51a4b3610a855b7cd485b83e3c9b820287dd0bbc18044294fd1e38e20ff1b
5
5
  SHA512:
6
- metadata.gz: f5b0aa7b9c3ce6cfc66c9779e920f6ff3f9cf2ca4bffd98f2ccc8eff18eae5f9c3752b7f26068baa8734c92bb80932a5458f521592a470ab134df6b98a0af9ee
7
- data.tar.gz: 974f7023636ea5dd841a7bbcf9603b9fa43e657e55ee89850a5eb363ee74620d2d620c10bf3d09f3ce2230a70929070419b7ca5bc419e9398380f51d18267dc0
6
+ metadata.gz: b1fd8c5907a282ff844e8b9b5684665a280fd1ef43188962d9bd448502a17428a114a76b20afe284130348fb584fc2f0b812c5228e4f0eddb3506e5232e3c5b5
7
+ data.tar.gz: 2da8d1e1b9455954a93e86f37e54018268293c5c4091151a79e7b0296109fc59fb20de89cb75424f5c0cf56713fcebc585340be1af20863d4f7b876f34429ca1
data/.gitignore CHANGED
@@ -11,3 +11,5 @@
11
11
  .rspec_status
12
12
 
13
13
  .ruby-version
14
+
15
+ *.gem
data/Gemfile.lock CHANGED
@@ -1,43 +1,43 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- lnrpc (0.8.0.beta)
5
- google-protobuf (>= 3.7)
6
- grpc (>= 1.19.0)
4
+ lnrpc (0.11.1)
5
+ google-protobuf (>= 3.12)
6
+ grpc (>= 1.28.0)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- diff-lcs (1.3)
12
- google-protobuf (3.9.2)
13
- googleapis-common-protos-types (1.0.4)
14
- google-protobuf (~> 3.0)
15
- grpc (1.24.0)
16
- google-protobuf (~> 3.8)
11
+ diff-lcs (1.4.4)
12
+ google-protobuf (3.17.3)
13
+ googleapis-common-protos-types (1.1.0)
14
+ google-protobuf (~> 3.14)
15
+ grpc (1.38.0)
16
+ google-protobuf (~> 3.15)
17
17
  googleapis-common-protos-types (~> 1.0)
18
- rake (10.5.0)
19
- rspec (3.9.0)
20
- rspec-core (~> 3.9.0)
21
- rspec-expectations (~> 3.9.0)
22
- rspec-mocks (~> 3.9.0)
23
- rspec-core (3.9.0)
24
- rspec-support (~> 3.9.0)
25
- rspec-expectations (3.9.0)
18
+ rake (13.0.6)
19
+ rspec (3.10.0)
20
+ rspec-core (~> 3.10.0)
21
+ rspec-expectations (~> 3.10.0)
22
+ rspec-mocks (~> 3.10.0)
23
+ rspec-core (3.10.1)
24
+ rspec-support (~> 3.10.0)
25
+ rspec-expectations (3.10.1)
26
26
  diff-lcs (>= 1.2.0, < 2.0)
27
- rspec-support (~> 3.9.0)
28
- rspec-mocks (3.9.0)
27
+ rspec-support (~> 3.10.0)
28
+ rspec-mocks (3.10.2)
29
29
  diff-lcs (>= 1.2.0, < 2.0)
30
- rspec-support (~> 3.9.0)
31
- rspec-support (3.9.0)
30
+ rspec-support (~> 3.10.0)
31
+ rspec-support (3.10.2)
32
32
 
33
33
  PLATFORMS
34
34
  ruby
35
35
 
36
36
  DEPENDENCIES
37
- bundler (~> 1.17)
37
+ bundler (> 2.0)
38
38
  lnrpc!
39
- rake (~> 10.0)
39
+ rake (~> 13.0)
40
40
  rspec (~> 3.0)
41
41
 
42
42
  BUNDLED WITH
43
- 1.17.3
43
+ 2.1.4
data/README.md CHANGED
@@ -3,13 +3,15 @@
3
3
 
4
4
  a [gRPC](https://grpc.io/) client for [LND, the Lightning Network Daemon](https://github.com/lightningnetwork/lnd/) packed as ruby gem.
5
5
 
6
-
7
6
  ## Installation
8
7
 
8
+ Note: there is still an GRPC/protobuf [issue with Ruby 2.7](https://github.com/protocolbuffers/protobuf/issues/7070).
9
+ So lnrpc requires Ruby < 2.7.
10
+
9
11
  Add this line to your application's Gemfile:
10
12
 
11
13
  ```ruby
12
- gem 'lnrpc', '~> 0.7.0'
14
+ gem 'lnrpc', '~> 0.11.0'
13
15
  ```
14
16
  lnrpc follows the lnd versioning, thus it is recommended to specify the exact version you need for your lnd node as dependency (see [#Versioning](#Versioning)).
15
17
 
@@ -30,10 +32,12 @@ This gem makes the gRPC client classes created from the [LND service defintions]
30
32
  ```ruby
31
33
  require "lnrpc"
32
34
 
33
- # the gRPC client is available under the Lnrpc namespace, e.g.
35
+ # With the changes in LND v.10.0 this load the `Lnrpc` and `Routerrpc` namespace
34
36
 
35
37
  Lnrpc::Lightning::Stub
38
+ Routerrpc:::Routerrpc::Stub
36
39
  Lnrpc::GetInfoRequest
40
+ ...
37
41
  ```
38
42
 
39
43
  Learn more about [gRPC](https://grpc.io/) on [gRPC.io](https://grpc.io/).
@@ -55,17 +59,26 @@ client = Lnrpc::Lightning::Stub.new("localhost:10009", GRPC::Core::ChannelCreden
55
59
  request = Lnrpc::GetInfoRequest.new
56
60
  response = client.get_info(request, { metadata: { macaroon: macaroon } }) #=> Lnrpc::GetInfoResponse
57
61
  puts response.alias
62
+
63
+ router = Routerprc::Router::Stub.new("localhost:10009", GRPC::Core::ChannelCredentials.new(self.credentials))
64
+ ...
65
+
58
66
  ```
59
67
 
60
68
  ### Client wrapper
61
69
 
70
+ NOTE: v10.0 has breaking changes!
71
+
62
72
  An optional client wrapper ([Lnrpc::Client](https://github.com/bumi/lnrpc/blob/master/lib/lnrpc/client.rb)) makes
63
73
  initializing the gRPC client easier and removes the need for some boilerplate code for calling RPC methods.
64
74
 
65
75
  #### Example
66
76
  ```ruby
67
77
  lnd = Lnrpc::Client.new({credentials_path: '/path/to.cert.cls', macaroon_path: '/path/to/admin.macaroon'})
68
- lnd.get_info
78
+ lnd.lightning # => Lnrpc::Lightning::Stub
79
+ lnd.router # => Lnrpc::Router::Stub
80
+
81
+ lnd.ligthning.get_info
69
82
  ```
70
83
 
71
84
  Also have a look at [examples.rb](https://github.com/bumi/lnrpc/blob/master/examples.rb)
@@ -96,7 +109,8 @@ lnd = Lnrpc::Client.new({
96
109
  })
97
110
 
98
111
  # the actual gRPC client is available through:
99
- lnd.grpc_client
112
+ lnd.lightning.grpc
113
+ lnd.router.grpc
100
114
  ```
101
115
 
102
116
  #### Calling RPC methods
@@ -108,19 +122,19 @@ If the first parameter is a hash or blank the corresponding gRPC request object
108
122
  Example:
109
123
 
110
124
  ```ruby
111
- client.get_info
125
+ client.lightning.get_info
112
126
  # is the same as:
113
- client.grpc_client.get_info(Lnrpc::GetInfoRequest.new)
127
+ client.lightning.grpc.get_info(Lnrpc::GetInfoRequest.new)
114
128
 
115
- client.list_channels(inactive_only: true)
129
+ client.lightning.list_channels(inactive_only: true)
116
130
  # is the same as:
117
131
  request = Lnrpc::ListChannelsRequest.new(inactive_only: true)
118
- client.grpc_client.list_channels(request)
132
+ client.lightning.grpc.list_channels(request)
119
133
 
120
- client.wallet_balance.total_balance
134
+ client.lightning.wallet_balance.total_balance
121
135
  # is the same as:
122
136
  request = Lnrpc::WalletBalanceRequest.new()
123
- client.grpc_client.wallet_balance(request).total_balance
137
+ client.lightning.grpc.wallet_balance(request).total_balance
124
138
  ```
125
139
 
126
140
  ## Using with BTC Pay Server
@@ -145,13 +159,13 @@ see [rubygems](https://rubygems.org/gems/lnrpc) for all available releases.
145
159
 
146
160
  ### Update service definitions
147
161
 
148
- 1. Generate `prc_pb.rb` and `rpc_services_pb.rb`
149
-
150
- $ grpc_tools_ruby_protoc -I/usr/local/include -I. -I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis --ruby_out=plugins=grpc,paths=source_relative:. --grpc_out=. rpc.proto
162
+ The script `generate-grpc-service-files.sh` can be used to generate the GRPC ruby files.
163
+ The files will be stored in `lib/grpc_services`
151
164
 
152
- 2. Copy `rpc.proto`, `rpc_pb.rb` and `rpc_services_pb.rb` to `lib`
165
+ $ ./generate-grpc-service-files.sh
153
166
 
154
- 3. Update `rpc_services_pb.rb` to use `require_relative` to load `rpc_pb`
167
+ + Make sure you have the [grpc-tools](https://rubygems.org/gems/grpc-tools) installed
168
+ + Make sure you have the lnd source in your $GOPATH/src folder
155
169
 
156
170
  ## Other resources
157
171
 
data/examples.rb CHANGED
@@ -2,18 +2,25 @@ require "lnrpc"
2
2
 
3
3
  lnd = Lnrpc::Client.new() # use defaults for credentials, macaraoon and address
4
4
 
5
- get_info_res = lnd.get_info
5
+ get_info_res = lnd.lightning.get_info
6
6
  puts get_info_res.alias
7
7
 
8
- puts lnd.wallet_balance.total_balance
8
+ puts lnd.lightning.wallet_balance.total_balance
9
9
 
10
10
  pay_request = "lntb50u1pw9mmndpp5nvnff958pxc9eqknwntyxapjw7l5grt5e2y70cmmnu0lljfa0sdqdpsgfkx7cmtwd68yetpd5s9xct5v4kxc6t5v5s8yatz0ysxwetdcqzysxqyz5vqjkhlyn40z76gyn7dx32p9j58dftve9xrlvnqqazht7w2fdauukhyhr9y4k3ngjn8s6srglj8swk7tm70ng54wdkq47ahytpwffvaeusp500csz"
11
- lnd.pay(pay_request) # or:
12
- lnd.send_payment_sync(payment_request: pay_request)
11
+ lnd.pay(payment_request: pay_request) # or:
12
+ lnd.router.send_payment_v2(payment_request: pay_request)
13
13
 
14
- invoice_res = lnd.add_invoice(value: 1000, memo: 'I :heart: ruby')
14
+ dest = Lnrpc.to_byte_array('038474ec195f497cf4036e5994bd820dd365bb0aaa7fb42bd9b536913a1a2dcc9e')
15
+ lnd.keysend(dest: dest, amt: 1000)
16
+
17
+ invoice_res = lnd.lightning.add_invoice(value: 1000, memo: 'I :heart: ruby')
15
18
  puts invoice_res.payment_request
16
19
 
17
- lnd.subscribe_invoices(settle_index: 1).each do |invoice|
20
+ puts lnd.versioner.get_version
21
+ puts lnd.wallet_kit.estimate_fee(conf_target: 10)
22
+ puts lnd.wallet_kit.next_addr
23
+
24
+ lnd.lightning.subscribe_invoices(settle_index: 1).each do |invoice|
18
25
  puts invoice.payment_request
19
26
  end
@@ -0,0 +1,29 @@
1
+ #!/bin/sh
2
+ set -o xtrace
3
+
4
+ FULL_PATH=$(realpath $0)
5
+ GEM_DIR=$(dirname $FULL_PATH)
6
+ LNRPC_TARGET_DIR="$GEM_DIR/lib/grpc_services"
7
+ CURRENT_DIR=$(pwd)
8
+ echo $CURRENT_DIR
9
+ cd $GOPATH/src/github.com/lightningnetwork/lnd/lnrpc
10
+
11
+ echo "Generating Ruby GRPC Service Files"
12
+
13
+ PROTOS="rpc.proto walletunlocker.proto **/*.proto"
14
+
15
+ # generate files for each proto
16
+ for file in $PROTOS; do
17
+ DIRECTORY=$(dirname "${file}")
18
+ echo "Generating protos from ${file}, into ${LNRPC_TARGET_DIR}/${DIRECTORY}"
19
+
20
+ # writes all ruby files in the ruby directory
21
+ grpc_tools_ruby_protoc -I. \
22
+ -I$GOPATH/src/github.com/googleapis/googleapis \
23
+ -I$GOPATH/src/github.com/lightningnetwork/lnd/lnrpc \
24
+ --ruby_out=plugins=grpc,paths=source_relative:${LNRPC_TARGET_DIR} \
25
+ --grpc_out=${LNRPC_TARGET_DIR} "${file}"
26
+
27
+ done
28
+
29
+ cd $CURRENT_DIR
@@ -0,0 +1,48 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: autopilotrpc/autopilot.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_file("autopilotrpc/autopilot.proto", :syntax => :proto3) do
8
+ add_message "autopilotrpc.StatusRequest" do
9
+ end
10
+ add_message "autopilotrpc.StatusResponse" do
11
+ optional :active, :bool, 1
12
+ end
13
+ add_message "autopilotrpc.ModifyStatusRequest" do
14
+ optional :enable, :bool, 1
15
+ end
16
+ add_message "autopilotrpc.ModifyStatusResponse" do
17
+ end
18
+ add_message "autopilotrpc.QueryScoresRequest" do
19
+ repeated :pubkeys, :string, 1
20
+ optional :ignore_local_state, :bool, 2
21
+ end
22
+ add_message "autopilotrpc.QueryScoresResponse" do
23
+ repeated :results, :message, 1, "autopilotrpc.QueryScoresResponse.HeuristicResult"
24
+ end
25
+ add_message "autopilotrpc.QueryScoresResponse.HeuristicResult" do
26
+ optional :heuristic, :string, 1
27
+ map :scores, :string, :double, 2
28
+ end
29
+ add_message "autopilotrpc.SetScoresRequest" do
30
+ optional :heuristic, :string, 1
31
+ map :scores, :string, :double, 2
32
+ end
33
+ add_message "autopilotrpc.SetScoresResponse" do
34
+ end
35
+ end
36
+ end
37
+
38
+ module Autopilotrpc
39
+ StatusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.StatusRequest").msgclass
40
+ StatusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.StatusResponse").msgclass
41
+ ModifyStatusRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.ModifyStatusRequest").msgclass
42
+ ModifyStatusResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.ModifyStatusResponse").msgclass
43
+ QueryScoresRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.QueryScoresRequest").msgclass
44
+ QueryScoresResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.QueryScoresResponse").msgclass
45
+ QueryScoresResponse::HeuristicResult = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.QueryScoresResponse.HeuristicResult").msgclass
46
+ SetScoresRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.SetScoresRequest").msgclass
47
+ SetScoresResponse = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("autopilotrpc.SetScoresResponse").msgclass
48
+ end
@@ -0,0 +1,40 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: autopilotrpc/autopilot.proto for package 'autopilotrpc'
3
+
4
+ require 'grpc'
5
+ require 'autopilotrpc/autopilot_pb'
6
+
7
+ module Autopilotrpc
8
+ module Autopilot
9
+ # Autopilot is a service that can be used to get information about the current
10
+ # state of the daemon's autopilot agent, and also supply it with information
11
+ # that can be used when deciding where to open channels.
12
+ class Service
13
+
14
+ include ::GRPC::GenericService
15
+
16
+ self.marshal_class_method = :encode
17
+ self.unmarshal_class_method = :decode
18
+ self.service_name = 'autopilotrpc.Autopilot'
19
+
20
+ #
21
+ # Status returns whether the daemon's autopilot agent is active.
22
+ rpc :Status, ::Autopilotrpc::StatusRequest, ::Autopilotrpc::StatusResponse
23
+ #
24
+ # ModifyStatus is used to modify the status of the autopilot agent, like
25
+ # enabling or disabling it.
26
+ rpc :ModifyStatus, ::Autopilotrpc::ModifyStatusRequest, ::Autopilotrpc::ModifyStatusResponse
27
+ #
28
+ # QueryScores queries all available autopilot heuristics, in addition to any
29
+ # active combination of these heruristics, for the scores they would give to
30
+ # the given nodes.
31
+ rpc :QueryScores, ::Autopilotrpc::QueryScoresRequest, ::Autopilotrpc::QueryScoresResponse
32
+ #
33
+ # SetScores attempts to set the scores used by the running autopilot agent,
34
+ # if the external scoring heuristic is enabled.
35
+ rpc :SetScores, ::Autopilotrpc::SetScoresRequest, ::Autopilotrpc::SetScoresResponse
36
+ end
37
+
38
+ Stub = Service.rpc_stub_class
39
+ end
40
+ end
@@ -0,0 +1,67 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # source: chainrpc/chainnotifier.proto
3
+
4
+ require 'google/protobuf'
5
+
6
+ Google::Protobuf::DescriptorPool.generated_pool.build do
7
+ add_file("chainrpc/chainnotifier.proto", :syntax => :proto3) do
8
+ add_message "chainrpc.ConfRequest" do
9
+ optional :txid, :bytes, 1
10
+ optional :script, :bytes, 2
11
+ optional :num_confs, :uint32, 3
12
+ optional :height_hint, :uint32, 4
13
+ end
14
+ add_message "chainrpc.ConfDetails" do
15
+ optional :raw_tx, :bytes, 1
16
+ optional :block_hash, :bytes, 2
17
+ optional :block_height, :uint32, 3
18
+ optional :tx_index, :uint32, 4
19
+ end
20
+ add_message "chainrpc.Reorg" do
21
+ end
22
+ add_message "chainrpc.ConfEvent" do
23
+ oneof :event do
24
+ optional :conf, :message, 1, "chainrpc.ConfDetails"
25
+ optional :reorg, :message, 2, "chainrpc.Reorg"
26
+ end
27
+ end
28
+ add_message "chainrpc.Outpoint" do
29
+ optional :hash, :bytes, 1
30
+ optional :index, :uint32, 2
31
+ end
32
+ add_message "chainrpc.SpendRequest" do
33
+ optional :outpoint, :message, 1, "chainrpc.Outpoint"
34
+ optional :script, :bytes, 2
35
+ optional :height_hint, :uint32, 3
36
+ end
37
+ add_message "chainrpc.SpendDetails" do
38
+ optional :spending_outpoint, :message, 1, "chainrpc.Outpoint"
39
+ optional :raw_spending_tx, :bytes, 2
40
+ optional :spending_tx_hash, :bytes, 3
41
+ optional :spending_input_index, :uint32, 4
42
+ optional :spending_height, :uint32, 5
43
+ end
44
+ add_message "chainrpc.SpendEvent" do
45
+ oneof :event do
46
+ optional :spend, :message, 1, "chainrpc.SpendDetails"
47
+ optional :reorg, :message, 2, "chainrpc.Reorg"
48
+ end
49
+ end
50
+ add_message "chainrpc.BlockEpoch" do
51
+ optional :hash, :bytes, 1
52
+ optional :height, :uint32, 2
53
+ end
54
+ end
55
+ end
56
+
57
+ module Chainrpc
58
+ ConfRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.ConfRequest").msgclass
59
+ ConfDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.ConfDetails").msgclass
60
+ Reorg = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.Reorg").msgclass
61
+ ConfEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.ConfEvent").msgclass
62
+ Outpoint = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.Outpoint").msgclass
63
+ SpendRequest = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.SpendRequest").msgclass
64
+ SpendDetails = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.SpendDetails").msgclass
65
+ SpendEvent = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.SpendEvent").msgclass
66
+ BlockEpoch = ::Google::Protobuf::DescriptorPool.generated_pool.lookup("chainrpc.BlockEpoch").msgclass
67
+ end
@@ -0,0 +1,51 @@
1
+ # Generated by the protocol buffer compiler. DO NOT EDIT!
2
+ # Source: chainrpc/chainnotifier.proto for package 'chainrpc'
3
+
4
+ require 'grpc'
5
+ require 'chainrpc/chainnotifier_pb'
6
+
7
+ module Chainrpc
8
+ module ChainNotifier
9
+ # ChainNotifier is a service that can be used to get information about the
10
+ # chain backend by registering notifiers for chain events.
11
+ class Service
12
+
13
+ include ::GRPC::GenericService
14
+
15
+ self.marshal_class_method = :encode
16
+ self.unmarshal_class_method = :decode
17
+ self.service_name = 'chainrpc.ChainNotifier'
18
+
19
+ #
20
+ # RegisterConfirmationsNtfn is a synchronous response-streaming RPC that
21
+ # registers an intent for a client to be notified once a confirmation request
22
+ # has reached its required number of confirmations on-chain.
23
+ #
24
+ # A client can specify whether the confirmation request should be for a
25
+ # particular transaction by its hash or for an output script by specifying a
26
+ # zero hash.
27
+ rpc :RegisterConfirmationsNtfn, ::Chainrpc::ConfRequest, stream(::Chainrpc::ConfEvent)
28
+ #
29
+ # RegisterSpendNtfn is a synchronous response-streaming RPC that registers an
30
+ # intent for a client to be notification once a spend request has been spent
31
+ # by a transaction that has confirmed on-chain.
32
+ #
33
+ # A client can specify whether the spend request should be for a particular
34
+ # outpoint or for an output script by specifying a zero outpoint.
35
+ rpc :RegisterSpendNtfn, ::Chainrpc::SpendRequest, stream(::Chainrpc::SpendEvent)
36
+ #
37
+ # RegisterBlockEpochNtfn is a synchronous response-streaming RPC that
38
+ # registers an intent for a client to be notified of blocks in the chain. The
39
+ # stream will return a hash and height tuple of a block for each new/stale
40
+ # block in the chain. It is the client's responsibility to determine whether
41
+ # the tuple returned is for a new or stale block in the chain.
42
+ #
43
+ # A client can also request a historical backlog of blocks from a particular
44
+ # point. This allows clients to be idempotent by ensuring that they do not
45
+ # missing processing a single block within the chain.
46
+ rpc :RegisterBlockEpochNtfn, ::Chainrpc::BlockEpoch, stream(::Chainrpc::BlockEpoch)
47
+ end
48
+
49
+ Stub = Service.rpc_stub_class
50
+ end
51
+ end