Skip to content

Commit ab5849f

Browse files
authored
feat(blobscan-indexer): Add blobscan-indexer (ethpandaops#147)
* feat(blobscan-indexer): Add blobscan indexer * feat(blobscan-indexer): Add blobscan indexer * fix: rm httpPort * fix: rm httpPort * fix: rm httpPort * rm probes
1 parent 5ab83b2 commit ab5849f

14 files changed

+603
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ Tooling
5858

5959
- [`beaconchain-explorer`](charts/beaconchain-explorer) - Beacon chain block explorer.
6060
- [`blobscan`](charts/blobscan) - Blobscan is the first blockchain explorer that helps to navigate and visualize those EIP-4844 blobs.
61+
- [`blobscan-indexer`](charts/blobscan-indexer) - Blobscan-Indexer indexes blobs in MongoDB for use with Blobscan.
6162
- [`blockscout`](charts/blockscout) - Execution layer block explorer.
6263
- [`consensus-monitor`](charts/consensus-monitor) - Web UI to check your ethereum consensus layer nodes via their beacon APIs.
6364
- [`dshackle`](charts/dshackle) - Fault tolerant load balancer for blockchain apis, including Ethereum RPC.

charts/blobscan-indexer/.helmignore

+23
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/

charts/blobscan-indexer/Chart.yaml

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
apiVersion: v2
2+
name: blobscan-indexer
3+
description: Blobscan-indexer indexes blobs in MongoDB for use with Blobscan.
4+
home: https://github.com/blobscan/blobscan-indexer
5+
type: application
6+
version: 0.1.0
7+
maintainers:
8+
- name: samcm
9+

charts/blobscan-indexer/README.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
2+
# blobscan-indexer
3+
4+
![Version: 0.1.0](https://img.shields.io/badge/Version-0.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
5+
6+
Blobscan-indexer indexes blobs in MongoDB for use with Blobscan.
7+
8+
**Homepage:** <https://github.com/blobscan/blobscan-indexer>
9+
10+
## Values
11+
12+
| Key | Type | Default | Description |
13+
|-----|------|---------|-------------|
14+
| affinity | object | `{}` | Affinity configuration for pods |
15+
| annotations | object | `{}` | Annotations for the Deployment |
16+
| args | list | `[]` | Command arguments |
17+
| containerSecurityContext | object | See `values.yaml` | The security context for containers |
18+
| customArgs | list | `[]` | Custom args for the blobscan-indexer container |
19+
| customCommand | list | `[]` | Command replacement for the blobscan-indexer container |
20+
| extraContainers | list | `[]` | Additional containers |
21+
| extraEnv | list | `[{"name":"MONGODB_URI","value":"mongodb://mongodb:27017"},{"name":"MONGODB_DB","value":"blobscan"},{"name":"EXECUTION_NODE_RPC","value":"http://your-execution-node:8545"},{"name":"BEACON_NODE_RPC","value":"http://your-beacon-node:5052"}]` | Additional env variables |
22+
| extraPodPorts | list | `[]` | Extra Pod ports |
23+
| extraPorts | list | `[]` | Additional ports. Useful when using extraContainers |
24+
| extraVolumeMounts | list | `[]` | Additional volume mounts |
25+
| extraVolumes | list | `[]` | Additional volumes |
26+
| fullnameOverride | string | `""` | Overrides the chart's computed fullname |
27+
| image.pullPolicy | string | `"IfNotPresent"` | blobscan-indexer container pull policy |
28+
| image.repository | string | `"ethpandaops/blobscan-indexer"` | blobscan-indexer container image repository |
29+
| image.tag | string | `"latest"` | blobscan-indexer container image tag |
30+
| imagePullSecrets | list | `[]` | Image pull secrets for Docker images |
31+
| ingress.annotations | object | `{}` | Annotations for Ingress |
32+
| ingress.enabled | bool | `false` | Ingress resource for the HTTP API |
33+
| ingress.hosts[0].host | string | `"chart-example.local"` | |
34+
| ingress.hosts[0].paths | list | `[]` | |
35+
| ingress.tls | list | `[]` | Ingress TLS |
36+
| initContainers | list | `[]` | Additional init containers |
37+
| nameOverride | string | `""` | Overrides the chart's name |
38+
| nodeSelector | object | `{}` | Node selector for pods |
39+
| podAnnotations | object | `{}` | Pod annotations |
40+
| podDisruptionBudget | object | `{}` | Define the PodDisruptionBudget spec If not set then a PodDisruptionBudget will not be created |
41+
| podLabels | object | `{}` | Pod labels |
42+
| priorityClassName | string | `nil` | Pod priority class |
43+
| replicas | int | `1` | Number of replicas |
44+
| resources | object | `{}` | Resource requests and limits |
45+
| secretEnv | object | `{}` | Secret env variables injected via a created secret |
46+
| securityContext | object | See `values.yaml` | The security context for pods |
47+
| service.type | string | `"ClusterIP"` | Service type |
48+
| serviceAccount.annotations | object | `{}` | Annotations to add to the service account |
49+
| serviceAccount.create | bool | `false` | Specifies whether a service account should be created |
50+
| serviceAccount.name | string | `""` | The name of the service account to use. If not set and create is true, a name is generated using the fullname template |
51+
| serviceMonitor.annotations | object | `{}` | Additional ServiceMonitor annotations |
52+
| serviceMonitor.enabled | bool | `false` | If true, a ServiceMonitor CRD is created for a prometheus operator https://github.com/coreos/prometheus-operator |
53+
| serviceMonitor.interval | string | `"15s"` | ServiceMonitor scrape interval |
54+
| serviceMonitor.labels | object | `{}` | Additional ServiceMonitor labels |
55+
| serviceMonitor.namespace | string | `nil` | Alternative namespace for ServiceMonitor |
56+
| serviceMonitor.path | string | `"/metrics"` | Path to scrape |
57+
| serviceMonitor.relabelings | list | `[]` | ServiceMonitor relabelings |
58+
| serviceMonitor.scheme | string | `"http"` | ServiceMonitor scheme |
59+
| serviceMonitor.scrapeTimeout | string | `"30s"` | ServiceMonitor scrape timeout |
60+
| serviceMonitor.tlsConfig | object | `{}` | ServiceMonitor TLS configuration |
61+
| terminationGracePeriodSeconds | int | `30` | How long to wait until the pod is forcefully terminated |
62+
| tolerations | list | `[]` | Tolerations for pods |
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
{{ template "chart.header" . }}
3+
{{ template "chart.deprecationWarning" . }}
4+
5+
{{ template "chart.versionBadge" . }}{{ template "chart.typeBadge" . }}
6+
7+
{{ template "chart.description" . }}
8+
9+
{{ template "chart.homepageLine" . }}
10+
11+
{{ template "chart.sourcesSection" . }}
12+
13+
{{ template "chart.requirementsSection" . }}
14+
15+
{{ template "chart.valuesSection" . }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
1. Get the application URL by running these commands:
2+
{{- if .Values.ingress.enabled }}
3+
{{- range $host := .Values.ingress.hosts }}
4+
{{- range .paths }}
5+
http{{ if $.Values.ingress.tls }}s{{ end }}://{{ $host.host }}{{ .path }}
6+
{{- end }}
7+
{{- end }}
8+
{{- else if contains "NodePort" .Values.service.type }}
9+
export NODE_PORT=$(kubectl get --namespace {{ .Release.Namespace }} -o jsonpath="{.spec.ports[0].nodePort}" services {{ include "blobscan-indexer.fullname" . }})
10+
export NODE_IP=$(kubectl get nodes --namespace {{ .Release.Namespace }} -o jsonpath="{.items[0].status.addresses[0].address}")
11+
echo http://$NODE_IP:$NODE_PORT
12+
{{- else if contains "LoadBalancer" .Values.service.type }}
13+
NOTE: It may take a few minutes for the LoadBalancer IP to be available.
14+
You can watch the status of by running 'kubectl get --namespace {{ .Release.Namespace }} svc -w {{ include "blobscan-indexer.fullname" . }}'
15+
export SERVICE_IP=$(kubectl get svc --namespace {{ .Release.Namespace }} {{ include "blobscan-indexer.fullname" . }} --template "{{"{{ range (index .status.loadBalancer.ingress 0) }}{{.}}{{ end }}"}}")
16+
echo http://$SERVICE_IP:{{ include "blobscan-indexer.httpPort" . }}
17+
{{- else if contains "ClusterIP" .Values.service.type }}
18+
export POD_NAME=$(kubectl get pods --namespace {{ .Release.Namespace }} -l "app.kubernetes.io/name={{ include "blobscan-indexer.name" . }},app.kubernetes.io/instance={{ .Release.Name }}" -o jsonpath="{.items[0].metadata.name}")
19+
export CONTAINER_PORT=$(kubectl get pod --namespace {{ .Release.Namespace }} $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
20+
echo "Visit http://127.0.0.1:8080 to use your application"
21+
kubectl --namespace {{ .Release.Namespace }} port-forward $POD_NAME 8080:$CONTAINER_PORT
22+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{{/*
2+
Expand the name of the chart.
3+
*/}}
4+
{{- define "blobscan-indexer.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 "blobscan-indexer.fullname" -}}
14+
{{- if .Values.fullnameOverride }}
15+
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
16+
{{- else }}
17+
{{- $name := default .Chart.Name .Values.nameOverride }}
18+
{{- if contains $name .Release.Name }}
19+
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
20+
{{- else }}
21+
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
22+
{{- end }}
23+
{{- end }}
24+
{{- end }}
25+
26+
{{/*
27+
Create chart name and version as used by the chart label.
28+
*/}}
29+
{{- define "blobscan-indexer.chart" -}}
30+
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
31+
{{- end }}
32+
33+
{{/*
34+
Common labels
35+
*/}}
36+
{{- define "blobscan-indexer.labels" -}}
37+
helm.sh/chart: {{ include "blobscan-indexer.chart" . }}
38+
{{ include "blobscan-indexer.selectorLabels" . }}
39+
{{- if .Chart.AppVersion }}
40+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
41+
{{- end }}
42+
app.kubernetes.io/managed-by: {{ .Release.Service }}
43+
{{- end }}
44+
45+
{{/*
46+
Selector labels
47+
*/}}
48+
{{- define "blobscan-indexer.selectorLabels" -}}
49+
app.kubernetes.io/name: {{ include "blobscan-indexer.name" . }}
50+
app.kubernetes.io/instance: {{ .Release.Name }}
51+
{{- end }}
52+
53+
{{/*
54+
Create the name of the service account to use
55+
*/}}
56+
{{- define "blobscan-indexer.serviceAccountName" -}}
57+
{{- if .Values.serviceAccount.create }}
58+
{{- default (include "blobscan-indexer.fullname" .) .Values.serviceAccount.name }}
59+
{{- else }}
60+
{{- default "default" .Values.serviceAccount.name }}
61+
{{- end }}
62+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
apiVersion: apps/v1
2+
kind: Deployment
3+
metadata:
4+
name: {{ include "blobscan-indexer.fullname" . }}
5+
labels:
6+
{{- include "blobscan-indexer.labels" . | nindent 4 }}
7+
annotations:
8+
{{- toYaml .Values.annotations | nindent 4 }}
9+
spec:
10+
replicas: {{ .Values.replicas }}
11+
selector:
12+
matchLabels:
13+
{{- include "blobscan-indexer.selectorLabels" . | nindent 6 }}
14+
template:
15+
metadata:
16+
labels:
17+
{{- include "blobscan-indexer.selectorLabels" . | nindent 8 }}
18+
{{- with .Values.podLabels }}
19+
{{- toYaml . | nindent 8 }}
20+
{{- end }}
21+
annotations:
22+
checksum/secrets: {{ include (print $.Template.BasePath "/secret.yaml") . | sha256sum }}
23+
{{- with .Values.podAnnotations }}
24+
{{- toYaml . | nindent 8 }}
25+
{{- end }}
26+
spec:
27+
serviceAccountName: {{ include "blobscan-indexer.serviceAccountName" . }}
28+
{{- if .Values.priorityClassName }}
29+
priorityClassName: {{ .Values.priorityClassName }}
30+
{{- end }}
31+
securityContext:
32+
{{- toYaml .Values.securityContext | nindent 8 }}
33+
initContainers:
34+
{{- if .Values.initContainers }}
35+
{{- toYaml .Values.initContainers | nindent 8 }}
36+
{{- end }}
37+
{{- with .Values.imagePullSecrets }}
38+
imagePullSecrets:
39+
{{- toYaml . | nindent 8 }}
40+
{{- end }}
41+
containers:
42+
- name: {{ .Chart.Name }}
43+
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
44+
imagePullPolicy: {{ .Values.image.pullPolicy }}
45+
command:
46+
{{- if gt (len .Values.customCommand) 0 }}
47+
{{- toYaml .Values.customCommand | nindent 12}}
48+
{{- else }}
49+
{{- if gt (len .Values.args) 0 }}
50+
{{- toYaml .Values.args | nindent 12}}
51+
{{- end }}
52+
{{- end }}
53+
{{- if gt (len .Values.customArgs) 0 }}
54+
args:
55+
{{- toYaml .Values.customArgs | nindent 12}}
56+
{{- end }}
57+
securityContext:
58+
{{- toYaml .Values.containerSecurityContext | nindent 12 }}
59+
volumeMounts:
60+
{{- if .Values.extraVolumeMounts }}
61+
{{ toYaml .Values.extraVolumeMounts | nindent 12 }}
62+
{{- end }}
63+
ports:
64+
{{- if .Values.extraPodPorts }}
65+
{{ toYaml .Values.extraPodPorts | nindent 10 }}
66+
{{- end }}
67+
resources:
68+
{{- toYaml .Values.resources | nindent 12 }}
69+
env:
70+
{{- range $key, $value := .Values.secretEnv }}
71+
- name: {{ $key }}
72+
valueFrom:
73+
secretKeyRef:
74+
name: {{ include "blobscan-indexer.fullname" $ }}-env
75+
key: {{ $key }}
76+
{{- end }}
77+
{{- if .Values.extraEnv }}
78+
{{- toYaml .Values.extraEnv | nindent 12 }}
79+
{{- end }}
80+
{{- if .Values.extraContainers }}
81+
{{ toYaml .Values.extraContainers | nindent 8}}
82+
{{- end }}
83+
nodeSelector:
84+
{{- toYaml .Values.nodeSelector | nindent 8 }}
85+
affinity:
86+
{{- toYaml .Values.affinity | nindent 8 }}
87+
tolerations:
88+
{{- toYaml .Values.tolerations | nindent 8 }}
89+
terminationGracePeriodSeconds: {{ .Values.terminationGracePeriodSeconds }}
90+
volumes:
91+
{{- if .Values.extraVolumes }}
92+
{{ toYaml .Values.extraVolumes | nindent 8}}
93+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
{{- if .Values.ingress.enabled -}}
2+
{{- $fullName := include "blobscan-indexer.fullname" . -}}
3+
{{- $svcPort := include "blobscan-indexer.httpPort" . -}}
4+
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
5+
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
6+
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
7+
{{- end }}
8+
{{- end }}
9+
{{- if semverCompare ">=1.19-0" .Capabilities.KubeVersion.GitVersion -}}
10+
apiVersion: networking.k8s.io/v1
11+
{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}}
12+
apiVersion: networking.k8s.io/v1beta1
13+
{{- else -}}
14+
apiVersion: extensions/v1beta1
15+
{{- end }}
16+
kind: Ingress
17+
metadata:
18+
name: {{ $fullName }}
19+
labels:
20+
{{- include "blobscan-indexer.labels" . | nindent 4 }}
21+
{{- with .Values.ingress.annotations }}
22+
annotations:
23+
{{- toYaml . | nindent 4 }}
24+
{{- end }}
25+
spec:
26+
{{- if and .Values.ingress.className (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion) }}
27+
ingressClassName: {{ .Values.ingress.className }}
28+
{{- end }}
29+
{{- if .Values.ingress.tls }}
30+
tls:
31+
{{- range .Values.ingress.tls }}
32+
- hosts:
33+
{{- range .hosts }}
34+
- {{ . | quote }}
35+
{{- end }}
36+
secretName: {{ .secretName }}
37+
{{- end }}
38+
{{- end }}
39+
rules:
40+
{{- range .Values.ingress.hosts }}
41+
- host: {{ .host | quote }}
42+
http:
43+
paths:
44+
{{- range .paths }}
45+
- path: {{ .path }}
46+
{{- if and .pathType (semverCompare ">=1.18-0" $.Capabilities.KubeVersion.GitVersion) }}
47+
pathType: {{ .pathType }}
48+
{{- end }}
49+
backend:
50+
{{- if semverCompare ">=1.19-0" $.Capabilities.KubeVersion.GitVersion }}
51+
service:
52+
name: {{ $fullName }}
53+
port:
54+
number: {{ $svcPort }}
55+
{{- else }}
56+
serviceName: {{ $fullName }}
57+
servicePort: {{ $svcPort }}
58+
{{- end }}
59+
{{- end }}
60+
{{- end }}
61+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
apiVersion: v1
2+
kind: Secret
3+
metadata:
4+
name: {{ include "blobscan-indexer.fullname" . }}-env
5+
labels:
6+
{{- include "blobscan-indexer.labels" . | nindent 4 }}
7+
data:
8+
{{- range $key, $value := .Values.secretEnv }}
9+
{{ $key }}: {{ $value | b64enc }}
10+
{{- end }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
{{- if gt (len .Values.extraPorts) 0 }}
3+
apiVersion: v1
4+
kind: Service
5+
metadata:
6+
name: {{ include "blobscan-indexer.fullname" . }}
7+
labels:
8+
{{- include "blobscan-indexer.labels" . | nindent 4 }}
9+
spec:
10+
type: {{ .Values.service.type }}
11+
ports:
12+
{{ toYaml .Values.extraPorts | nindent 4}}
13+
selector:
14+
{{- include "blobscan-indexer.selectorLabels" . | nindent 4 }}
15+
{{- end }}

0 commit comments

Comments
 (0)