Skip to content

Commit 63f2274

Browse files
committed
lnd nodes running, connected to tank, rpc working
1 parent 6290072 commit 63f2274

File tree

16 files changed

+456
-139
lines changed

16 files changed

+456
-139
lines changed

resources/charts/bitcoincore/templates/pod.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ metadata:
99
{{- end }}
1010
chain: {{ .Values.chain }}
1111
RPCPort: "{{ index .Values .Values.chain "RPCPort" }}"
12+
ZMQTxPort: "{{ .Values.ZMQTxPort }}"
13+
ZMQBlockPort: "{{ .Values.ZMQBlockPort }}"
1214
rpcpassword: {{ .Values.rpcpassword }}
1315
app: {{ include "bitcoincore.fullname" . }}
1416
{{- if .Values.collectLogs }}

resources/charts/lnd/Chart.yaml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: lnd
3+
description: A Helm chart for LND
4+
5+
# A chart can be either an 'application' or a 'library' chart.
6+
#
7+
# Application charts are a collection of templates that can be packaged into versioned archives
8+
# to be deployed.
9+
#
10+
# Library charts provide useful utilities or functions for the chart developer. They're included as
11+
# a dependency of application charts to inject those utilities and functions into the rendering
12+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
13+
type: application
14+
15+
# This is the chart version. This version number should be incremented each time you make changes
16+
# to the chart and its templates, including the app version.
17+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18+
version: 0.1.0
19+
20+
# This is the version number of the application being deployed. This version number should be
21+
# incremented each time you make changes to the application. Versions are not expected to
22+
# follow Semantic Versioning. They should reflect the version the application is using.
23+
# It is recommended to use it with quotes.
24+
appVersion: 0.1.0
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "lnd.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified app name.
10+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
11+
If release name contains chart name it will be used as a full name.
12+
*/}}
13+
{{- define "lnd.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- printf "%s" .Release.Name | trunc 63 | trimSuffix "-" }}
18+
{{- end }}
19+
{{- end }}
20+
21+
{{/*
22+
Create chart name and version as used by the chart label.
23+
*/}}
24+
{{- define "lnd.chart" -}}
25+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
26+
{{- end }}
27+
28+
{{/*
29+
Common labels
30+
*/}}
31+
{{- define "lnd.labels" -}}
32+
helm.sh/chart: {{ include "lnd.chart" . }}
33+
{{ include "lnd.selectorLabels" . }}
34+
{{- if .Chart.AppVersion }}
35+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
36+
{{- end }}
37+
app.kubernetes.io/managed-by: {{ .Release.Service }}
38+
{{- end }}
39+
40+
{{/*
41+
Selector labels
42+
*/}}
43+
{{- define "lnd.selectorLabels" -}}
44+
app.kubernetes.io/name: {{ include "lnd.name" . }}
45+
app.kubernetes.io/instance: {{ .Release.Name }}
46+
{{- end }}
47+
48+
{{/*
49+
Create the name of the service account to use
50+
*/}}
51+
{{- define "lnd.serviceAccountName" -}}
52+
{{- if .Values.serviceAccount.create }}
53+
{{- default (include "lnd.fullname" .) .Values.serviceAccount.name }}
54+
{{- else }}
55+
{{- default "default" .Values.serviceAccount.name }}
56+
{{- end }}
57+
{{- end }}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "lnd.fullname" . }}
5+
labels:
6+
{{- include "lnd.labels" . | nindent 4 }}
7+
data:
8+
lnd.conf: |
9+
{{- .Values.baseConfig | nindent 4 }}
10+
{{- .Values.defaultConfig | nindent 4 }}
11+
{{- .Values.config | nindent 4 }}
Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: {{ include "lnd.fullname" . }}
5+
labels:
6+
{{- include "lnd.labels" . | nindent 4 }}
7+
{{- with .Values.extraLabels }}
8+
{{- toYaml . | nindent 4 }}
9+
{{- end }}
10+
{{- with .Values.podLabels }}
11+
{{- toYaml . | nindent 4 }}
12+
{{- end }}
13+
app: {{ include "lnd.fullname" . }}
14+
{{- if .Values.collectLogs }}
15+
collect_logs: "true"
16+
{{- end }}
17+
spec:
18+
{{- with .Values.imagePullSecrets }}
19+
imagePullSecrets:
20+
{{- toYaml . | nindent 4 }}
21+
{{- end }}
22+
securityContext:
23+
{{- toYaml .Values.podSecurityContext | nindent 4 }}
24+
containers:
25+
- name: {{ .Chart.Name }}
26+
securityContext:
27+
{{- toYaml .Values.securityContext | nindent 8 }}
28+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
29+
imagePullPolicy: {{ .Values.image.pullPolicy }}
30+
ports:
31+
- name: rpc
32+
containerPort: {{ .Values.RPCPort }}
33+
protocol: TCP
34+
- name: p2p
35+
containerPort: {{ .Values.P2PPort }}
36+
protocol: TCP
37+
livenessProbe:
38+
{{- toYaml .Values.livenessProbe | nindent 8 }}
39+
readinessProbe:
40+
{{- toYaml .Values.readinessProbe | nindent 8 }}
41+
resources:
42+
{{- toYaml .Values.resources | nindent 8 }}
43+
volumeMounts:
44+
{{- with .Values.volumeMounts }}
45+
{{- toYaml . | nindent 8 }}
46+
{{- end }}
47+
- mountPath: /root/.lnd/lnd.conf
48+
name: config
49+
subPath: lnd.conf
50+
{{- if .Values.circuitBreaker }}
51+
- name: circuitbreaker
52+
image: pinheadmz/circuitbreaker:278737d
53+
imagePullPolicy: IfNotPresent
54+
{{- end}}
55+
volumes:
56+
{{- with .Values.volumes }}
57+
{{- toYaml . | nindent 4 }}
58+
{{- end }}
59+
- configMap:
60+
name: {{ include "lnd.fullname" . }}
61+
name: config
62+
{{- with .Values.nodeSelector }}
63+
nodeSelector:
64+
{{- toYaml . | nindent 4 }}
65+
{{- end }}
66+
{{- with .Values.affinity }}
67+
affinity:
68+
{{- toYaml . | nindent 4 }}
69+
{{- end }}
70+
{{- with .Values.tolerations }}
71+
tolerations:
72+
{{- toYaml . | nindent 4 }}
73+
{{- end }}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "lnd.fullname" . }}
5+
labels:
6+
{{- include "lnd.labels" . | nindent 4 }}
7+
app: {{ include "lnd.fullname" . }}
8+
spec:
9+
type: {{ .Values.service.type }}
10+
ports:
11+
- port: {{ .Values.RPCPort }}
12+
targetPort: rpc
13+
protocol: TCP
14+
name: rpc
15+
- port: {{ .Values.P2PPort }}
16+
targetPort: p2p
17+
protocol: TCP
18+
name: p2p
19+
selector:
20+
{{- include "lnd.selectorLabels" . | nindent 4 }}

