Skip to content

Add eclair support #2 #724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 11 additions & 14 deletions docs/circuit-breaker.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ nodes:
- name: tank-0003
addnode:
- tank-0000
ln:
lnd: true
lnd:
enabled: true
config: |
bitcoin.timelockdelta=33
channels:
Expand Down Expand Up @@ -51,27 +50,26 @@ nodes:
- name: tank-0000
addnode:
- tank-0001
ln:
lnd: true
lnd:
enabled: true

- name: tank-0001
addnode:
- tank-0002
ln:
lnd: true
lnd:
enabled: true

- name: tank-0002
addnode:
- tank-0000
ln:
lnd: true
lnd:
enabled: true

- name: tank-0003
addnode:
- tank-0000
ln:
lnd: true
lnd:
enabled: true
config: |
bitcoin.timelockdelta=33
channels:
Expand All @@ -88,9 +86,8 @@ nodes:
- name: tank-0004
addnode:
- tank-0000
ln:
lnd: true
lnd:
enabled: true
channels:
- id:
block: 300
Expand All @@ -102,8 +99,8 @@ nodes:
- name: tank-0005
addnode:
- tank-0000
ln:
lnd: true
lnd:
enabled: true
```

## Accessing Circuit Breaker
Expand Down
7 changes: 5 additions & 2 deletions resources/charts/bitcoincore/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@ description: A Helm chart for Bitcoin Core
dependencies:
- name: lnd
version: 0.1.0
condition: ln.lnd
condition: lnd.enabled
- name: cln
version: 0.1.0
condition: ln.cln
condition: cln.enabled
- name: eclair
version: 0.1.0
condition: eclair.enabled

# A chart can be either an 'application' or a 'library' chart.
#
Expand Down
23 changes: 23 additions & 0 deletions resources/charts/bitcoincore/charts/eclair/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions resources/charts/bitcoincore/charts/eclair/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: eclair
description: A Helm chart for Eclair

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.1.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.1.0"
78 changes: 78 additions & 0 deletions resources/charts/bitcoincore/charts/eclair/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{{/*
Expand the name of the PARENT chart.
*/}}
{{- define "bitcoincore.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified PARENT app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "bitcoincore.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s" .Release.Name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}


{{/*
Expand the name of the chart.
*/}}
{{- define "eclair.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}-ln
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "eclair.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s" .Release.Name | trunc 63 | trimSuffix "-" }}-ln
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "eclair.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "eclair.labels" -}}
helm.sh/chart: {{ include "eclair.chart" . }}
{{ include "eclair.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "eclair.selectorLabels" -}}
app.kubernetes.io/name: {{ include "eclair.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Create the name of the service account to use
*/}}
{{- define "eclair.serviceAccountName" -}}
{{- if .Values.serviceAccount.create }}
{{- default (include "eclair.fullname" .) .Values.serviceAccount.name }}
{{- else }}
{{- default "default" .Values.serviceAccount.name }}
{{- end }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "eclair.fullname" . }}
labels:
{{- include "eclair.labels" . | nindent 4 }}
data:
eclair.conf: |
{{- .Values.baseConfig | nindent 4 }}
{{- .Values.defaultConfig | nindent 4 }}
{{- .Values.config | nindent 4 }}
eclair.chain = {{ .Values.global.chain }}
eclair.bitcoind.host = {{ include "bitcoincore.fullname" . }}
eclair.bitcoind.rpcport = {{ index .Values.global .Values.global.chain "RPCPort" }}
eclair.bitcoind.rpcuser = user
eclair.bitcoind.rpcpassword = {{ .Values.global.rpcpassword }}
eclair.node-alias = {{ include "eclair.fullname" . }}
eclair.bitcoind.zmqblock = "tcp://{{ include "bitcoincore.fullname" . }}:{{ .Values.global.ZMQBlockPort }}"
eclair.bitcoind.zmqtx = "tcp://{{ include "bitcoincore.fullname" . }}:{{ .Values.global.ZMQTxPort }}"
eclair.bitcoind.startup-locked-utxos-behavior = "unlock"
---
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "eclair.fullname" . }}-channels
labels:
channels: "true"
{{- include "eclair.labels" . | nindent 4 }}
data:
source: {{ include "eclair.fullname" . }}
channels: |
{{ .Values.channels | toJson }}
82 changes: 82 additions & 0 deletions resources/charts/bitcoincore/charts/eclair/templates/pod.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
apiVersion: v1
kind: Pod
metadata:
name: {{ include "eclair.fullname" . }}
labels:
{{- include "eclair.labels" . | nindent 4 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 4 }}
{{- end }}
app: {{ include "eclair.fullname" . }}
{{- if .Values.collectLogs }}
collect_logs: "true"
{{- end }}
chain: {{ .Values.global.chain }}
annotations:
kubectl.kubernetes.io/default-container: "eclair"
spec:
{{- with .Values.imagePullSecrets }}
restartPolicy: "{{ .Values.restartPolicy }}"
imagePullSecrets:
{{- toYaml . | nindent 4 }}
{{- end }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 4 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
command:
- "sh"
- "-c"
args:
- >
/app/eclair-node/bin/eclair-node.sh -v &
while [ ! -f /root/.eclair/eclair.log ]; do
echo "Waiting for log file"
sleep 2
done &&
tail -f /root/.eclair/eclair.log
ports:
- name: server
containerPort: {{ .Values.ServerPort }}
protocol: TCP
- name: rest
containerPort: {{ .Values.RestPort }}
protocol: TCP
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 8 }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 8 }}
startupProbe:
{{- toYaml .Values.startupProbe | nindent 8 }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.extraContainers }}
{{- toYaml . | nindent 6 }}
{{- end }}
volumes:
{{- with .Values.volumes }}
{{- toYaml . | nindent 4 }}
{{- end }}
- configMap:
name: {{ include "eclair.fullname" . }}
name: config
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}
20 changes: 20 additions & 0 deletions resources/charts/bitcoincore/charts/eclair/templates/service.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
apiVersion: v1
kind: Service
metadata:
name: {{ include "eclair.fullname" . }}
labels:
{{- include "eclair.labels" . | nindent 4 }}
app: {{ include "eclair.fullname" . }}
spec:
type: {{ .Values.service.type }}
ports:
- port: {{ .Values.ServerPort }}
targetPort: server
protocol: TCP
name: server
- port: {{ .Values.RestPort }}
targetPort: rest
protocol: TCP
name: rest
selector:
{{- include "eclair.selectorLabels" . | nindent 4 }}
Loading
Loading