-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #507 from willcl-ark/fork-observer-v2
add forkobserver
- Loading branch information
Showing
20 changed files
with
552 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
apiVersion: v2 | ||
name: fork-observer | ||
description: A Helm chart for fork-observer | ||
|
||
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fork-observer is watching you |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
{{/* | ||
Expand the name of the chart. | ||
*/}} | ||
{{- define "fork-observer.name" -}} | ||
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- 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 "fork-observer.fullname" -}} | ||
{{- if .Values.fullnameOverride }} | ||
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} | ||
{{- else }} | ||
{{- printf "%s" .Release.Name | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create chart name and version as used by the chart label. | ||
*/}} | ||
{{- define "fork-observer.chart" -}} | ||
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} | ||
{{- end }} | ||
|
||
{{/* | ||
Common labels | ||
*/}} | ||
{{- define "fork-observer.labels" -}} | ||
helm.sh/chart: {{ include "fork-observer.chart" . }} | ||
{{ include "fork-observer.selectorLabels" . }} | ||
{{- if .Chart.AppVersion }} | ||
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} | ||
{{- end }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
{{- end }} | ||
|
||
{{/* | ||
Selector labels | ||
*/}} | ||
{{- define "fork-observer.selectorLabels" -}} | ||
app.kubernetes.io/name: {{ include "fork-observer.name" . }} | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
{{- end }} | ||
|
||
{{/* | ||
Create the name of the service account to use | ||
*/}} | ||
{{- define "fork-observer.serviceAccountName" -}} | ||
{{- if .Values.serviceAccount.create }} | ||
{{- default (include "fork-observer.fullname" .) .Values.serviceAccount.name }} | ||
{{- else }} | ||
{{- default "default" .Values.serviceAccount.name }} | ||
{{- end }} | ||
{{- end }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
apiVersion: v1 | ||
kind: ConfigMap | ||
metadata: | ||
name: {{ include "fork-observer.fullname" . }} | ||
labels: | ||
{{- include "fork-observer.labels" . | nindent 4 }} | ||
data: | ||
config.toml: | | ||
{{- .Values.configQueryInterval | nindent 4 }} | ||
{{- tpl .Values.baseConfig . | nindent 4 }} | ||
{{- .Values.config | nindent 8 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
apiVersion: v1 | ||
kind: Pod | ||
metadata: | ||
name: {{ include "fork-observer.fullname" . }} | ||
labels: | ||
{{- include "fork-observer.labels" . | nindent 4 }} | ||
{{- with .Values.podLabels }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
app: {{ include "fork-observer.fullname" . }} | ||
spec: | ||
restartPolicy: "{{ .Values.restartPolicy }}" | ||
{{- with .Values.imagePullSecrets }} | ||
imagePullSecrets: | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
securityContext: | ||
{{- toYaml .Values.podSecurityContext | nindent 4 }} | ||
containers: | ||
- name: {{ .Chart.Name }} | ||
securityContext: | ||
{{- toYaml .Values.securityContext | nindent 8 }} | ||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" | ||
imagePullPolicy: {{ .Values.image.pullPolicy }} | ||
ports: | ||
- name: web | ||
containerPort: {{ .Values.port }} | ||
protocol: TCP | ||
livenessProbe: | ||
{{- toYaml .Values.livenessProbe | nindent 8 }} | ||
readinessProbe: | ||
{{- toYaml .Values.readinessProbe | nindent 8 }} | ||
resources: | ||
{{- toYaml .Values.resources | nindent 8 }} | ||
volumeMounts: | ||
{{- with .Values.volumeMounts }} | ||
{{- toYaml . | nindent 8 }} | ||
{{- end }} | ||
- mountPath: /app/config.toml | ||
name: config | ||
subPath: config.toml | ||
volumes: | ||
{{- with .Values.volumes }} | ||
{{- toYaml . | nindent 4 }} | ||
{{- end }} | ||
- configMap: | ||
name: {{ include "fork-observer.fullname" . }} | ||
name: config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: {{ include "fork-observer.fullname" . }} | ||
labels: | ||
{{- include "fork-observer.labels" . | nindent 4 }} | ||
app: {{ include "fork-observer.fullname" . }} | ||
spec: | ||
type: {{ .Values.service.type }} | ||
ports: | ||
- port: {{ .Values.port }} | ||
targetPort: web | ||
protocol: TCP | ||
name: rpc | ||
selector: | ||
{{- include "fork-observer.selectorLabels" . | nindent 4 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
# Default values for fork-observer. | ||
# This is a YAML-formatted file. | ||
# Declare variables to be passed into your templates. | ||
namespace: warnet | ||
|
||
restartPolicy: Always | ||
|
||
image: | ||
repository: b10c/fork-observer | ||
pullPolicy: IfNotPresent | ||
# Overrides the image tag whose default is the chart appVersion. | ||
tag: "latest" | ||
|
||
imagePullSecrets: [] | ||
nameOverride: "" | ||
fullnameOverride: "" | ||
|
||
podLabels: | ||
app: "warnet" | ||
mission: "observer" | ||
|
||
podSecurityContext: {} | ||
# fsGroup: 2000 | ||
|
||
securityContext: {} | ||
# capabilities: | ||
# drop: | ||
# - ALL | ||
# readOnlyRootFilesystem: true | ||
# runAsNonRoot: true | ||
# runAsUser: 1000 | ||
|
||
service: | ||
type: ClusterIP | ||
|
||
resources: {} | ||
# We usually recommend not to specify default resources and to leave this as a conscious | ||
# choice for the user. This also increases chances charts run on environments with little | ||
# resources, such as Minikube. If you do want to specify resources, uncomment the following | ||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'. | ||
# limits: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
# requests: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
|
||
livenessProbe: | ||
exec: | ||
command: | ||
- pidof | ||
- fork-observer | ||
failureThreshold: 3 | ||
initialDelaySeconds: 5 | ||
periodSeconds: 5 | ||
successThreshold: 1 | ||
timeoutSeconds: 1 | ||
readinessProbe: | ||
failureThreshold: 1 | ||
periodSeconds: 1 | ||
successThreshold: 1 | ||
tcpSocket: | ||
port: 2323 | ||
timeoutSeconds: 1 | ||
|
||
# Additional volumes on the output Deployment definition. | ||
volumes: [] | ||
# - name: foo | ||
# secret: | ||
# secretName: mysecret | ||
# optional: false | ||
|
||
# Additional volumeMounts on the output Deployment definition. | ||
volumeMounts: [] | ||
# - name: foo | ||
# mountPath: "/etc/foo" | ||
# readOnly: true | ||
|
||
port: 2323 | ||
|
||
configQueryInterval: | | ||
# Interval for checking for new blocks | ||
query_interval = 20 | ||
maxInterestingHeights: 100 | ||
|
||
baseConfig: | | ||
# Database path of the key value store. Will be created if non-existing. | ||
database_path = "db" | ||
# path to the location of the static www files | ||
www_path = "./www" | ||
# Webserver listen address | ||
address = "0.0.0.0:2323" | ||
# Custom footer for the site. | ||
footer_html = """ | ||
<div class="my-2"> | ||
<div> | ||
<span class="text-muted">Warnet fork-observer</span> | ||
</div> | ||
</div> | ||
""" | ||
[[networks]] | ||
id = 0xDEADBE | ||
name = "Warnet" | ||
description = "A Warnet" | ||
min_fork_height = 0 | ||
max_interesting_heights = {{ .Values.maxInterestingHeights }} | ||
[pool_identification] | ||
enable = false | ||
config: "" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,4 +27,6 @@ nodes: | |
- name: tank-0005 | ||
connect: | ||
- tank-0006 | ||
- name: tank-0006 | ||
- name: tank-0006 | ||
fork_observer: | ||
enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,4 +23,4 @@ image: | |
|
||
config: | | ||
dns=1 | ||
debug=rpc | ||
debug=rpc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
chain: regtest | ||
|
||
collectLogs: true | ||
metricsExport: false | ||
|
||
resources: {} | ||
# We usually recommend not to specify default resources and to leave this as a conscious | ||
# choice for the user. This also increases chances charts run on environments with little | ||
# resources, such as Minikube. If you do want to specify resources, uncomment the following | ||
# lines, adjust them as necessary, and remove the curly braces after 'resources:'. | ||
# limits: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
# requests: | ||
# cpu: 100m | ||
# memory: 128Mi | ||
|
||
image: | ||
repository: bitcoindevproject/bitcoin | ||
pullPolicy: IfNotPresent | ||
# Overrides the image tag whose default is the chart appVersion. | ||
tag: "27.0" | ||
|
||
config: | | ||
dns=1 | ||
debug=rpc | ||
rpcauth=forkobserver:1418183465eecbd407010cf60811c6a0$d4e5f0647a63429c218da1302d7f19fe627302aeb0a71a74de55346a25d8057c | ||
rpcwhitelist=forkobserver:getchaintips,getblockheader,getblockhash,getblock,getnetworkinfo | ||
rpcwhitelistdefault=0 |
Oops, something went wrong.