grpc: bump grpc to v0.16.4

To reproduce, run ./build_grpc.sh in lndmanage/grpc_compiled.
This commit is contained in:
bitromortac 2023-12-27 12:37:12 +01:00
parent 480d887fe5
commit 0103453663
No known key found for this signature in database
GPG key ID: 1965063FC13BEBE2
8 changed files with 1247 additions and 3712 deletions

View file

@ -1,11 +1,12 @@
#!/bin/bash
git clone https://github.com/googleapis/googleapis.git
git clone --depth=1 https://github.com/googleapis/googleapis.git
rm -rf temp
python -m venv temp
source temp/bin/activate
pip install --upgrade pip
pip install grpcio==1.51.3 grpcio-tools==1.48.2 googleapis-common-protos==1.58.0 protobuf==3.20.3
pip install grpcio==1.60.0 grpcio-tools==1.60.0 protobuf==4.25.1
tag="v0.15.5-beta"
tag="v0.16.4-beta"
wget "https://raw.githubusercontent.com/lightningnetwork/lnd/${tag}/lnrpc/lightning.proto" -O lightning.proto
wget "https://raw.githubusercontent.com/lightningnetwork/lnd/${tag}/lnrpc/routerrpc/router.proto" -O router.proto

File diff suppressed because one or more lines are too long

View file