resources/charts/lnd/values.yaml

Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
# Default values for lnd.
2+
# This is a YAML-formatted file.
3+
# Declare variables to be passed into your templates.
4+
namespace: warnet
5+
6+
image:
7+
repository: lightninglabs/lnd
8+
pullPolicy: IfNotPresent
9+
# Overrides the image tag whose default is the chart appVersion.
10+
tag: "v0.18.3-beta"
11+
12+
imagePullSecrets: []
13+
nameOverride: ""
14+
fullnameOverride: ""
15+
16+
podLabels:
17+
app: "warnet"
18+
mission: "lightning"
19+
20+
podSecurityContext: {}
21+
# fsGroup: 2000
22+
23+
securityContext: {}
24+
# capabilities:
25+
# drop:
26+
# - ALL
27+
# readOnlyRootFilesystem: true
28+
# runAsNonRoot: true
29+
# runAsUser: 1000
30+
31+
service:
32+
type: ClusterIP
33+
34+
RPCPort: 10009
35+
P2PPort: 9735
36+
37+
ingress:
38+
enabled: false
39+
className: ""
40+
annotations: {}
41+
# kubernetes.io/ingress.class: nginx
42+
# kubernetes.io/tls-acme: "true"
43+
hosts:
44+
- host: chart-example.local
45+
paths:
46+
- path: /
47+
pathType: ImplementationSpecific
48+
tls: []
49+
# - secretName: chart-example-tls
50+
# hosts:
51+
# - chart-example.local
52+
53+
resources: {}
54+
# We usually recommend not to specify default resources and to leave this as a conscious
55+
# choice for the user. This also increases chances charts run on environments with little
56+
# resources, such as Minikube. If you do want to specify resources, uncomment the following
57+
# lines, adjust them as necessary, and remove the curly braces after 'resources:'.
58+
# limits:
59+
# cpu: 100m
60+
# memory: 128Mi
61+
# requests:
62+
# cpu: 100m
63+
# memory: 128Mi
64+
65+
66+
livenessProbe:
67+
exec:
68+
command:
69+
- pidof
70+
- lnd
71+
failureThreshold: 3
72+
initialDelaySeconds: 5
73+
periodSeconds: 5
74+
successThreshold: 1
75+
timeoutSeconds: 1
76+
readinessProbe:
77+
failureThreshold: 1
78+
periodSeconds: 1
79+
successThreshold: 1
80+
tcpSocket:
81+
port: 10009
82+
timeoutSeconds: 1
83+
84+
85+
# Additional volumes on the output Deployment definition.
86+
volumes: []
87+
# - name: foo
88+
# secret:
89+
# secretName: mysecret
90+
# optional: false
91+
92+
# Additional volumeMounts on the output Deployment definition.
93+
volumeMounts: []
94+
# - name: foo
95+
# mountPath: "/etc/foo"
96+
# readOnly: true
97+
98+
nodeSelector: {}
99+
100+
tolerations: []
101+
102+
affinity: {}
103+
104+
baseConfig: |
105+
noseedbackup=true
106+
norest=true
107+
debuglevel=debug
108+
accept-keysend=true
109+
bitcoin.active=true
110+
bitcoin.node=bitcoind
111+
maxpendingchannels=64
112+
trickledelay=1
113+
rpclisten=0.0.0.0:10009
114+
# zmq* and bitcoind.{rpcuser, rpcpass} are set in warnet code
115+
116+
config: ""
117+
118+
defaultConfig: ""
119+
120+
extraLabels: {}

src/warnet/constants.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939

4040
# Helm charts
4141
BITCOIN_CHART_LOCATION = str(CHARTS_DIR.joinpath("bitcoincore"))
42+
LND_CHART_LOCATION = str(CHARTS_DIR.joinpath("lnd"))
4243
FORK_OBSERVER_CHART = str(CHARTS_DIR.joinpath("fork-observer"))
4344
COMMANDER_CHART = str(CHARTS_DIR.joinpath("commander"))
4445
NAMESPACES_CHART_LOCATION = CHARTS_DIR.joinpath("namespaces")

0 commit comments

Comments
 (0)