Skip to content

Commit

Permalink
v1.9.0 (#395)
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptosharks131 authored Sep 22, 2024
2 parents 965a0f0 + d256343 commit d4df4bb
Show file tree
Hide file tree
Showing 21 changed files with 985 additions and 2,354 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
FROM python:3
FROM python:3-alpine
ENV PYTHONUNBUFFERED 1
RUN git clone https://github.com/cryptosharks131/lndg.git /lndg
WORKDIR /lndg
RUN apk add git && git clone https://github.com/cryptosharks131/lndg /app
WORKDIR /app
RUN git checkout "master"
RUN pip install -r requirements.txt
RUN pip install supervisor whitenoise
RUN pip install whitenoise
ENTRYPOINT [ "sh" ]
12 changes: 9 additions & 3 deletions controller.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import multiprocessing
import jobs, rebalancer, htlc_stream, p2p
import multiprocessing, sys
import jobs, rebalancer, htlc_stream, p2p, manage

def run_task(task):
task()
Expand All @@ -10,7 +10,13 @@ def main():

processes = []
for task in tasks:
process = multiprocessing.Process(target=run_task, args=(task,))
process = multiprocessing.Process(target=run_task, name=task.__module__, args=(task,))
processes.append(process)
process.start()

if len(sys.argv) > 1:
sys.argv[0] = "manage.py"
process = multiprocessing.Process(target=manage.main(sys.argv), name="manage.py")
processes.append(process)
process.start()

Expand Down
5 changes: 2 additions & 3 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ services:
build: .
volumes:
- /root/.lnd:/root/.lnd:ro
- /root/lndg/data:/lndg/data:rw
- /root/lndg/data:/app/data:rw
command:
- sh
- -c
- python initialize.py -net 'mainnet' -server 'localhost:10009' -d && supervisord && python manage.py runserver 0.0.0.0:8000
- 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
ports:
- 8889:8000
2 changes: 2 additions & 0 deletions gui/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ class LocalSettingsForm(GUIForm):
(9, 'cltv'),
(10, 'min_htlc'),
(11, 'max_htlc'),
(12, 'inbound_base_fee'),
(13, 'inbound_fee_rate'),
]

class UpdateChannel(forms.Form):
Expand Down
2,774 changes: 515 additions & 2,259 deletions gui/lnd_deps/lightning_pb2.py

Large diffs are not rendered by default.

129 changes: 123 additions & 6 deletions gui/lnd_deps/lightning_pb2_grpc.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,11 @@ def __init__(self, channel):
request_serializer=lightning__pb2.GetInfoRequest.SerializeToString,
response_deserializer=lightning__pb2.GetInfoResponse.FromString,
)
self.GetDebugInfo = channel.unary_unary(
'/lnrpc.Lightning/GetDebugInfo',
request_serializer=lightning__pb2.GetDebugInfoRequest.SerializeToString,
response_deserializer=lightning__pb2.GetDebugInfoResponse.FromString,
)
self.GetRecoveryInfo = channel.unary_unary(
'/lnrpc.Lightning/GetRecoveryInfo',
request_serializer=lightning__pb2.GetRecoveryInfoRequest.SerializeToString,
Expand Down Expand Up @@ -357,6 +362,16 @@ def __init__(self, channel):
request_serializer=lightning__pb2.SubscribeCustomMessagesRequest.SerializeToString,
response_deserializer=lightning__pb2.CustomMessage.FromString,
)
self.ListAliases = channel.unary_unary(
'/lnrpc.Lightning/ListAliases',
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):
Expand Down Expand Up @@ -487,8 +502,10 @@ def SignMessage(self, request, context):

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

def GetDebugInfo(self, request, context):
"""lncli: 'getdebuginfo'
GetDebugInfo returns debug information concerning the state of the daemon
and its subsystems. This includes the full configuration and the latest log
entries from the log file.
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
context.set_details('Method not implemented!')
raise NotImplementedError('Method not implemented!')

def GetRecoveryInfo(self, request, context):
"""* lncli: `getrecoveryinfo`
GetRecoveryInfo returns information concerning the recovery mode including
Expand Down Expand Up @@ -773,7 +800,7 @@ def SubscribeInvoices(self, request, context):
optionally specify the add_index and/or the settle_index. If the add_index
is specified, then we'll first start by sending add invoice events for all
invoices with an add_index greater than the specified value. If the
settle_index is specified, the next, we'll send out all settle events for
settle_index is specified, then next, we'll send out all settle events for
invoices with a settle_index greater than the specified value. One or both
of these fields can be set. If no fields are set, then we'll only send out
the latest add/settle events.
Expand Down Expand Up @@ -801,7 +828,7 @@ def ListPayments(self, request, context):
raise NotImplementedError('Method not implemented!')

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

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

