Skip to content

Commit 8b7782f

Browse files
authored
Merge pull request #507 from willcl-ark/fork-observer-v2
add forkobserver
2 parents f6712a6 + fee6e0d commit 8b7782f

File tree

20 files changed

+552
-10
lines changed

20 files changed

+552
-10
lines changed

.github/workflows/test.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ jobs:
6161
- dag_connection_test.py
6262
- logging_test.py
6363
- rpc_test.py
64+
- services_test.py
6465
- scenarios_test.py
6566
steps:
6667
- uses: actions/checkout@v4

docs/quickstart.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,13 @@ warnet quickstart
3535
```
3636

3737
This will check you have the required dependencies and guide you through setting up and deploying your first network.
38+
39+
## fork-observer
40+
41+
If you enabled [fork-observer](https://github.com/0xB10C/fork-observer), you must forward the port from the cluster to your local machine:
42+
43+
```bash
44+
kubectl port-forward fork-observer 2323
45+
```
46+
47+
And then the GUI can be accessed via `localhost:2323` in a web browser.

resources/charts/bitcoincore/values.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ regtestConfig: |
118118
rpcport=18443
119119
rpcallowip=0.0.0.0/0
120120
rpcbind=0.0.0.0
121+
rest=1
121122
122123
baseConfig: |
123124
checkmempool=0
@@ -134,4 +135,4 @@ baseConfig: |
134135
135136
config: ""
136137

137-
connect: []
138+
connect: []
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: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
apiVersion: v2
2+
name: fork-observer
3+
description: A Helm chart for fork-observer
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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fork-observer is watching you
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 "fork-observer.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 "fork-observer.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 "fork-observer.chart" -}}
25+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
26+
{{- end }}
27+
28+
{{/*
29+
Common labels
30+
*/}}
31+
{{- define "fork-observer.labels" -}}
32+
helm.sh/chart: {{ include "fork-observer.chart" . }}
33+
{{ include "fork-observer.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 "fork-observer.selectorLabels" -}}
44+
app.kubernetes.io/name: {{ include "fork-observer.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 "fork-observer.serviceAccountName" -}}
52+
{{- if .Values.serviceAccount.create }}
53+
{{- default (include "fork-observer.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 "fork-observer.fullname" . }}
5+
labels:
6+
{{- include "fork-observer.labels" . | nindent 4 }}
7+
data:
8+
config.toml: |
9+
{{- .Values.configQueryInterval | nindent 4 }}
10+
{{- tpl .Values.baseConfig . | nindent 4 }}
11+
{{- .Values.config | nindent 8 }}
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
name: {{ include "fork-observer.fullname" . }}
5+
labels:
6+
{{- include "fork-observer.labels" . | nindent 4 }}
7+
{{- with .Values.podLabels }}
8+
{{- toYaml . | nindent 4 }}
9+
{{- end }}
10+
app: {{ include "fork-observer.fullname" . }}
11+
spec:
12+
restartPolicy: "{{ .Values.restartPolicy }}"
13+
{{- with .Values.imagePullSecrets }}
14+
imagePullSecrets:
15+
{{- toYaml . | nindent 4 }}
16+
{{- end }}
17+
securityContext:
18+
{{- toYaml .Values.podSecurityContext | nindent 4 }}
19+
containers:
20+
- name: {{ .Chart.Name }}
21+
securityContext:
22+
{{- toYaml .Values.securityContext | nindent 8 }}
23+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
24+
imagePullPolicy: {{ .Values.image.pullPolicy }}
25+
ports:
26+
- name: web
27+
containerPort: {{ .Values.port }}
28+
protocol: TCP
29+
livenessProbe:
30+
{{- toYaml .Values.livenessProbe | nindent 8 }}
31+
readinessProbe:
32+
{{- toYaml .Values.readinessProbe | nindent 8 }}
33+
resources:
34+
{{- toYaml .Values.resources | nindent 8 }}
35+
volumeMounts:
36+
{{- with .Values.volumeMounts }}
37+
{{- toYaml . | nindent 8 }}
38+
{{- end }}
39+
- mountPath: /app/config.toml
40+
name: config
41+
subPath: config.toml
42+
volumes:
43+
{{- with .Values.volumes }}
44+
{{- toYaml . | nindent 4 }}
45+
{{- end }}
46+
- configMap:
47+
name: {{ include "fork-observer.fullname" . }}
48+
name: config
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
name: {{ include "fork-observer.fullname" . }}
5+
labels:
6+
{{- include "fork-observer.labels" . | nindent 4 }}
7+
app: {{ include "fork-observer.fullname" . }}
8+
spec:
9+
type: {{ .Values.service.type }}
10+
ports:
11+
- port: {{ .Values.port }}
12+
targetPort: web
13+
protocol: TCP
14+
name: rpc
15+
selector:
16+
{{- include "fork-observer.selectorLabels" . | nindent 4 }}

0 commit comments

Comments
 (0)