Skip to content

Commit d4df4bb

Browse files
v1.9.0 (#395)
2 parents 965a0f0 + d256343 commit d4df4bb

21 files changed

+985
-2354
lines changed

Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
FROM python:3
1+
FROM python:3-alpine
22
ENV PYTHONUNBUFFERED 1
3-
RUN git clone https://github.com/cryptosharks131/lndg.git /lndg
4-
WORKDIR /lndg
3+
RUN apk add git && git clone https://github.com/cryptosharks131/lndg /app
4+
WORKDIR /app
5+
RUN git checkout "master"
56
RUN pip install -r requirements.txt
6-
RUN pip install supervisor whitenoise
7+
RUN pip install whitenoise
8+
ENTRYPOINT [ "sh" ]

controller.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import multiprocessing
2-
import jobs, rebalancer, htlc_stream, p2p
1+
import multiprocessing, sys
2+
import jobs, rebalancer, htlc_stream, p2p, manage
33

44
def run_task(task):
55
task()
@@ -10,7 +10,13 @@ def main():
1010

1111
processes = []
1212
for task in tasks:
13-
process = multiprocessing.Process(target=run_task, args=(task,))
13+
process = multiprocessing.Process(target=run_task, name=task.__module__, args=(task,))
14+
processes.append(process)
15+
process.start()
16+
17+
if len(sys.argv) > 1:
18+
sys.argv[0] = "manage.py"
19+
process = multiprocessing.Process(target=manage.main(sys.argv), name="manage.py")
1420
processes.append(process)
1521
process.start()
1622

docker-compose.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ services:
33
build: .
44
volumes:
55
- /root/.lnd:/root/.lnd:ro
6-
- /root/lndg/data:/lndg/data:rw
6+
- /root/lndg/data:/app/data:rw
77
command:
8-
- sh
98
- -c
10-
- python initialize.py -net 'mainnet' -server 'localhost:10009' -d && supervisord && python manage.py runserver 0.0.0.0:8000
9+
- python initialize.py -net 'mainnet' -rpc 'localhost:10009' -wn && python controller.py runserver 0.0.0.0:8000 > /var/log/lndg-controller.log 2>&1
1110
ports:
1211
- 8889:8000

gui/forms.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ class LocalSettingsForm(GUIForm):
8484
(9, 'cltv'),
8585
(10, 'min_htlc'),
8686
(11, 'max_htlc'),
87+
(12, 'inbound_base_fee'),
88+
(13, 'inbound_fee_rate'),
8789
]
8890

8991
class UpdateChannel(forms.Form):

gui/lnd_deps/lightning_pb2.py

Lines changed: 515 additions & 2259 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gui/lnd_deps/lightning_pb2_grpc.py

Lines changed: 123 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,11 @@ def __init__(self, channel):
112112
request_serializer=lightning__pb2.GetInfoRequest.SerializeToString,
113113
response_deserializer=lightning__pb2.GetInfoResponse.FromString,
114114
)
115+
self.GetDebugInfo = channel.unary_unary(
116+
'/lnrpc.Lightning/GetDebugInfo',
117+
request_serializer=lightning__pb2.GetDebugInfoRequest.SerializeToString,
118+
response_deserializer=lightning__pb2.GetDebugInfoResponse.FromString,
119+
)
115120
self.GetRecoveryInfo = channel.unary_unary(
116121
'/lnrpc.Lightning/GetRecoveryInfo',
117122
request_serializer=lightning__pb2.GetRecoveryInfoRequest.SerializeToString,
@@ -357,6 +362,16 @@ def __init__(self, channel):
357362
request_serializer=lightning__pb2.SubscribeCustomMessagesRequest.SerializeToString,
358363
response_deserializer=lightning__pb2.CustomMessage.FromString,
359364
)
365+
self.ListAliases = channel.unary_unary(
366+
'/lnrpc.Lightning/ListAliases',
367+
request_serializer=lightning__pb2.ListAliasesRequest.SerializeToString,
368+
response_deserializer=lightning__pb2.ListAliasesResponse.FromString,
369+
)
370+
self.LookupHtlcResolution = channel.unary_unary(
371+
'/lnrpc.Lightning/LookupHtlcResolution',
372+
request_serializer=lightning__pb2.LookupHtlcResolutionRequest.SerializeToString,
373+
response_deserializer=lightning__pb2.LookupHtlcResolutionResponse.FromString,
374+
)
360375

361376

362377
class LightningServicer(object):
@@ -487,8 +502,10 @@ def SignMessage(self, request, context):
487502