def VerifyChanBackup(self, request, context):
"""
"""lncli: `verifychanbackup`
VerifyChanBackup allows a caller to verify the integrity of a channel backup
snapshot. This method will accept either a packed Single or a packed Multi.
Specifying both will result in an error.
Expand Down Expand Up @@ -1092,6 +1119,30 @@ def SubscribeCustomMessages(self, request, context):
"""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!')
raise NotImplementedError('Method not implemented!')

def ListAliases(self, request, context):
"""lncli: `listaliases`
ListAliases returns the set of all aliases that have ever existed with
their confirmed SCID (if it exists) and/or the base SCID (in the case of
zero conf).
"""
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
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!')
Expand Down Expand Up @@ -1180,6 +1231,11 @@ def add_LightningServicer_to_server(servicer, server):
request_deserializer=lightning__pb2.GetInfoRequest.FromString,
response_serializer=lightning__pb2.GetInfoResponse.SerializeToString,
),
'GetDebugInfo': grpc.unary_unary_rpc_method_handler(
servicer.GetDebugInfo,
request_deserializer=lightning__pb2.GetDebugInfoRequest.FromString,
response_serializer=lightning__pb2.GetDebugInfoResponse.SerializeToString,
),
'GetRecoveryInfo': grpc.unary_unary_rpc_method_handler(
servicer.GetRecoveryInfo,
request_deserializer=lightning__pb2.GetRecoveryInfoRequest.FromString,
Expand Down Expand Up @@ -1425,6 +1481,16 @@ def add_LightningServicer_to_server(servicer, server):
request_deserializer=lightning__pb2.SubscribeCustomMessagesRequest.FromString,
response_serializer=lightning__pb2.CustomMessage.SerializeToString,
),
'ListAliases': grpc.unary_unary_rpc_method_handler(
servicer.ListAliases,
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)
Expand Down Expand Up @@ -1725,6 +1791,23 @@ def GetInfo(request,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def GetDebugInfo(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/GetDebugInfo',
lightning__pb2.GetDebugInfoRequest.SerializeToString,
lightning__pb2.GetDebugInfoResponse.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def GetRecoveryInfo(request,
target,
Expand Down Expand Up @@ -2557,3 +2640,37 @@ def SubscribeCustomMessages(request,
lightning__pb2.CustomMessage.FromString,
options, channel_credentials,
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)

@staticmethod
def ListAliases(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/ListAliases',
lightning__pb2.ListAliasesRequest.SerializeToString,
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)
43 changes: 43 additions & 0 deletions gui/migrations/0038_channels_local_inbound_base_fee_and_more.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Generated by Django 5.0.2 on 2024-05-08 22:27

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('gui', '0037_tradesales'),
]

operations = [
migrations.AddField(
model_name='channels',
name='local_inbound_base_fee',
field=models.IntegerField(default=0),
preserve_default=False,
),
migrations.AddField(
model_name='channels',
name='local_inbound_fee_rate',
field=models.IntegerField(default=0),
preserve_default=False,
),
migrations.AddField(
model_name='channels',
name='remote_inbound_base_fee',
field=models.IntegerField(default=0),
preserve_default=False,
),
migrations.AddField(
model_name='channels',
name='remote_inbound_fee_rate',
field=models.IntegerField(default=0),
preserve_default=False,
),
migrations.AddField(
model_name='forwards',
name='inbound_fee',
field=models.FloatField(default=0),
preserve_default=False,
),
]
5 changes: 5 additions & 0 deletions gui/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ class Forwards(models.Model):
amt_in_msat = models.BigIntegerField()
amt_out_msat = models.BigIntegerField()
fee = models.FloatField()
inbound_fee = models.FloatField()
class Meta:
app_label = 'gui'

Expand All @@ -86,12 +87,16 @@ class Channels(models.Model):
htlc_count = models.IntegerField()
local_base_fee = models.IntegerField()
local_fee_rate = models.IntegerField()
local_inbound_base_fee = models.IntegerField()
local_inbound_fee_rate = models.IntegerField()
local_disabled = models.BooleanField()
local_cltv = models.IntegerField()
local_min_htlc_msat = models.BigIntegerField()
local_max_htlc_msat = models.BigIntegerField()
remote_base_fee = models.IntegerField()
remote_fee_rate = models.IntegerField()
remote_inbound_base_fee = models.IntegerField()
remote_inbound_fee_rate = models.IntegerField()
remote_disabled = models.BooleanField()
remote_cltv = models.IntegerField()
remote_min_htlc_msat = models.BigIntegerField()
Expand Down
5 changes: 5 additions & 0 deletions gui/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ class UpdateChanPolicy(serializers.Serializer):
chan_id = serializers.CharField(max_length=20)
base_fee = serializers.IntegerField(required=False, default=None)
fee_rate = serializers.IntegerField(required=False, default=None)
inbound_base_fee = serializers.IntegerField(required=False, default=None)
inbound_fee_rate = serializers.IntegerField(required=False, default=None)
disabled = serializers.IntegerField(required=False, default=None)
cltv = serializers.IntegerField(required=False, default=None)
min_htlc = serializers.FloatField(required=False, default=None)
Expand All @@ -163,6 +165,9 @@ class UpdateChanPolicy(serializers.Serializer):
class NewAddressSerializer(serializers.Serializer):
legacy = serializers.BooleanField(required=False, default=False)

class ConsolidateSerializer(serializers.Serializer):
sat_per_vbyte = serializers.IntegerField(label='sat_per_vbtye')

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

0 comments on commit d4df4bb

Please sign in to comment.