mirror of
https://github.com/lightninglabs/loop.git
synced 2026-08-13 12:33:03 +02:00
make+looprpc: use Docker to compile and format protos
This commit is contained in:
parent
67c81204f6
commit
86df44362f
13 changed files with 4334 additions and 2409 deletions
8
Makefile
8
Makefile
|
|
@ -74,5 +74,9 @@ install:
|
||||||
$(GOINSTALL) -tags="${tags}" $(LDFLAGS) $(PKG)/cmd/loopd
|
$(GOINSTALL) -tags="${tags}" $(LDFLAGS) $(PKG)/cmd/loopd
|
||||||
|
|
||||||
rpc:
|
rpc:
|
||||||
@$(call print, "Compiling RPC protos.")
|
@$(call print, "Compiling protos.")
|
||||||
cd looprpc; ./gen_protos.sh
|
cd ./looprpc; ./gen_protos_docker.sh
|
||||||
|
|
||||||
|
rpc-check: rpc
|
||||||
|
@$(call print, "Verifying protos.")
|
||||||
|
if test -n "$$(git describe --dirty | grep dirty)"; then echo "Protos not properly formatted or not compiled with correct version!"; git status; git diff; exit 1; fi
|
||||||
|
|
|
||||||
2
go.mod
2
go.mod
|
|
@ -21,8 +21,8 @@ require (
|
||||||
github.com/stretchr/testify v1.7.0
|
github.com/stretchr/testify v1.7.0
|
||||||
github.com/urfave/cli v1.20.0
|
github.com/urfave/cli v1.20.0
|
||||||
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7
|
golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7
|
||||||
google.golang.org/genproto v0.0.0-20190927181202-20e1ac93f88c
|
|
||||||
google.golang.org/grpc v1.29.1
|
google.golang.org/grpc v1.29.1
|
||||||
|
google.golang.org/protobuf v1.23.0
|
||||||
gopkg.in/macaroon-bakery.v2 v2.0.1
|
gopkg.in/macaroon-bakery.v2 v2.0.1
|
||||||
gopkg.in/macaroon.v2 v2.1.0
|
gopkg.in/macaroon.v2 v2.1.0
|
||||||
)
|
)
|
||||||
|
|
|
||||||
7
looprpc/.clang-format
Normal file
7
looprpc/.clang-format
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
---
|
||||||
|
Language: Proto
|
||||||
|
BasedOnStyle: Google
|
||||||
|
IndentWidth: 4
|
||||||
|
AllowShortFunctionsOnASingleLine: None
|
||||||
|
SpaceBeforeParens: Always
|
||||||
|
CompactNamespaces: false
|
||||||
22
looprpc/Dockerfile
Normal file
22
looprpc/Dockerfile
Normal file
|
|
@ -0,0 +1,22 @@
|
||||||
|
FROM golang:1.15.6-buster
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y \
|
||||||
|
git \
|
||||||
|
protobuf-compiler='3.6*' \
|
||||||
|
clang-format='1:7.0*'
|
||||||
|
|
||||||
|
# We don't want any default values for these variables to make sure they're
|
||||||
|
# explicitly provided by parsing the go.mod file. Otherwise we might forget to
|
||||||
|
# update them here if we bump the versions.
|
||||||
|
ARG PROTOC_GEN_VERSION
|
||||||
|
ARG GRPC_GATEWAY_VERSION
|
||||||
|
|
||||||
|
RUN cd /tmp \
|
||||||
|
&& export GO111MODULE=on \
|
||||||
|
&& go get github.com/golang/protobuf/protoc-gen-go@${PROTOC_GEN_VERSION} \
|
||||||
|
&& go get github.com/grpc-ecosystem/grpc-gateway/protoc-gen-grpc-gateway@${GRPC_GATEWAY_VERSION} \
|
||||||
|
&& go get github.com/grpc-ecosystem/grpc-gateway/protoc-gen-swagger@${GRPC_GATEWAY_VERSION}
|
||||||
|
|
||||||
|
WORKDIR /build
|
||||||
|
|
||||||
|
CMD ["/bin/bash", "/build/looprpc/gen_protos.sh"]
|
||||||
3456
looprpc/client.pb.go
3456
looprpc/client.pb.go
File diff suppressed because it is too large
Load diff
|
|
@ -2,6 +2,8 @@ syntax = "proto3";
|
||||||
|
|
||||||
package looprpc;
|
package looprpc;
|
||||||
|
|
||||||
|
option go_package = "github.com/lightninglabs/loop/looprpc";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
SwapClient is a service that handles the client side process of onchain/offchain
|
SwapClient is a service that handles the client side process of onchain/offchain
|
||||||
swaps. The service is designed for a single client.
|
swaps. The service is designed for a single client.
|
||||||
|
|
@ -103,9 +105,9 @@ message LoopOutRequest {
|
||||||
string dest = 2;
|
string dest = 2;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Maximum off-chain fee in sat that may be paid for swap payment to the server.
|
Maximum off-chain fee in sat that may be paid for swap payment to the
|
||||||
This limit is applied during path finding. Typically this value is taken
|
server. This limit is applied during path finding. Typically this value is
|
||||||
from the response of the GetQuote call.
|
taken from the response of the GetQuote call.
|
||||||
*/
|
*/
|
||||||
int64 max_swap_routing_fee = 3;
|
int64 max_swap_routing_fee = 3;
|
||||||
|
|
||||||
|
|
@ -201,7 +203,7 @@ message LoopOutRequest {
|
||||||
|
|
||||||
message LoopInRequest {
|
message LoopInRequest {
|
||||||
/*
|
/*
|
||||||
Requested swap amount in sat. This does not include the swap and miner
|
Requested swap amount in sat. This does not include the swap and miner
|
||||||
fee.
|
fee.
|
||||||
*/
|
*/
|
||||||
int64 amt = 1;
|
int64 amt = 1;
|
||||||
|
|
@ -217,7 +219,7 @@ message LoopInRequest {
|
||||||
/*
|
/*
|
||||||
Maximum in on-chain fees that we are willing to spend. If we want to
|
Maximum in on-chain fees that we are willing to spend. If we want to
|
||||||
publish the on-chain htlc and the fee estimate turns out higher than this
|
publish the on-chain htlc and the fee estimate turns out higher than this
|
||||||
value, we cancel the swap.
|
value, we cancel the swap.
|
||||||
|
|
||||||
max_miner_fee is typically taken from the response of the GetQuote call.
|
max_miner_fee is typically taken from the response of the GetQuote call.
|
||||||
*/
|
*/
|
||||||
|
|
@ -497,7 +499,6 @@ message TermsRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
message InTermsResponse {
|
message InTermsResponse {
|
||||||
|
|
||||||
reserved 1, 2, 3, 4, 7;
|
reserved 1, 2, 3, 4, 7;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -512,7 +513,6 @@ message InTermsResponse {
|
||||||
}
|
}
|
||||||
|
|
||||||
message OutTermsResponse {
|
message OutTermsResponse {
|
||||||
|
|
||||||
reserved 1, 2, 3, 4, 7;
|
reserved 1, 2, 3, 4, 7;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
@ -691,7 +691,7 @@ message LiquidityParameters {
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The parts per million of swap amount that is allowed to be allocated to swap
|
The parts per million of swap amount that is allowed to be allocated to swap
|
||||||
fees. This value is applied across swap categories and may not be set in
|
fees. This value is applied across swap categories and may not be set in
|
||||||
conjunction with sweep fee rate, swap fee ppm, routing fee ppm, prepay
|
conjunction with sweep fee rate, swap fee ppm, routing fee ppm, prepay
|
||||||
routing, max prepay and max miner fee.
|
routing, max prepay and max miner fee.
|
||||||
*/
|
*/
|
||||||
|
|
@ -750,8 +750,8 @@ message LiquidityParameters {
|
||||||
uint64 failure_backoff_sec = 9;
|
uint64 failure_backoff_sec = 9;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Set to true to enable automatic dispatch of swaps. All swaps will be limited
|
Set to true to enable automatic dispatch of swaps. All swaps will be limited
|
||||||
to the fee categories set by these parameters, and total expenditure will
|
to the fee categories set by these parameters, and total expenditure will
|
||||||
be limited to the autoloop budget.
|
be limited to the autoloop budget.
|
||||||
*/
|
*/
|
||||||
bool autoloop = 10;
|
bool autoloop = 10;
|
||||||
|
|
@ -803,7 +803,7 @@ message LiquidityRule {
|
||||||
*/
|
*/
|
||||||
uint64 channel_id = 1;
|
uint64 channel_id = 1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The public key of the peer that this rule should be applied to. This field
|
The public key of the peer that this rule should be applied to. This field
|
||||||
may not be set when the channel id field is set.
|
may not be set when the channel id field is set.
|
||||||
*/
|
*/
|
||||||
|
|
@ -850,25 +850,25 @@ enum AutoReason {
|
||||||
AUTO_REASON_UNKNOWN = 0;
|
AUTO_REASON_UNKNOWN = 0;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Budget not started indicates that we do not recommend any swaps because
|
Budget not started indicates that we do not recommend any swaps because
|
||||||
the start time for our budget has not arrived yet.
|
the start time for our budget has not arrived yet.
|
||||||
*/
|
*/
|
||||||
AUTO_REASON_BUDGET_NOT_STARTED = 1;
|
AUTO_REASON_BUDGET_NOT_STARTED = 1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Sweep fees indicates that the estimated fees to sweep swaps are too high
|
Sweep fees indicates that the estimated fees to sweep swaps are too high
|
||||||
right now.
|
right now.
|
||||||
*/
|
*/
|
||||||
AUTO_REASON_SWEEP_FEES = 2;
|
AUTO_REASON_SWEEP_FEES = 2;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Budget elapsed indicates that the autoloop budget for the period has been
|
Budget elapsed indicates that the autoloop budget for the period has been
|
||||||
elapsed.
|
elapsed.
|
||||||
*/
|
*/
|
||||||
AUTO_REASON_BUDGET_ELAPSED = 3;
|
AUTO_REASON_BUDGET_ELAPSED = 3;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
In flight indicates that the limit on in-flight automatically dispatched
|
In flight indicates that the limit on in-flight automatically dispatched
|
||||||
swaps has already been reached.
|
swaps has already been reached.
|
||||||
*/
|
*/
|
||||||
AUTO_REASON_IN_FLIGHT = 4;
|
AUTO_REASON_IN_FLIGHT = 4;
|
||||||
|
|
@ -901,21 +901,21 @@ enum AutoReason {
|
||||||
AUTO_REASON_LOOP_OUT = 9;
|
AUTO_REASON_LOOP_OUT = 9;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Loop In indicates that a loop in swap is currently in flight for the peer,
|
Loop In indicates that a loop in swap is currently in flight for the peer,
|
||||||
so it is not eligible.
|
so it is not eligible.
|
||||||
*/
|
*/
|
||||||
AUTO_REASON_LOOP_IN = 10;
|
AUTO_REASON_LOOP_IN = 10;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Liquidity ok indicates that a target meets the liquidity balance expressed
|
Liquidity ok indicates that a target meets the liquidity balance expressed
|
||||||
in its rule, so no swap is needed.
|
in its rule, so no swap is needed.
|
||||||
*/
|
*/
|
||||||
AUTO_REASON_LIQUIDITY_OK = 11;
|
AUTO_REASON_LIQUIDITY_OK = 11;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Budget insufficient indicates that we cannot perform a swap because we do
|
Budget insufficient indicates that we cannot perform a swap because we do
|
||||||
not have enough pending budget available. This differs from budget elapsed,
|
not have enough pending budget available. This differs from budget elapsed,
|
||||||
because we still have some budget available, but we have allocated it to
|
because we still have some budget available, but we have allocated it to
|
||||||
other swaps.
|
other swaps.
|
||||||
*/
|
*/
|
||||||
AUTO_REASON_BUDGET_INSUFFICIENT = 12;
|
AUTO_REASON_BUDGET_INSUFFICIENT = 12;
|
||||||
|
|
@ -925,14 +925,14 @@ enum AutoReason {
|
||||||
the portion of total swap amount that we allow fees to consume.
|
the portion of total swap amount that we allow fees to consume.
|
||||||
*/
|
*/
|
||||||
AUTO_REASON_FEE_INSUFFICIENT = 13;
|
AUTO_REASON_FEE_INSUFFICIENT = 13;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Disqualified {
|
message Disqualified {
|
||||||
/*
|
/*
|
||||||
The short channel ID of the channel that was excluded from our suggestions.
|
The short channel ID of the channel that was excluded from our suggestions.
|
||||||
*/
|
*/
|
||||||
uint64 channel_id = 1;
|
uint64 channel_id = 1;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
The public key of the peer that was excluded from our suggestions.
|
The public key of the peer that was excluded from our suggestions.
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -414,7 +414,7 @@
|
||||||
"AUTO_REASON_FEE_INSUFFICIENT"
|
"AUTO_REASON_FEE_INSUFFICIENT"
|
||||||
],
|
],
|
||||||
"default": "AUTO_REASON_UNKNOWN",
|
"default": "AUTO_REASON_UNKNOWN",
|
||||||
"description": " - AUTO_REASON_BUDGET_NOT_STARTED: Budget not started indicates that we do not recommend any swaps because \nthe start time for our budget has not arrived yet.\n - AUTO_REASON_SWEEP_FEES: Sweep fees indicates that the estimated fees to sweep swaps are too high \nright now.\n - AUTO_REASON_BUDGET_ELAPSED: Budget elapsed indicates that the autoloop budget for the period has been \nelapsed.\n - AUTO_REASON_IN_FLIGHT: In flight indicates that the limit on in-flight automatically dispatched \nswaps has already been reached.\n - AUTO_REASON_SWAP_FEE: Swap fee indicates that the server fee for a specific swap is too high.\n - AUTO_REASON_MINER_FEE: Miner fee indicates that the miner fee for a specific swap is to high.\n - AUTO_REASON_PREPAY: Prepay indicates that the prepay fee for a specific swap is too high.\n - AUTO_REASON_FAILURE_BACKOFF: Failure backoff indicates that a swap has recently failed for this target,\nand the backoff period has not yet passed.\n - AUTO_REASON_LOOP_OUT: Loop out indicates that a loop out swap is currently utilizing the channel,\nso it is not eligible.\n - AUTO_REASON_LOOP_IN: Loop In indicates that a loop in swap is currently in flight for the peer, \nso it is not eligible.\n - AUTO_REASON_LIQUIDITY_OK: Liquidity ok indicates that a target meets the liquidity balance expressed \nin its rule, so no swap is needed.\n - AUTO_REASON_BUDGET_INSUFFICIENT: Budget insufficient indicates that we cannot perform a swap because we do \nnot have enough pending budget available. This differs from budget elapsed, \nbecause we still have some budget available, but we have allocated it to \nother swaps.\n - AUTO_REASON_FEE_INSUFFICIENT: Fee insufficient indicates that the fee estimate for a swap is higher than\nthe portion of total swap amount that we allow fees to consume."
|
"description": " - AUTO_REASON_BUDGET_NOT_STARTED: Budget not started indicates that we do not recommend any swaps because\nthe start time for our budget has not arrived yet.\n - AUTO_REASON_SWEEP_FEES: Sweep fees indicates that the estimated fees to sweep swaps are too high\nright now.\n - AUTO_REASON_BUDGET_ELAPSED: Budget elapsed indicates that the autoloop budget for the period has been\nelapsed.\n - AUTO_REASON_IN_FLIGHT: In flight indicates that the limit on in-flight automatically dispatched\nswaps has already been reached.\n - AUTO_REASON_SWAP_FEE: Swap fee indicates that the server fee for a specific swap is too high.\n - AUTO_REASON_MINER_FEE: Miner fee indicates that the miner fee for a specific swap is to high.\n - AUTO_REASON_PREPAY: Prepay indicates that the prepay fee for a specific swap is too high.\n - AUTO_REASON_FAILURE_BACKOFF: Failure backoff indicates that a swap has recently failed for this target,\nand the backoff period has not yet passed.\n - AUTO_REASON_LOOP_OUT: Loop out indicates that a loop out swap is currently utilizing the channel,\nso it is not eligible.\n - AUTO_REASON_LOOP_IN: Loop In indicates that a loop in swap is currently in flight for the peer,\nso it is not eligible.\n - AUTO_REASON_LIQUIDITY_OK: Liquidity ok indicates that a target meets the liquidity balance expressed\nin its rule, so no swap is needed.\n - AUTO_REASON_BUDGET_INSUFFICIENT: Budget insufficient indicates that we cannot perform a swap because we do\nnot have enough pending budget available. This differs from budget elapsed,\nbecause we still have some budget available, but we have allocated it to\nother swaps.\n - AUTO_REASON_FEE_INSUFFICIENT: Fee insufficient indicates that the fee estimate for a swap is higher than\nthe portion of total swap amount that we allow fees to consume."
|
||||||
},
|
},
|
||||||
"looprpcDisqualified": {
|
"looprpcDisqualified": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
|
|
@ -502,7 +502,7 @@
|
||||||
"fee_ppm": {
|
"fee_ppm": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "uint64",
|
"format": "uint64",
|
||||||
"description": "The parts per million of swap amount that is allowed to be allocated to swap\nfees. This value is applied across swap categories and may not be set in \nconjunction with sweep fee rate, swap fee ppm, routing fee ppm, prepay\nrouting, max prepay and max miner fee."
|
"description": "The parts per million of swap amount that is allowed to be allocated to swap\nfees. This value is applied across swap categories and may not be set in\nconjunction with sweep fee rate, swap fee ppm, routing fee ppm, prepay\nrouting, max prepay and max miner fee."
|
||||||
},
|
},
|
||||||
"sweep_fee_rate_sat_per_vbyte": {
|
"sweep_fee_rate_sat_per_vbyte": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
@ -547,7 +547,7 @@
|
||||||
"autoloop": {
|
"autoloop": {
|
||||||
"type": "boolean",
|
"type": "boolean",
|
||||||
"format": "boolean",
|
"format": "boolean",
|
||||||
"description": "Set to true to enable automatic dispatch of swaps. All swaps will be limited \nto the fee categories set by these parameters, and total expenditure will \nbe limited to the autoloop budget."
|
"description": "Set to true to enable automatic dispatch of swaps. All swaps will be limited\nto the fee categories set by these parameters, and total expenditure will\nbe limited to the autoloop budget."
|
||||||
},
|
},
|
||||||
"autoloop_budget_sat": {
|
"autoloop_budget_sat": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
@ -631,7 +631,7 @@
|
||||||
"amt": {
|
"amt": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "Requested swap amount in sat. This does not include the swap and miner \nfee."
|
"description": "Requested swap amount in sat. This does not include the swap and miner\nfee."
|
||||||
},
|
},
|
||||||
"max_swap_fee": {
|
"max_swap_fee": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
@ -641,7 +641,7 @@
|
||||||
"max_miner_fee": {
|
"max_miner_fee": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "Maximum in on-chain fees that we are willing to spend. If we want to\npublish the on-chain htlc and the fee estimate turns out higher than this\nvalue, we cancel the swap. \n\nmax_miner_fee is typically taken from the response of the GetQuote call."
|
"description": "Maximum in on-chain fees that we are willing to spend. If we want to\npublish the on-chain htlc and the fee estimate turns out higher than this\nvalue, we cancel the swap.\n\nmax_miner_fee is typically taken from the response of the GetQuote call."
|
||||||
},
|
},
|
||||||
"last_hop": {
|
"last_hop": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
@ -683,7 +683,7 @@
|
||||||
"max_swap_routing_fee": {
|
"max_swap_routing_fee": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
"format": "int64",
|
"format": "int64",
|
||||||
"description": "Maximum off-chain fee in sat that may be paid for swap payment to the server.\nThis limit is applied during path finding. Typically this value is taken\nfrom the response of the GetQuote call."
|
"description": "Maximum off-chain fee in sat that may be paid for swap payment to the\nserver. This limit is applied during path finding. Typically this value is\ntaken from the response of the GetQuote call."
|
||||||
},
|
},
|
||||||
"max_prepay_routing_fee": {
|
"max_prepay_routing_fee": {
|
||||||
"type": "string",
|
"type": "string",
|
||||||
|
|
|
||||||
|
|
@ -1,117 +1,214 @@
|
||||||
// Code generated by protoc-gen-go. DO NOT EDIT.
|
// Code generated by protoc-gen-go. DO NOT EDIT.
|
||||||
|
// versions:
|
||||||
|
// protoc-gen-go v1.23.0
|
||||||
|
// protoc v3.6.1
|
||||||
// source: debug.proto
|
// source: debug.proto
|
||||||
|
|
||||||
package looprpc
|
package looprpc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
context "context"
|
context "context"
|
||||||
fmt "fmt"
|
|
||||||
proto "github.com/golang/protobuf/proto"
|
proto "github.com/golang/protobuf/proto"
|
||||||
grpc "google.golang.org/grpc"
|
grpc "google.golang.org/grpc"
|
||||||
codes "google.golang.org/grpc/codes"
|
codes "google.golang.org/grpc/codes"
|
||||||
status "google.golang.org/grpc/status"
|
status "google.golang.org/grpc/status"
|
||||||
math "math"
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||||
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||||
|
reflect "reflect"
|
||||||
|
sync "sync"
|
||||||
)
|
)
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
const (
|
||||||
var _ = proto.Marshal
|
// Verify that this generated code is sufficiently up-to-date.
|
||||||
var _ = fmt.Errorf
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
||||||
var _ = math.Inf
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
||||||
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
||||||
|
)
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
// This is a compile-time assertion that a sufficiently up-to-date version
|
||||||
// is compatible with the proto package it is being compiled against.
|
// of the legacy proto package is being used.
|
||||||
// A compilation error at this line likely means your copy of the
|
const _ = proto.ProtoPackageIsVersion4
|
||||||
// proto package needs to be updated.
|
|
||||||
const _ = proto.ProtoPackageIsVersion3 // please upgrade the proto package
|
|
||||||
|
|
||||||
type ForceAutoLoopRequest struct {
|
type ForceAutoLoopRequest struct {
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
state protoimpl.MessageState
|
||||||
XXX_unrecognized []byte `json:"-"`
|
sizeCache protoimpl.SizeCache
|
||||||
XXX_sizecache int32 `json:"-"`
|
unknownFields protoimpl.UnknownFields
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ForceAutoLoopRequest) Reset() { *m = ForceAutoLoopRequest{} }
|
func (x *ForceAutoLoopRequest) Reset() {
|
||||||
func (m *ForceAutoLoopRequest) String() string { return proto.CompactTextString(m) }
|
*x = ForceAutoLoopRequest{}
|
||||||
func (*ForceAutoLoopRequest) ProtoMessage() {}
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_debug_proto_msgTypes[0]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ForceAutoLoopRequest) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ForceAutoLoopRequest) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ForceAutoLoopRequest) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_debug_proto_msgTypes[0]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use ForceAutoLoopRequest.ProtoReflect.Descriptor instead.
|
||||||
func (*ForceAutoLoopRequest) Descriptor() ([]byte, []int) {
|
func (*ForceAutoLoopRequest) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_8d9d361be58531fb, []int{0}
|
return file_debug_proto_rawDescGZIP(), []int{0}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ForceAutoLoopRequest) XXX_Unmarshal(b []byte) error {
|
|
||||||
return xxx_messageInfo_ForceAutoLoopRequest.Unmarshal(m, b)
|
|
||||||
}
|
|
||||||
func (m *ForceAutoLoopRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
|
||||||
return xxx_messageInfo_ForceAutoLoopRequest.Marshal(b, m, deterministic)
|
|
||||||
}
|
|
||||||
func (m *ForceAutoLoopRequest) XXX_Merge(src proto.Message) {
|
|
||||||
xxx_messageInfo_ForceAutoLoopRequest.Merge(m, src)
|
|
||||||
}
|
|
||||||
func (m *ForceAutoLoopRequest) XXX_Size() int {
|
|
||||||
return xxx_messageInfo_ForceAutoLoopRequest.Size(m)
|
|
||||||
}
|
|
||||||
func (m *ForceAutoLoopRequest) XXX_DiscardUnknown() {
|
|
||||||
xxx_messageInfo_ForceAutoLoopRequest.DiscardUnknown(m)
|
|
||||||
}
|
|
||||||
|
|
||||||
var xxx_messageInfo_ForceAutoLoopRequest proto.InternalMessageInfo
|
|
||||||
|
|
||||||
type ForceAutoLoopResponse struct {
|
type ForceAutoLoopResponse struct {
|
||||||
XXX_NoUnkeyedLiteral struct{} `json:"-"`
|
state protoimpl.MessageState
|
||||||
XXX_unrecognized []byte `json:"-"`
|
sizeCache protoimpl.SizeCache
|
||||||
XXX_sizecache int32 `json:"-"`
|
unknownFields protoimpl.UnknownFields
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ForceAutoLoopResponse) Reset() { *m = ForceAutoLoopResponse{} }
|
func (x *ForceAutoLoopResponse) Reset() {
|
||||||
func (m *ForceAutoLoopResponse) String() string { return proto.CompactTextString(m) }
|
*x = ForceAutoLoopResponse{}
|
||||||
func (*ForceAutoLoopResponse) ProtoMessage() {}
|
if protoimpl.UnsafeEnabled {
|
||||||
|
mi := &file_debug_proto_msgTypes[1]
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (x *ForceAutoLoopResponse) String() string {
|
||||||
|
return protoimpl.X.MessageStringOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (*ForceAutoLoopResponse) ProtoMessage() {}
|
||||||
|
|
||||||
|
func (x *ForceAutoLoopResponse) ProtoReflect() protoreflect.Message {
|
||||||
|
mi := &file_debug_proto_msgTypes[1]
|
||||||
|
if protoimpl.UnsafeEnabled && x != nil {
|
||||||
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
||||||
|
if ms.LoadMessageInfo() == nil {
|
||||||
|
ms.StoreMessageInfo(mi)
|
||||||
|
}
|
||||||
|
return ms
|
||||||
|
}
|
||||||
|
return mi.MessageOf(x)
|
||||||
|
}
|
||||||
|
|
||||||
|
// Deprecated: Use ForceAutoLoopResponse.ProtoReflect.Descriptor instead.
|
||||||
func (*ForceAutoLoopResponse) Descriptor() ([]byte, []int) {
|
func (*ForceAutoLoopResponse) Descriptor() ([]byte, []int) {
|
||||||
return fileDescriptor_8d9d361be58531fb, []int{1}
|
return file_debug_proto_rawDescGZIP(), []int{1}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *ForceAutoLoopResponse) XXX_Unmarshal(b []byte) error {
|
var File_debug_proto protoreflect.FileDescriptor
|
||||||
return xxx_messageInfo_ForceAutoLoopResponse.Unmarshal(m, b)
|
|
||||||
}
|
var file_debug_proto_rawDesc = []byte{
|
||||||
func (m *ForceAutoLoopResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
|
0x0a, 0x0b, 0x64, 0x65, 0x62, 0x75, 0x67, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x07, 0x6c,
|
||||||
return xxx_messageInfo_ForceAutoLoopResponse.Marshal(b, m, deterministic)
|
0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x22, 0x16, 0x0a, 0x14, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x41,
|
||||||
}
|
0x75, 0x74, 0x6f, 0x4c, 0x6f, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x17,
|
||||||
func (m *ForceAutoLoopResponse) XXX_Merge(src proto.Message) {
|
0x0a, 0x15, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x4c, 0x6f, 0x6f, 0x70, 0x52,
|
||||||
xxx_messageInfo_ForceAutoLoopResponse.Merge(m, src)
|
0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x32, 0x57, 0x0a, 0x05, 0x44, 0x65, 0x62, 0x75, 0x67,
|
||||||
}
|
0x12, 0x4e, 0x0a, 0x0d, 0x46, 0x6f, 0x72, 0x63, 0x65, 0x41, 0x75, 0x74, 0x6f, 0x4c, 0x6f, 0x6f,
|
||||||
func (m *ForceAutoLoopResponse) XXX_Size() int {
|
0x70, 0x12, 0x1d, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x6f, 0x72, 0x63,
|
||||||
return xxx_messageInfo_ForceAutoLoopResponse.Size(m)
|
0x65, 0x41, 0x75, 0x74, 0x6f, 0x4c, 0x6f, 0x6f, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,
|
||||||
}
|
0x1a, 0x1e, 0x2e, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x2e, 0x46, 0x6f, 0x72, 0x63, 0x65,
|
||||||
func (m *ForceAutoLoopResponse) XXX_DiscardUnknown() {
|
0x41, 0x75, 0x74, 0x6f, 0x4c, 0x6f, 0x6f, 0x70, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,
|
||||||
xxx_messageInfo_ForceAutoLoopResponse.DiscardUnknown(m)
|
0x42, 0x27, 0x5a, 0x25, 0x67, 0x69, 0x74, 0x68, 0x75, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x6c,
|
||||||
|
0x69, 0x67, 0x68, 0x74, 0x6e, 0x69, 0x6e, 0x67, 0x6c, 0x61, 0x62, 0x73, 0x2f, 0x6c, 0x6f, 0x6f,
|
||||||
|
0x70, 0x2f, 0x6c, 0x6f, 0x6f, 0x70, 0x72, 0x70, 0x63, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f,
|
||||||
|
0x33,
|
||||||
}
|
}
|
||||||
|
|
||||||
var xxx_messageInfo_ForceAutoLoopResponse proto.InternalMessageInfo
|
var (
|
||||||
|
file_debug_proto_rawDescOnce sync.Once
|
||||||
|
file_debug_proto_rawDescData = file_debug_proto_rawDesc
|
||||||
|
)
|
||||||
|
|
||||||
func init() {
|
func file_debug_proto_rawDescGZIP() []byte {
|
||||||
proto.RegisterType((*ForceAutoLoopRequest)(nil), "looprpc.ForceAutoLoopRequest")
|
file_debug_proto_rawDescOnce.Do(func() {
|
||||||
proto.RegisterType((*ForceAutoLoopResponse)(nil), "looprpc.ForceAutoLoopResponse")
|
file_debug_proto_rawDescData = protoimpl.X.CompressGZIP(file_debug_proto_rawDescData)
|
||||||
|
})
|
||||||
|
return file_debug_proto_rawDescData
|
||||||
}
|
}
|
||||||
|
|
||||||
func init() { proto.RegisterFile("debug.proto", fileDescriptor_8d9d361be58531fb) }
|
var file_debug_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
||||||
|
var file_debug_proto_goTypes = []interface{}{
|
||||||
|
(*ForceAutoLoopRequest)(nil), // 0: looprpc.ForceAutoLoopRequest
|
||||||
|
(*ForceAutoLoopResponse)(nil), // 1: looprpc.ForceAutoLoopResponse
|
||||||
|
}
|
||||||
|
var file_debug_proto_depIdxs = []int32{
|
||||||
|
0, // 0: looprpc.Debug.ForceAutoLoop:input_type -> looprpc.ForceAutoLoopRequest
|
||||||
|
1, // 1: looprpc.Debug.ForceAutoLoop:output_type -> looprpc.ForceAutoLoopResponse
|
||||||
|
1, // [1:2] is the sub-list for method output_type
|
||||||
|
0, // [0:1] is the sub-list for method input_type
|
||||||
|
0, // [0:0] is the sub-list for extension type_name
|
||||||
|
0, // [0:0] is the sub-list for extension extendee
|
||||||
|
0, // [0:0] is the sub-list for field type_name
|
||||||
|
}
|
||||||
|
|
||||||
var fileDescriptor_8d9d361be58531fb = []byte{
|
func init() { file_debug_proto_init() }
|
||||||
// 117 bytes of a gzipped FileDescriptorProto
|
func file_debug_proto_init() {
|
||||||
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xe2, 0xe2, 0x4e, 0x49, 0x4d, 0x2a,
|
if File_debug_proto != nil {
|
||||||
0x4d, 0xd7, 0x2b, 0x28, 0xca, 0x2f, 0xc9, 0x17, 0x62, 0xcf, 0xc9, 0xcf, 0x2f, 0x28, 0x2a, 0x48,
|
return
|
||||||
0x56, 0x12, 0xe3, 0x12, 0x71, 0xcb, 0x2f, 0x4a, 0x4e, 0x75, 0x2c, 0x2d, 0xc9, 0xf7, 0xc9, 0xcf,
|
}
|
||||||
0x2f, 0x08, 0x4a, 0x2d, 0x2c, 0x4d, 0x2d, 0x2e, 0x51, 0x12, 0xe7, 0x12, 0x45, 0x13, 0x2f, 0x2e,
|
if !protoimpl.UnsafeEnabled {
|
||||||
0xc8, 0xcf, 0x2b, 0x4e, 0x35, 0x8a, 0xe4, 0x62, 0x75, 0x01, 0x19, 0x24, 0x14, 0xc0, 0xc5, 0x8b,
|
file_debug_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
|
||||||
0xa2, 0x42, 0x48, 0x56, 0x0f, 0x6a, 0xa8, 0x1e, 0x36, 0x13, 0xa5, 0xe4, 0x70, 0x49, 0x43, 0x0c,
|
switch v := v.(*ForceAutoLoopRequest); i {
|
||||||
0x56, 0x62, 0x48, 0x62, 0x03, 0xbb, 0xcd, 0x18, 0x10, 0x00, 0x00, 0xff, 0xff, 0x39, 0x7a, 0x3c,
|
case 0:
|
||||||
0x6b, 0xaa, 0x00, 0x00, 0x00,
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
file_debug_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
|
||||||
|
switch v := v.(*ForceAutoLoopResponse); i {
|
||||||
|
case 0:
|
||||||
|
return &v.state
|
||||||
|
case 1:
|
||||||
|
return &v.sizeCache
|
||||||
|
case 2:
|
||||||
|
return &v.unknownFields
|
||||||
|
default:
|
||||||
|
return nil
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
type x struct{}
|
||||||
|
out := protoimpl.TypeBuilder{
|
||||||
|
File: protoimpl.DescBuilder{
|
||||||
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
||||||
|
RawDescriptor: file_debug_proto_rawDesc,
|
||||||
|
NumEnums: 0,
|
||||||
|
NumMessages: 2,
|
||||||
|
NumExtensions: 0,
|
||||||
|
NumServices: 1,
|
||||||
|
},
|
||||||
|
GoTypes: file_debug_proto_goTypes,
|
||||||
|
DependencyIndexes: file_debug_proto_depIdxs,
|
||||||
|
MessageInfos: file_debug_proto_msgTypes,
|
||||||
|
}.Build()
|
||||||
|
File_debug_proto = out.File
|
||||||
|
file_debug_proto_rawDesc = nil
|
||||||
|
file_debug_proto_goTypes = nil
|
||||||
|
file_debug_proto_depIdxs = nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Reference imports to suppress errors if they are not otherwise used.
|
// Reference imports to suppress errors if they are not otherwise used.
|
||||||
var _ context.Context
|
var _ context.Context
|
||||||
var _ grpc.ClientConn
|
var _ grpc.ClientConnInterface
|
||||||
|
|
||||||
// This is a compile-time assertion to ensure that this generated file
|
// This is a compile-time assertion to ensure that this generated file
|
||||||
// is compatible with the grpc package it is being compiled against.
|
// is compatible with the grpc package it is being compiled against.
|
||||||
const _ = grpc.SupportPackageIsVersion4
|
const _ = grpc.SupportPackageIsVersion6
|
||||||
|
|
||||||
// DebugClient is the client API for Debug service.
|
// DebugClient is the client API for Debug service.
|
||||||
//
|
//
|
||||||
|
|
@ -125,10 +222,10 @@ type DebugClient interface {
|
||||||
}
|
}
|
||||||
|
|
||||||
type debugClient struct {
|
type debugClient struct {
|
||||||
cc *grpc.ClientConn
|
cc grpc.ClientConnInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
func NewDebugClient(cc *grpc.ClientConn) DebugClient {
|
func NewDebugClient(cc grpc.ClientConnInterface) DebugClient {
|
||||||
return &debugClient{cc}
|
return &debugClient{cc}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -154,7 +251,7 @@ type DebugServer interface {
|
||||||
type UnimplementedDebugServer struct {
|
type UnimplementedDebugServer struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (*UnimplementedDebugServer) ForceAutoLoop(ctx context.Context, req *ForceAutoLoopRequest) (*ForceAutoLoopResponse, error) {
|
func (*UnimplementedDebugServer) ForceAutoLoop(context.Context, *ForceAutoLoopRequest) (*ForceAutoLoopResponse, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method ForceAutoLoop not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method ForceAutoLoop not implemented")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,8 @@ syntax = "proto3";
|
||||||
|
|
||||||
package looprpc;
|
package looprpc;
|
||||||
|
|
||||||
|
option go_package = "github.com/lightninglabs/loop/looprpc";
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Debug is a service that exposes endpoints intended for testing purposes. These
|
Debug is a service that exposes endpoints intended for testing purposes. These
|
||||||
endpoints should not operate on mainnet, and should only be included if loop is
|
endpoints should not operate on mainnet, and should only be included if loop is
|
||||||
|
|
@ -13,7 +15,7 @@ service Debug {
|
||||||
mainnet. This endpoint ticks our autoloop timer, triggering automated
|
mainnet. This endpoint ticks our autoloop timer, triggering automated
|
||||||
dispatch of a swap if one is suggested.
|
dispatch of a swap if one is suggested.
|
||||||
*/
|
*/
|
||||||
rpc ForceAutoLoop(ForceAutoLoopRequest) returns (ForceAutoLoopResponse){}
|
rpc ForceAutoLoop (ForceAutoLoopRequest) returns (ForceAutoLoopResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
message ForceAutoLoopRequest {
|
message ForceAutoLoopRequest {
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,36 @@
|
||||||
#!/bin/sh
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Generate the gRPC bindings for all proto files.
|
# generate compiles the *.pb.go stubs from the *.proto files.
|
||||||
for file in ./*.proto
|
function generate() {
|
||||||
do
|
# Generate the gRPC bindings for all proto files.
|
||||||
protoc -I/usr/local/include -I. \
|
for file in ./*.proto
|
||||||
--go_out=plugins=grpc,paths=source_relative:. \
|
do
|
||||||
${file}
|
protoc -I/usr/local/include -I. \
|
||||||
|
--go_out=plugins=grpc,paths=source_relative:. \
|
||||||
|
"${file}"
|
||||||
|
done
|
||||||
|
|
||||||
|
# Generate the REST reverse proxy for the client only.
|
||||||
|
protoc -I/usr/local/include -I. \
|
||||||
|
--grpc-gateway_out=logtostderr=true,paths=source_relative,grpc_api_configuration=rest-annotations.yaml:. \
|
||||||
|
"client.proto"
|
||||||
|
|
||||||
done
|
|
||||||
|
|
||||||
# Only generate the REST proxy and definitions for the client component.
|
# Finally, generate the swagger file which describes the REST API in detail.
|
||||||
protoc -I/usr/local/include -I. \
|
protoc -I/usr/local/include -I. \
|
||||||
--grpc-gateway_out=logtostderr=true,paths=source_relative,grpc_api_configuration=rest-annotations.yaml:. \
|
--swagger_out=logtostderr=true,grpc_api_configuration=rest-annotations.yaml:. \
|
||||||
client.proto
|
"client.proto"
|
||||||
|
}
|
||||||
|
|
||||||
protoc -I/usr/local/include -I. \
|
# format formats the *.proto files with the clang-format utility.
|
||||||
-I$GOPATH/src/github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis \
|
function format() {
|
||||||
--swagger_out=logtostderr=true,grpc_api_configuration=rest-annotations.yaml:. \
|
find . -name "*.proto" -print0 | xargs -0 clang-format --style=file -i
|
||||||
client.proto
|
}
|
||||||
|
|
||||||
|
# Compile and format the looprpc package.
|
||||||
|
pushd looprpc
|
||||||
|
format
|
||||||
|
generate
|
||||||
|
popd
|
||||||
|
|
|
||||||
23
looprpc/gen_protos_docker.sh
Executable file
23
looprpc/gen_protos_docker.sh
Executable file
|
|
@ -0,0 +1,23 @@
|
||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# Directory of the script file, independent of where it's called from.
|
||||||
|
DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
|
||||||
|
|
||||||
|
PROTOC_GEN_VERSION=$(go list -f '{{.Version}}' -m github.com/golang/protobuf)
|
||||||
|
GRPC_GATEWAY_VERSION=$(go list -f '{{.Version}}' -m github.com/grpc-ecosystem/grpc-gateway)
|
||||||
|
|
||||||
|
echo "Building protobuf compiler docker image..."
|
||||||
|
docker build -q -t loop-protobuf-builder \
|
||||||
|
--build-arg PROTOC_GEN_VERSION="$PROTOC_GEN_VERSION" \
|
||||||
|
--build-arg GRPC_GATEWAY_VERSION="$GRPC_GATEWAY_VERSION" \
|
||||||
|
.
|
||||||
|
|
||||||
|
echo "Compiling and formatting *.proto files..."
|
||||||
|
docker run \
|
||||||
|
--rm \
|
||||||
|
--user $UID:$UID \
|
||||||
|
-e UID=$UID \
|
||||||
|
-v "$DIR/../:/build" \
|
||||||
|
loop-protobuf-builder
|
||||||
2845
looprpc/server.pb.go
2845
looprpc/server.pb.go
File diff suppressed because it is too large
Load diff
|
|
@ -2,6 +2,8 @@ syntax = "proto3";
|
||||||
|
|
||||||
package looprpc;
|
package looprpc;
|
||||||
|
|
||||||
|
option go_package = "github.com/lightninglabs/loop/looprpc";
|
||||||
|
|
||||||
service SwapServer {
|
service SwapServer {
|
||||||
rpc LoopOutTerms (ServerLoopOutTermsRequest) returns (ServerLoopOutTerms);
|
rpc LoopOutTerms (ServerLoopOutTermsRequest) returns (ServerLoopOutTerms);
|
||||||
|
|
||||||
|
|
@ -25,7 +27,7 @@ service SwapServer {
|
||||||
rpc SubscribeLoopInUpdates (SubscribeUpdatesRequest)
|
rpc SubscribeLoopInUpdates (SubscribeUpdatesRequest)
|
||||||
returns (stream SubscribeLoopInUpdatesResponse);
|
returns (stream SubscribeLoopInUpdatesResponse);
|
||||||
|
|
||||||
rpc CancelLoopOutSwap(CancelLoopOutSwapRequest)
|
rpc CancelLoopOutSwap (CancelLoopOutSwapRequest)
|
||||||
returns (CancelLoopOutSwapResponse);
|
returns (CancelLoopOutSwapResponse);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -305,7 +307,7 @@ enum ServerSwapState {
|
||||||
SERVER_CLIENT_INVOICE_CANCEL = 14;
|
SERVER_CLIENT_INVOICE_CANCEL = 14;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SubscribeLoopOutUpdatesResponse{
|
message SubscribeLoopOutUpdatesResponse {
|
||||||
// The unix timestamp in nanoseconds when the swap was updated.
|
// The unix timestamp in nanoseconds when the swap was updated.
|
||||||
int64 timestamp_ns = 1;
|
int64 timestamp_ns = 1;
|
||||||
|
|
||||||
|
|
@ -313,7 +315,7 @@ message SubscribeLoopOutUpdatesResponse{
|
||||||
ServerSwapState state = 2;
|
ServerSwapState state = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message SubscribeLoopInUpdatesResponse{
|
message SubscribeLoopInUpdatesResponse {
|
||||||
// The unix timestamp in nanoseconds when the swap was updated.
|
// The unix timestamp in nanoseconds when the swap was updated.
|
||||||
int64 timestamp_ns = 1;
|
int64 timestamp_ns = 1;
|
||||||
|
|
||||||
|
|
@ -325,7 +327,7 @@ enum RoutePaymentType {
|
||||||
// No reason, used to distinguish from the default value.
|
// No reason, used to distinguish from the default value.
|
||||||
ROUTE_UNKNOWN = 0;
|
ROUTE_UNKNOWN = 0;
|
||||||
|
|
||||||
// Prepay route indicates that the swap was canceled because the client
|
// Prepay route indicates that the swap was canceled because the client
|
||||||
// could not find a route to the server for the prepay.
|
// could not find a route to the server for the prepay.
|
||||||
PREPAY_ROUTE = 1;
|
PREPAY_ROUTE = 1;
|
||||||
|
|
||||||
|
|
@ -378,12 +380,12 @@ message RouteCancel {
|
||||||
repeated HtlcAttempt attempts = 2;
|
repeated HtlcAttempt attempts = 2;
|
||||||
|
|
||||||
// The reason that the payment failed.
|
// The reason that the payment failed.
|
||||||
PaymentFailureReason failure = 3;
|
PaymentFailureReason failure = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message HtlcAttempt {
|
message HtlcAttempt {
|
||||||
// The number of hops from the htlc's failure hop that it needed to take
|
// The number of hops from the htlc's failure hop that it needed to take
|
||||||
// to reach the server's node.
|
// to reach the server's node.
|
||||||
uint32 remaining_hops = 1;
|
uint32 remaining_hops = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -392,7 +394,7 @@ message CancelLoopOutSwapRequest {
|
||||||
ProtocolVersion protocol_version = 1;
|
ProtocolVersion protocol_version = 1;
|
||||||
|
|
||||||
// The swap hash.
|
// The swap hash.
|
||||||
bytes swap_hash = 2;
|
bytes swap_hash = 2;
|
||||||
|
|
||||||
// The payment address for the swap invoice, used to ensure that only the
|
// The payment address for the swap invoice, used to ensure that only the
|
||||||
// swap owner can cancel the payment.
|
// swap owner can cancel the payment.
|
||||||
|
|
@ -404,4 +406,5 @@ message CancelLoopOutSwapRequest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
message CancelLoopOutSwapResponse{}
|
message CancelLoopOutSwapResponse {
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue