Skip to content

Commit 862a9ff

Browse files
committed
Merge branch '2024-11-ln-helm-plugin' into 2024-11-hook-api
2 parents 28d389e + e6fd39e commit 862a9ff

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+1285
-208
lines changed

.github/workflows/test.yml

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ jobs:
4444
- dag_connection_test.py
4545
- graph_test.py
4646
- logging_test.py
47+
- ln_basic_test.py
4748
- rpc_test.py
4849
- services_test.py
4950
- signet_test.py

resources/charts/bitcoincore/Chart.yaml

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ apiVersion: v2
22
name: bitcoincore
33
description: A Helm chart for Bitcoin Core
44

5+
dependencies:
6+
- name: lnd
7+
version: 0.1.0
8+
condition: ln.lnd
9+
510
# A chart can be either an 'application' or a 'library' chart.
611
#
712
# Application charts are a collection of templates that can be packaged into versioned archives
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
apiVersion: v2
2+
name: lnd
3+
4+
description: A Helm chart for LND
5+
6+
# A chart can be either an 'application' or a 'library' chart.
7+
#
8+
# Application charts are a collection of templates that can be packaged into versioned archives
9+
# to be deployed.
10+
#
11+
# Library charts provide useful utilities or functions for the chart developer. They're included as
12+
# a dependency of application charts to inject those utilities and functions into the rendering
13+
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
14+
type: application
15+
16+
# This is the chart version. This version number should be incremented each time you make changes
17+
# to the chart and its templates, including the app version.
18+
# Versions are expected to follow Semantic Versioning (https://semver.org/)
19+
version: 0.1.0
20+
21+
# This is the version number of the application being deployed. This version number should be
22+
# incremented each time you make changes to the application. Versions are not expected to
23+
# follow Semantic Versioning. They should reflect the version the application is using.
24+
# It is recommended to use it with quotes.
25+
appVersion: 0.1.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
{{/*
2+
Expand the name of the PARENT chart.
3+
*/}}
4+
{{- define "bitcoincore.name" -}}
5+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
6+
{{- end }}
7+
8+
{{/*
9+
Create a default fully qualified PARENT 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 "bitcoincore.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+
{{/*
23+
Expand the name of the chart.
24+
*/}}
25+
{{- define "lnd.name" -}}
26+
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}-ln
27+
{{- end }}
28+
29+
{{/*
30+
Create a default fully qualified app name.
31+
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
32+
If release name contains chart name it will be used as a full name.
33+
*/}}
34+
{{- define "lnd.fullname" -}}
35+
{{- if .Values.fullnameOverride }}
36+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
37+
{{- else }}
38+
{{- printf "%s" .Release.Name | trunc 63 | trimSuffix "-" }}-ln
39+
{{- end }}
40+
{{- end }}
41+
42+
{{/*
43+
Create chart name and version as used by the chart label.
44+
*/}}
45+
{{- define "lnd.chart" -}}
46+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
47+
{{- end }}
48+
49+
{{/*
50+
Common labels
51+
*/}}
52+
{{- define "lnd.labels" -}}
53+
helm.sh/chart: {{ include "lnd.chart" . }}
54+
{{ include "lnd.selectorLabels" . }}
55+
{{- if .Chart.AppVersion }}
56+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
57+
{{- end }}
58+
app.kubernetes.io/managed-by: {{ .Release.Service }}
59+
{{- end }}
60+
61+
{{/*
62+
Selector labels
63+
*/}}
64+
{{- define "lnd.selectorLabels" -}}
65+
app.kubernetes.io/name: {{ include "lnd.name" . }}
66+
app.kubernetes.io/instance: {{ .Release.Name }}
67+
{{- end }}
68+
69+
{{/*
70+
Create the name of the service account to use
71+
*/}}
72+
{{- define "lnd.serviceAccountName" -}}
73+
{{- if .Values.serviceAccount.create }}
74+
{{- default (include "lnd.fullname" .) .Values.serviceAccount.name }}
75+
{{- else }}
76+
{{- default "default" .Values.serviceAccount.name }}
77+
{{- end }}
78+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
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 }}
12+
bitcoin.{{ .Values.global.chain }}=1
13+
bitcoind.rpcpass={{ .Values.global.rpcpassword }}
14+
bitcoind.rpchost={{ include "bitcoincore.fullname" . }}:{{ index .Values.global .Values.global.chain "RPCPort" }}
15+
bitcoind.zmqpubrawblock=tcp://{{ include "bitcoincore.fullname" . }}:{{ .Values.global.ZMQBlockPort }}
16+
bitcoind.zmqpubrawtx=tcp://{{ include "bitcoincore.fullname" . }}:{{ .Values.global.ZMQTxPort }}
17+
alias={{ include "lnd.fullname" . }}
18+
externalhosts={{ include "lnd.fullname" . }}
19+
tlsextradomain={{ include "lnd.fullname" . }}
20+
tls.cert: |
21+
-----BEGIN CERTIFICATE-----
22+
MIIB8TCCAZagAwIBAgIUJDsR6mmY+TaO9pCfjtotlbOkzJMwCgYIKoZIzj0EAwIw
23+
MjEfMB0GA1UECgwWbG5kIGF1dG9nZW5lcmF0ZWQgY2VydDEPMA0GA1UEAwwGd2Fy
24+
bmV0MB4XDTI0MTExMTE2NTM1MFoXDTM0MTEwOTE2NTM1MFowMjEfMB0GA1UECgwW
25+
bG5kIGF1dG9nZW5lcmF0ZWQgY2VydDEPMA0GA1UEAwwGd2FybmV0MFkwEwYHKoZI
26+
zj0CAQYIKoZIzj0DAQcDQgAEBVltIvaTlAQI/3FFatTqVflZuZdRJ0SmRMSJrFLP
27+
tp0fxE7hmteSt6gjQriy90fP8j9OJXBNAjt915kLY4zVvqOBiTCBhjAOBgNVHQ8B
28+
Af8EBAMCAqQwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDwYDVR0TAQH/BAUwAwEB/zAd
29+
BgNVHQ4EFgQU5d8QMrwhLgTkDjWA+eXZGz+dybUwLwYDVR0RBCgwJoIJbG9jYWxo
30+
b3N0ggEqhwR/AAABhxAAAAAAAAAAAAAAAAAAAAABMAoGCCqGSM49BAMCA0kAMEYC
31+
IQDPofN0fEl5gTwCYhk3nZbjMqJhZ8BsSJ6K8XRhxr7zbwIhAPsgQCFOqUWg632O
32+
NEO53OQ6CIqnpxSskjsFNH4ZBQOE
33+
-----END CERTIFICATE-----
34+
tls.key: |
35+
-----BEGIN EC PRIVATE KEY-----
36+
MHcCAQEEIIcFtWTLQv5JaRRxdkPKkO98OrvgeztbZ7h8Ev/4UbE4oAoGCCqGSM49
37+
AwEHoUQDQgAEBVltIvaTlAQI/3FFatTqVflZuZdRJ0SmRMSJrFLPtp0fxE7hmteS
38+
t6gjQriy90fP8j9OJXBNAjt915kLY4zVvg==
39+
-----END EC PRIVATE KEY-----
40+
41+
---
42+
apiVersion: v1
43+
kind: ConfigMap
44+
metadata:
45+
name: {{ include "lnd.fullname" . }}-channels
46+
labels:
47+
channels: "true"
48+
{{- include "lnd.labels" . | nindent 4 }}
49+
data:
50+
source: {{ include "lnd.fullname" . }}
51+
channels: |
52+
{{ .Values.channels | toJson }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: {{ include "lnd.fullname" . }}
5+
labels:
6+
{{- include "lnd.labels" . | nindent 4 }}
7+
{{- with .Values.podLabels }}
8+
{{- toYaml . | nindent 4 }}
9+
{{- end }}
10+
app: {{ include "lnd.fullname" . }}
11+
{{- if .Values.collectLogs }}
12+
collect_logs: "true"
13+
{{- end }}
14+
chain: {{ .Values.global.chain }}
15+
spec:
16+
{{- with .Values.imagePullSecrets }}
17+
imagePullSecrets:
18+
{{- toYaml . | nindent 4 }}
19+
{{- end }}
20+
securityContext:
21+
{{- toYaml .Values.podSecurityContext | nindent 4 }}
22+
containers:
23+
- name: {{ .Chart.Name }}
24+
securityContext:
25+
{{- toYaml .Values.securityContext | nindent 8 }}
26+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
27+
imagePullPolicy: {{ .Values.image.pullPolicy }}
28+
ports:
29+
- name: rpc
30+
containerPort: {{ .Values.RPCPort }}
31+
protocol: TCP
32+
- name: p2p
33+
containerPort: {{ .Values.P2PPort }}
34+
protocol: TCP
35+
- name: rest
36+
containerPort: {{ .Values.RestPort }}
37+
protocol: TCP
38+
livenessProbe:
39+
{{- toYaml .Values.livenessProbe | nindent 8 }}
40+
readinessProbe:
41+
{{- toYaml .Values.readinessProbe | nindent 8 }}
42+
startupProbe:
43+
{{- toYaml .Values.startupProbe | nindent 8 }}
44+
resources:
45+
{{- toYaml .Values.resources | nindent 8 }}
46+
volumeMounts:
47+
{{- with .Values.volumeMounts }}
48+
{{- toYaml . | nindent 8 }}
49+
{{- end }}
50+
- mountPath: /root/.lnd/lnd.conf
51+
name: config
52+
subPath: lnd.conf
53+
- mountPath: /root/.lnd/tls.key
54+
name: config
55+
subPath: tls.key
56+
- mountPath: /root/.lnd/tls.cert
57+
name: config
58+
subPath: tls.cert
59+
{{- if .Values.circuitBreaker }}
60+
- name: circuitbreaker
61+
image: pinheadmz/circuitbreaker:278737d
62+
imagePullPolicy: IfNotPresent
63+
{{- end}}
64+
volumes:
65+
{{- with .Values.volumes }}
66+
{{- toYaml . | nindent 4 }}
67+
{{- end }}
68+
- configMap:
69+
name: {{ include "lnd.fullname" . }}
70+
name: config
71+
{{- with .Values.nodeSelector }}
72+
nodeSelector:
73+
{{- toYaml . | nindent 4 }}
74+
{{- end }}
75+
{{- with .Values.affinity }}
76+
affinity:
77+
{{- toYaml . | nindent 4 }}
78+
{{- end }}
79+
{{- with .Values.tolerations }}
80+
tolerations:
81+
{{- toYaml . | nindent 4 }}
82+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
- port: {{ .Values.RestPort }}
20+
targetPort: rest
21+
protocol: TCP
22+
name: rest
23+
selector:
24+
{{- include "lnd.selectorLabels" . | nindent 4 }}

0 commit comments

Comments
 (0)