@ -362,6 +362,11 @@ class LightningStub(object):
request_serializer=lightning__pb2.ListAliasesRequest.SerializeToString,
response_deserializer=lightning__pb2.ListAliasesResponse.FromString,
)
self.LookupHtlcResolution = channel.unary_unary(
'/lnrpc.Lightning/LookupHtlcResolution',
request_serializer=lightning__pb2.LookupHtlcResolutionRequest.SerializeToString,
response_deserializer=lightning__pb2.LookupHtlcResolutionResponse.FromString,
)
class LightningServicer(object):
@ -1097,6 +1102,10 @@ class LightningServicer(object):
"""lncli: `subscribecustom`
SubscribeCustomMessages subscribes to a stream of incoming custom peer
messages.
To include messages with type outside of the custom range (>= 32768) lnd
needs to be compiled with the `dev` build tag, and the message type to
override should be specified in lnd's experimental protocol configuration.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
@ -1112,6 +1121,16 @@ class LightningServicer(object):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def LookupHtlcResolution(self, request, context):
"""
LookupHtlcResolution retrieves a final htlc resolution from the database.
If the htlc has no final resolution yet, a NotFound grpc status code is
returned.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def add_LightningServicer_to_server(servicer, server):
rpc_method_handlers = {
@ -1445,6 +1464,11 @@ def add_LightningServicer_to_server(servicer, server):
request_deserializer=lightning__pb2.ListAliasesRequest.FromString,
response_serializer=lightning__pb2.ListAliasesResponse.SerializeToString,
),
'LookupHtlcResolution': grpc.unary_unary_rpc_method_handler(
servicer.LookupHtlcResolution,
request_deserializer=lightning__pb2.LookupHtlcResolutionRequest.FromString,
response_serializer=lightning__pb2.LookupHtlcResolutionResponse.SerializeToString,
),
}
generic_handler = grpc.method_handlers_generic_handler(
'lnrpc.Lightning', rpc_method_handlers)
@ -2594,3 +2618,20 @@ class Lightning(object):
lightning__pb2.ListAliasesResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def LookupHtlcResolution(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/lnrpc.Lightning/LookupHtlcResolution',
lightning__pb2.LookupHtlcResolutionRequest.SerializeToString,
lightning__pb2.LookupHtlcResolutionResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

File diff suppressed because one or more lines are too long

View file

@ -27,6 +27,11 @@ class RouterStub(object):
request_serializer=router__pb2.TrackPaymentRequest.SerializeToString,
response_deserializer=lightning__pb2.Payment.FromString,
)
self.TrackPayments = channel.unary_stream(
'/routerrpc.Router/TrackPayments',
request_serializer=router__pb2.TrackPaymentsRequest.SerializeToString,
response_deserializer=lightning__pb2.Payment.FromString,
)
self.EstimateRouteFee = channel.unary_unary(
'/routerrpc.Router/EstimateRouteFee',
request_serializer=router__pb2.RouteFeeRequest.SerializeToString,
@ -128,6 +133,19 @@ class RouterServicer(object):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def TrackPayments(self, request, context):
"""
TrackPayments returns an update stream for every payment that is not in a
terminal state. Note that if payments are in-flight while starting a new
subscription, the start of the payment stream could produce out-of-order
and/or duplicate events. In order to get updates for every in-flight
payment attempt make sure to subscribe to this method before initiating any
payments.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def EstimateRouteFee(self, request, context):
"""
EstimateRouteFee allows callers to obtain a lower bound w.r.t how much it
@ -208,8 +226,10 @@ class RouterServicer(object):
def QueryProbability(self, request, context):
"""
QueryProbability returns the current success probability estimate for a
given node pair and amount.
Deprecated. QueryProbability returns the current success probability
estimate for a given node pair and amount. The call returns a zero success
probability if no channel is available or if the amount violates min/max
HTLC constraints.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
@ -289,6 +309,11 @@ def add_RouterServicer_to_server(servicer, server):
request_deserializer=router__pb2.TrackPaymentRequest.FromString,
response_serializer=lightning__pb2.Payment.SerializeToString,
),
'TrackPayments': grpc.unary_stream_rpc_method_handler(
servicer.TrackPayments,
request_deserializer=router__pb2.TrackPaymentsRequest.FromString,
response_serializer=lightning__pb2.Payment.SerializeToString,
),
'EstimateRouteFee': grpc.unary_unary_rpc_method_handler(
servicer.EstimateRouteFee,
request_deserializer=router__pb2.RouteFeeRequest.FromString,
@ -410,6 +435,23 @@ class Router(object):
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def TrackPayments(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_stream(request, target, '/routerrpc.Router/TrackPayments',
router__pb2.TrackPaymentsRequest.SerializeToString,
lightning__pb2.Payment.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def EstimateRouteFee(request,
target,

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -62,6 +62,21 @@ class WalletKitStub(object):
request_serializer=walletkit__pb2.RequiredReserveRequest.SerializeToString,
response_deserializer=walletkit__pb2.RequiredReserveResponse.FromString,
)
self.ListAddresses = channel.unary_unary(
'/walletrpc.WalletKit/ListAddresses',
request_serializer=walletkit__pb2.ListAddressesRequest.SerializeToString,
response_deserializer=walletkit__pb2.ListAddressesResponse.FromString,
)
self.SignMessageWithAddr = channel.unary_unary(
'/walletrpc.WalletKit/SignMessageWithAddr',
request_serializer=walletkit__pb2.SignMessageWithAddrRequest.SerializeToString,
response_deserializer=walletkit__pb2.SignMessageWithAddrResponse.FromString,
)
self.VerifyMessageWithAddr = channel.unary_unary(
'/walletrpc.WalletKit/VerifyMessageWithAddr',
request_serializer=walletkit__pb2.VerifyMessageWithAddrRequest.SerializeToString,
response_deserializer=walletkit__pb2.VerifyMessageWithAddrResponse.FromString,
)
self.ImportAccount = channel.unary_unary(
'/walletrpc.WalletKit/ImportAccount',
request_serializer=walletkit__pb2.ImportAccountRequest.SerializeToString,
@ -72,6 +87,11 @@ class WalletKitStub(object):
request_serializer=walletkit__pb2.ImportPublicKeyRequest.SerializeToString,
response_deserializer=walletkit__pb2.ImportPublicKeyResponse.FromString,
)
self.ImportTapscript = channel.unary_unary(
'/walletrpc.WalletKit/ImportTapscript',
request_serializer=walletkit__pb2.ImportTapscriptRequest.SerializeToString,
response_deserializer=walletkit__pb2.ImportTapscriptResponse.FromString,
)
self.PublishTransaction = channel.unary_unary(
'/walletrpc.WalletKit/PublishTransaction',
request_serializer=walletkit__pb2.Transaction.SerializeToString,
@ -217,6 +237,61 @@ class WalletKitServicer(object):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ListAddresses(self, request, context):
"""
ListAddresses retrieves all the addresses along with their balance. An
account name filter can be provided to filter through all of the
wallet accounts and return the addresses of only those matching.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def SignMessageWithAddr(self, request, context):
"""
SignMessageWithAddr returns the compact signature (base64 encoded) created
with the private key of the provided address. This requires the address
to be solely based on a public key lock (no scripts). Obviously the internal
lnd wallet has to possess the private key of the address otherwise
an error is returned.
This method aims to provide full compatibility with the bitcoin-core and
btcd implementation. Bitcoin-core's algorithm is not specified in a
BIP and only applicable for legacy addresses. This method enhances the
signing for additional address types: P2WKH, NP2WKH, P2TR.
For P2TR addresses this represents a special case. ECDSA is used to create
a compact signature which makes the public key of the signature recoverable.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def VerifyMessageWithAddr(self, request, context):
"""
VerifyMessageWithAddr returns the validity and the recovered public key of
the provided compact signature (base64 encoded). The verification is
twofold. First the validity of the signature itself is checked and then
it is verified that the recovered public key of the signature equals
the public key of the provided address. There is no dependence on the
private key of the address therefore also external addresses are allowed
to verify signatures.
Supported address types are P2PKH, P2WKH, NP2WKH, P2TR.
This method is the counterpart of the related signing method
(SignMessageWithAddr) and aims to provide full compatibility to
bitcoin-core's implementation. Although bitcoin-core/btcd only provide
this functionality for legacy addresses this function enhances it to
the address types: P2PKH, P2WKH, NP2WKH, P2TR.
The verification for P2TR addresses is a special case and requires the
ECDSA compact signature to compare the reovered public key to the internal
taproot key. The compact ECDSA signature format was used because there
are still no known compact signature schemes for schnorr signatures.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ImportAccount(self, request, context):
"""
ImportAccount imports an account backed by an account extended public key.
@ -249,7 +324,11 @@ class WalletKitServicer(object):
def ImportPublicKey(self, request, context):
"""
ImportPublicKey imports a public key as watch-only into the wallet.
ImportPublicKey imports a public key as watch-only into the wallet. The
public key is converted into a simple address of the given type and that
address script is watched on chain. For Taproot keys, this will only watch
the BIP-0086 style output script. Use ImportTapscript for more advanced key
spend or script spend outputs.
NOTE: Events (deposits/spends) for a key will only be detected by lnd if
they happen after the import. Rescans to detect past events will be
@ -259,6 +338,24 @@ class WalletKitServicer(object):
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def ImportTapscript(self, request, context):
"""
ImportTapscript imports a Taproot script and internal key and adds the
resulting Taproot output key as a watch-only output script into the wallet.
For BIP-0086 style Taproot keys (no root hash commitment and no script spend
path) use ImportPublicKey.
NOTE: Events (deposits/spends) for a key will only be detected by lnd if
they happen after the import. Rescans to detect past events will be
supported later on.
NOTE: Taproot keys imported through this RPC currently _cannot_ be used for
funding PSBTs. Only tracking the balance and UTXOs is currently supported.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')
def PublishTransaction(self, request, context):
"""
PublishTransaction attempts to publish the passed transaction to the
@ -467,6 +564,21 @@ def add_WalletKitServicer_to_server(servicer, server):
request_deserializer=walletkit__pb2.RequiredReserveRequest.FromString,
response_serializer=walletkit__pb2.RequiredReserveResponse.SerializeToString,
),
'ListAddresses': grpc.unary_unary_rpc_method_handler(
servicer.ListAddresses,
request_deserializer=walletkit__pb2.ListAddressesRequest.FromString,
response_serializer=walletkit__pb2.ListAddressesResponse.SerializeToString,
),
'SignMessageWithAddr': grpc.unary_unary_rpc_method_handler(
servicer.SignMessageWithAddr,
request_deserializer=walletkit__pb2.SignMessageWithAddrRequest.FromString,
response_serializer=walletkit__pb2.SignMessageWithAddrResponse.SerializeToString,
),
'VerifyMessageWithAddr': grpc.unary_unary_rpc_method_handler(
servicer.VerifyMessageWithAddr,
request_deserializer=walletkit__pb2.VerifyMessageWithAddrRequest.FromString,
response_serializer=walletkit__pb2.VerifyMessageWithAddrResponse.SerializeToString,
),
'ImportAccount': grpc.unary_unary_rpc_method_handler(
servicer.ImportAccount,
request_deserializer=walletkit__pb2.ImportAccountRequest.FromString,
@ -477,6 +589,11 @@ def add_WalletKitServicer_to_server(servicer, server):
request_deserializer=walletkit__pb2.ImportPublicKeyRequest.FromString,
response_serializer=walletkit__pb2.ImportPublicKeyResponse.SerializeToString,
),
'ImportTapscript': grpc.unary_unary_rpc_method_handler(
servicer.ImportTapscript,
request_deserializer=walletkit__pb2.ImportTapscriptRequest.FromString,
response_serializer=walletkit__pb2.ImportTapscriptResponse.SerializeToString,
),
'PublishTransaction': grpc.unary_unary_rpc_method_handler(
servicer.PublishTransaction,
request_deserializer=walletkit__pb2.Transaction.FromString,
@ -692,6 +809,57 @@ class WalletKit(object):
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ListAddresses(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/walletrpc.WalletKit/ListAddresses',
walletkit__pb2.ListAddressesRequest.SerializeToString,
walletkit__pb2.ListAddressesResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def SignMessageWithAddr(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/walletrpc.WalletKit/SignMessageWithAddr',
walletkit__pb2.SignMessageWithAddrRequest.SerializeToString,
walletkit__pb2.SignMessageWithAddrResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def VerifyMessageWithAddr(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/walletrpc.WalletKit/VerifyMessageWithAddr',
walletkit__pb2.VerifyMessageWithAddrRequest.SerializeToString,
walletkit__pb2.VerifyMessageWithAddrResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ImportAccount(request,
target,
@ -726,6 +894,23 @@ class WalletKit(object):
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def ImportTapscript(request,
target,
options=(),
channel_credentials=None,
call_credentials=None,
insecure=False,
compression=None,
wait_for_ready=None,
timeout=None,
metadata=None):
return grpc.experimental.unary_unary(request, target, '/walletrpc.WalletKit/ImportTapscript',
walletkit__pb2.ImportTapscriptRequest.SerializeToString,
walletkit__pb2.ImportTapscriptResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
@staticmethod
def PublishTransaction(request,
target,