488503
def VerifyMessage(self, request, context):
489504
"""lncli: `verifymessage`
490-
VerifyMessage verifies a signature over a msg. The signature must be
491-
zbase32 encoded and signed by an active node in the resident node's
505+
VerifyMessage verifies a signature over a message and recovers the signer's
506+
public key. The signature is only deemed valid if the recovered public key
507+
corresponds to a node key in the public Lightning network. The signature
508+
must be zbase32 encoded and signed by an active node in the resident node's
492509
channel database. In addition to returning the validity of the signature,
493510
VerifyMessage also returns the recovered pubkey from the signature.
494511
"""
@@ -544,6 +561,16 @@ def GetInfo(self, request, context):
544561
context.set_details('Method not implemented!')
545562
raise NotImplementedError('Method not implemented!')
546563

564+
def GetDebugInfo(self, request, context):
565+
"""lncli: 'getdebuginfo'
566+
GetDebugInfo returns debug information concerning the state of the daemon
567+
and its subsystems. This includes the full configuration and the latest log
568+
entries from the log file.
569+
"""
570+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
571+
context.set_details('Method not implemented!')
572+
raise NotImplementedError('Method not implemented!')
573+
547574
def GetRecoveryInfo(self, request, context):
548575
"""* lncli: `getrecoveryinfo`
549576
GetRecoveryInfo returns information concerning the recovery mode including
@@ -773,7 +800,7 @@ def SubscribeInvoices(self, request, context):
773800
optionally specify the add_index and/or the settle_index. If the add_index
774801
is specified, then we'll first start by sending add invoice events for all
775802
invoices with an add_index greater than the specified value. If the
776-
settle_index is specified, the next, we'll send out all settle events for
803+
settle_index is specified, then next, we'll send out all settle events for
777804
invoices with a settle_index greater than the specified value. One or both
778805
of these fields can be set. If no fields are set, then we'll only send out
779806
the latest add/settle events.
@@ -801,7 +828,7 @@ def ListPayments(self, request, context):
801828
raise NotImplementedError('Method not implemented!')
802829

803830
def DeletePayment(self, request, context):
804-
"""
831+
"""lncli: `deletepayments`
805832
DeletePayment deletes an outgoing payment from DB. Note that it will not
806833
attempt to delete an In-Flight payment, since that would be unsafe.
807834
"""
@@ -810,7 +837,7 @@ def DeletePayment(self, request, context):
810837
raise NotImplementedError('Method not implemented!')
811838

