Skip to content

Commit 7088bad

Browse files
committed
add simln charts
1 parent dbeda8c commit 7088bad

File tree

12 files changed

+144
-0
lines changed

12 files changed

+144
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Patterns to ignore when building packages.
2+
# This supports shell glob matching, relative path matching, and
3+
# negation (prefixed with !). Only one pattern per line.
4+
.DS_Store
5+
# Common VCS dirs
6+
.git/
7+
.gitignore
8+
.bzr/
9+
.bzrignore
10+
.hg/
11+
.hgignore
12+
.svn/
13+
# Common backup files
14+
*.swp
15+
*.bak
16+
*.tmp
17+
*.orig
18+
*~
19+
# Various IDEs
20+
.project
21+
.idea/
22+
*.tmproj
23+
.vscode/
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
apiVersion: v2
2+
name: simln
3+
description: A Helm chart to deploy simln
4+
version: 0.1.0
5+
appVersion: "0.1.0"
Binary file not shown.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"nodes": [
3+
{
4+
"id": "tank-0000-ln",
5+
"address": "https://tank-0000-ln:10009",
6+
"macaroon": "/decoded/admin.macaroon",
7+
"cert": "/config/tls.cert"
8+
},
9+
{
10+
"id": "tank-0001-ln",
11+
"address": "https://tank-0001-ln:10009",
12+
"macaroon": "/decoded/admin.macaroon",
13+
"cert": "/config/tls.cert"
14+
}
15+
]
16+
}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Thank you for installing simln.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{{- define "mychart.name" -}}
2+
{{- .Chart.Name | trunc 63 | trimSuffix "-" -}}
3+
{{- end -}}
4+
5+
{{- define "mychart.fullname" -}}
6+
{{- printf "%s-%s" (include "mychart.name" .) .Release.Name | trunc 63 | trimSuffix "-" -}}
7+
{{- end -}}
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
apiVersion: v1
2+
kind: ConfigMap
3+
metadata:
4+
name: {{ include "mychart.fullname" . }}-data
5+
data:
6+
sim.json: |
7+
{{ .Files.Get "files/sim.json" | nindent 4 }}
8+
tls.cert: |
9+
-----BEGIN CERTIFICATE-----
10+
MIIB8TCCAZagAwIBAgIUJDsR6mmY+TaO9pCfjtotlbOkzJMwCgYIKoZIzj0EAwIw
11+
MjEfMB0GA1UECgwWbG5kIGF1dG9nZW5lcmF0ZWQgY2VydDEPMA0GA1UEAwwGd2Fy
12+
bmV0MB4XDTI0MTExMTE2NTM1MFoXDTM0MTEwOTE2NTM1MFowMjEfMB0GA1UECgwW
13+
bG5kIGF1dG9nZW5lcmF0ZWQgY2VydDEPMA0GA1UEAwwGd2FybmV0MFkwEwYHKoZI
14+
zj0CAQYIKoZIzj0DAQcDQgAEBVltIvaTlAQI/3FFatTqVflZuZdRJ0SmRMSJrFLP
15+
tp0fxE7hmteSt6gjQriy90fP8j9OJXBNAjt915kLY4zVvqOBiTCBhjAOBgNVHQ8B
16+
Af8EBAMCAqQwEwYDVR0lBAwwCgYIKwYBBQUHAwEwDwYDVR0TAQH/BAUwAwEB/zAd
17+
BgNVHQ4EFgQU5d8QMrwhLgTkDjWA+eXZGz+dybUwLwYDVR0RBCgwJoIJbG9jYWxo
18+
b3N0ggEqhwR/AAABhxAAAAAAAAAAAAAAAAAAAAABMAoGCCqGSM49BAMCA0kAMEYC
19+
IQDPofN0fEl5gTwCYhk3nZbjMqJhZ8BsSJ6K8XRhxr7zbwIhAPsgQCFOqUWg632O
20+
NEO53OQ6CIqnpxSskjsFNH4ZBQOE
21+
-----END CERTIFICATE-----
22+
tls.key: |
23+
-----BEGIN EC PRIVATE KEY-----
24+
MHcCAQEEIIcFtWTLQv5JaRRxdkPKkO98OrvgeztbZ7h8Ev/4UbE4oAoGCCqGSM49
25+
AwEHoUQDQgAEBVltIvaTlAQI/3FFatTqVflZuZdRJ0SmRMSJrFLPtp0fxE7hmteS
26+
t6gjQriy90fP8j9OJXBNAjt915kLY4zVvg==
27+
-----END EC PRIVATE KEY-----
28+
admin.macaroon.hex: |
29+
0201036c6e6402f801030a1062beabbf2a614b112128afa0c0b4fdd61201301a160a0761646472657373120472656164120577726974651a130a04696e666f120472656164120577726974651a170a08696e766f69636573120472656164120577726974651a210a086d616361726f6f6e120867656e6572617465120472656164120577726974651a160a076d657373616765120472656164120577726974651a170a086f6666636861696e120472656164120577726974651a160a076f6e636861696e120472656164120577726974651a140a057065657273120472656164120577726974651a180a067369676e6572120867656e657261746512047265616400000620b17be53e367290871681055d0de15587f6d1cd47d1248fe2662ae27f62cfbdc6
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: {{ include "mychart.fullname" . }}
5+
labels:
6+
app: {{ include "mychart.name" . }}
7+
mission: plugin
8+
spec:
9+
initContainers:
10+
- name: decode-macaroon
11+
image: busybox
12+
command: ["sh", "-c"]
13+
args:
14+
- |
15+
cat /config/admin.macaroon.hex | xxd -r -p > /decoded/admin.macaroon
16+
volumeMounts:
17+
- name: macaroon-volume
18+
mountPath: /decoded
19+
- name: config-volume
20+
mountPath: /config
21+
containers:
22+
- name: {{ .Values.name }}
23+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
24+
imagePullPolicy: {{ .Values.image.pullPolicy }}
25+
command: {{ .Values.command | toJson }}
26+
args: {{ .Values.args | toJson }}
27+
volumeMounts:
28+
- name: config-volume
29+
mountPath: /config
30+
- name: macaroon-volume
31+
mountPath: /decoded
32+
volumes:
33+
- name: config-volume
34+
configMap:
35+
name: {{ include "mychart.fullname" . }}-data
36+
- name: macaroon-volume
37+
emptyDir: {}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
name: "simln"
2+
image:
3+
repository: "mplsgrant/sim-ln"
4+
tag: "d8c165d"
5+
pullPolicy: IfNotPresent
6+
command: ["sh", "-c"]
7+
args: ["while true; do sleep 3600; done"]
8+
defaultDataDir: /app/data

resources/plugins/simln/plugin.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
enabled: true

resources/plugins/simln/simln.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from hooks_api import post_status, pre_status
2+
3+
4+
@pre_status
5+
def print_something_first():
6+
print("The simln plugin is enabled.")
7+
8+
9+
@post_status
10+
def print_something_afterwards():
11+
print("The simln plugin executes after `status` has run.")
12+
13+
14+
def run():
15+
print("Running the simln plugin")

test/ln_basic_test.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ def manual_open_channels(self):
9090
# 0 -> 1 -> 2
9191
pk1 = self.warnet("ln pubkey tank-0001-ln")
9292
pk2 = self.warnet("ln pubkey tank-0002-ln")
93+
self.log.info(f"pk1: {pk1}")
94+
self.log.info(f"pk2: {pk2}")
9395

9496
host1 = ""
9597
host2 = ""

0 commit comments

Comments
 (0)