812839
def DeleteAllPayments(self, request, context):
813-
"""
840+
"""lncli: `deletepayments --all`
814841
DeleteAllPayments deletes all outgoing payments from DB. Note that it will
815842
not attempt to delete In-Flight payments, since that would be unsafe.
816843
"""
@@ -981,7 +1008,7 @@ def ExportAllChannelBackups(self, request, context):
9811008
raise NotImplementedError('Method not implemented!')
9821009

9831010
def VerifyChanBackup(self, request, context):
984-
"""
1011+
"""lncli: `verifychanbackup`
9851012
VerifyChanBackup allows a caller to verify the integrity of a channel backup
9861013
snapshot. This method will accept either a packed Single or a packed Multi.
9871014
Specifying both will result in an error.
@@ -1092,6 +1119,30 @@ def SubscribeCustomMessages(self, request, context):
10921119
"""lncli: `subscribecustom`
10931120
SubscribeCustomMessages subscribes to a stream of incoming custom peer
10941121
messages.
1122+
1123+
To include messages with type outside of the custom range (>= 32768) lnd
1124+
needs to be compiled with the `dev` build tag, and the message type to
1125+
override should be specified in lnd's experimental protocol configuration.
1126+
"""
1127+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
1128+
context.set_details('Method not implemented!')
1129+
raise NotImplementedError('Method not implemented!')
1130+
1131+
def ListAliases(self, request, context):
1132+
"""lncli: `listaliases`
1133+
ListAliases returns the set of all aliases that have ever existed with
1134+
their confirmed SCID (if it exists) and/or the base SCID (in the case of
1135+
zero conf).
1136+
"""
1137+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
1138+
context.set_details('Method not implemented!')
1139+
raise NotImplementedError('Method not implemented!')
1140+
1141+
def LookupHtlcResolution(self, request, context):
1142+
"""
1143+
LookupHtlcResolution retrieves a final htlc resolution from the database.
1144+
If the htlc has no final resolution yet, a NotFound grpc status code is
1145+
returned.
10951146
"""
10961147
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
10971148
context.set_details('Method not implemented!')
@@ -1180,6 +1231,11 @@ def add_LightningServicer_to_server(servicer, server):
11801231
request_deserializer=lightning__pb2.GetInfoRequest.FromString,
11811232
response_serializer=lightning__pb2.GetInfoResponse.SerializeToString,
11821233
),
1234+
'GetDebugInfo': grpc.unary_unary_rpc_method_handler(
1235+
servicer.GetDebugInfo,
1236+
request_deserializer=lightning__pb2.GetDebugInfoRequest.FromString,
1237+
response_serializer=lightning__pb2.GetDebugInfoResponse.SerializeToString,
1238+
),
11831239
'GetRecoveryInfo': grpc.unary_unary_rpc_method_handler(
11841240
servicer.GetRecoveryInfo,
11851241
request_deserializer=lightning__pb2.GetRecoveryInfoRequest.FromString,
@@ -1425,6 +1481,16 @@ def add_LightningServicer_to_server(servicer, server):
14251481
request_deserializer=lightning__pb2.SubscribeCustomMessagesRequest.FromString,
14261482
response_serializer=lightning__pb2.CustomMessage.SerializeToString,
14271483
),
1484+
'ListAliases': grpc.unary_unary_rpc_method_handler(
1485+
servicer.ListAliases,
1486+
request_deserializer=lightning__pb2.ListAliasesRequest.FromString,
1487+
response_serializer=lightning__pb2.ListAliasesResponse.SerializeToString,
1488+
),
1489+
'LookupHtlcResolution': grpc.unary_unary_rpc_method_handler(
1490+
servicer.LookupHtlcResolution,
1491+
request_deserializer=lightning__pb2.LookupHtlcResolutionRequest.FromString,
1492+
response_serializer=lightning__pb2.LookupHtlcResolutionResponse.SerializeToString,
1493+
),
14281494
}
14291495
generic_handler = grpc.method_handlers_generic_handler(
14301496
'lnrpc.Lightning', rpc_method_handlers)
@@ -1725,6 +1791,23 @@ def GetInfo(request,
17251791
options, channel_credentials,
17261792
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
17271793

1794+
@staticmethod
1795+
def GetDebugInfo(request,
1796+
target,
1797+
options=(),
1798+
channel_credentials=None,
1799+
call_credentials=None,
1800+
insecure=False,
1801+
compression=None,
1802+
wait_for_ready=None,
1803+
timeout=None,
1804+
metadata=None):
1805+
return grpc.experimental.unary_unary(request, target, '/lnrpc.Lightning/GetDebugInfo',
1806+
lightning__pb2.GetDebugInfoRequest.SerializeToString,
1807+
lightning__pb2.GetDebugInfoResponse.FromString,
1808+
options, channel_credentials,
1809+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
1810+
17281811
@staticmethod
17291812
def GetRecoveryInfo(request,
17301813
target,
@@ -2557,3 +2640,37 @@ def SubscribeCustomMessages(request,
25572640
lightning__pb2.CustomMessage.FromString,
25582641
options, channel_credentials,
25592642
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
2643+
2644+
@staticmethod
2645+
def ListAliases(request,
2646+
target,
2647+
options=(),
2648+
channel_credentials=None,
2649+
call_credentials=None,
2650+
insecure=False,
2651+
compression=None,
2652+
wait_for_ready=None,
2653+
timeout=None,
2654+
metadata=None):
2655+
return grpc.experimental.unary_unary(request, target, '/lnrpc.Lightning/ListAliases',
2656+
lightning__pb2.ListAliasesRequest.SerializeToString,
2657+
lightning__pb2.ListAliasesResponse.FromString,
2658+
options, channel_credentials,
2659+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
2660+
2661+
@staticmethod
2662+
def LookupHtlcResolution(request,
2663+
target,
2664+
options=(),
2665+
channel_credentials=None,
2666+
call_credentials=None,
2667+
insecure=False,
2668+
compression=None,
2669+
wait_for_ready=None,
2670+
timeout=None,
2671+
metadata=None):
2672+
return grpc.experimental.unary_unary(request, target, '/lnrpc.Lightning/LookupHtlcResolution',
2673+
lightning__pb2.LookupHtlcResolutionRequest.SerializeToString,
2674+
lightning__pb2.LookupHtlcResolutionResponse.FromString,
2675+
options, channel_credentials,
2676+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Generated by Django 5.0.2 on 2024-05-08 22:27
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('gui', '0037_tradesales'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='channels',
15+
name='local_inbound_base_fee',
16+
field=models.IntegerField(default=0),
17+
preserve_default=False,
18+
),
19+
migrations.AddField(
20+
model_name='channels',
21+
name='local_inbound_fee_rate',
22+
field=models.IntegerField(default=0),
23+
preserve_default=False,
24+
),
25+
migrations.AddField(
26+
model_name='channels',
27+
name='remote_inbound_base_fee',
28+
field=models.IntegerField(default=0),
29+
preserve_default=False,
30+
),
31+
migrations.AddField(
32+
model_name='channels',
33+
name='remote_inbound_fee_rate',
34+
field=models.IntegerField(default=0),
35+
preserve_default=False,
36+
),
37+
migrations.AddField(
38+
model_name='forwards',
39+
name='inbound_fee',
40+
field=models.FloatField(default=0),
41+
preserve_default=False,
42+
),
43+
]

gui/models.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ class Forwards(models.Model):
6060
amt_in_msat = models.BigIntegerField()
6161
amt_out_msat = models.BigIntegerField()
6262
fee = models.FloatField()
63+
inbound_fee = models.FloatField()
6364
class Meta:
6465
app_label = 'gui'
6566

@@ -86,12 +87,16 @@ class Channels(models.Model):
8687
htlc_count = models.IntegerField()
8788
local_base_fee = models.IntegerField()
8889
local_fee_rate = models.IntegerField()
90+
local_inbound_base_fee = models.IntegerField()
91+
local_inbound_fee_rate = models.IntegerField()
8992
local_disabled = models.BooleanField()
9093
local_cltv = models.IntegerField()
9194
local_min_htlc_msat = models.BigIntegerField()
9295
local_max_htlc_msat = models.BigIntegerField()
9396
remote_base_fee = models.IntegerField()
9497
remote_fee_rate = models.IntegerField()
98+
remote_inbound_base_fee = models.IntegerField()
99+
remote_inbound_fee_rate = models.IntegerField()
95100
remote_disabled = models.BooleanField()
96101
remote_cltv = models.IntegerField()
97102
remote_min_htlc_msat = models.BigIntegerField()

gui/serializers.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ class UpdateChanPolicy(serializers.Serializer):
155155
chan_id = serializers.CharField(max_length=20)
156156
base_fee = serializers.IntegerField(required=False, default=None)
157157
fee_rate = serializers.IntegerField(required=False, default=None)
158+
inbound_base_fee = serializers.IntegerField(required=False, default=None)
159+
inbound_fee_rate = serializers.IntegerField(required=False, default=None)
158160
disabled = serializers.IntegerField(required=False, default=None)
159161
cltv = serializers.IntegerField(required=False, default=None)
160162
min_htlc = serializers.FloatField(required=False, default=None)
@@ -163,6 +165,9 @@ class UpdateChanPolicy(serializers.Serializer):
163165
class NewAddressSerializer(serializers.Serializer):
164166
legacy = serializers.BooleanField(required=False, default=False)
165167

168+
class ConsolidateSerializer(serializers.Serializer):
169+
sat_per_vbyte = serializers.IntegerField(label='sat_per_vbtye')
170+
166171
class PeerSerializer(serializers.HyperlinkedModelSerializer):
167172
pubkey = serializers.ReadOnlyField()
168173
class Meta:

gui/static/w3style.css

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* W3.CSS 4.15 December 2020 by Jan Egil and Borge Refsnes */
22
html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit}
33
/* Extract from normalize.css by Nicolas Gallagher and Jonathan Neal git.io/normalize */
4-
html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}
4+
html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0; transition: color .5s ease-in, background-color .5s ease-out;}
55
article,aside,details,figcaption,figure,footer,header,main,menu,nav,section{display:block}summary{display:list-item}
66
audio,canvas,progress,video{display:inline-block}progress{vertical-align:baseline}
77
audio:not([controls]){display:none;height:0}[hidden],template{display:none}
@@ -269,4 +269,4 @@ input:focus + .slider {box-shadow:0 0 1px #2196F3}
269269
input:checked + .slider:before {-webkit-transform:translateX(19.5px);-ms-transform:translateX(19.5px);transform:translateX(19.5px)}
270270
.slider.round {border-radius:25.5px}
271271
.slider.round:before {border-radius:50%}
272-
pre {background-color: #f0f0f5;} .dark-mode pre{ background-color: #30363d; color:white }
272+
pre {background-color: #f0f0f5;} .dark-mode pre{ background-color: #30363d; color:white }

0 commit comments

Comments
 (0)