Skip to content

Commit

Permalink
add common-celestia-node (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
aWN4Y25pa2EK authored Oct 17, 2024
1 parent 602a5c7 commit f2adcec
Show file tree
Hide file tree
Showing 6 changed files with 306 additions and 0 deletions.
23 changes: 23 additions & 0 deletions charts/common-celestia-node/.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/
22 changes: 22 additions & 0 deletions charts/common-celestia-node/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
apiVersion: v2
name: common-celestia-node
description: A Helm library implementation for celestia-node shared templates

# 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
type: library

# 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.
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 and it is recommended to use it with quotes.
appVersion: "0.17.1"
74 changes: 74 additions & 0 deletions charts/common-celestia-node/templates/_bridge_config.toml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{{- define "common-celestia-node.bridge_config.toml" -}}
[Node]
StartupTimeout = "{{ .Values.node.config.bridge.configtoml.Node.StartupTimeout }}"
ShutdownTimeout = "{{ .Values.node.config.bridge.configtoml.Node.ShutdownTimeout }}"
[Core]
IP = "{{ .Values.node.config.bridge.configtoml.Core.IP }}"
RPCPort = "{{ .Values.node.config.bridge.configtoml.Core.RPCPort }}"
GRPCPort = "{{ .Values.node.config.bridge.configtoml.Core.GRPCPort }}"
[State]
DefaultKeyName = "{{ .Values.node.config.bridge.configtoml.State.DefaultKeyName }}"
DefaultBackendName = "{{ .Values.node.config.bridge.configtoml.State.DefaultBackendName }}"
[P2P]
ListenAddresses = [{{ range $index, $element := .Values.node.config.bridge.configtoml.P2P.ListenAddresses }}{{ if $index }}, {{ end }}"{{ $element }}"{{ end }}]
AnnounceAddresses = {{ .Values.node.config.bridge.configtoml.P2P.AnnounceAddresses }}
NoAnnounceAddresses = [{{ range $index, $element := .Values.node.config.bridge.configtoml.P2P.NoAnnounceAddresses }}{{ if $index }}, {{ end }}"{{ $element }}"{{ end }}]
MutualPeers = {{ .Values.node.config.bridge.configtoml.P2P.MutualPeers }}
PeerExchange = {{ .Values.node.config.bridge.configtoml.P2P.PeerExchange }}
RoutingTableRefreshPeriod = "{{ .Values.node.config.bridge.configtoml.P2P.RoutingTableRefreshPeriod }}"
[P2P.ConnManager]
Low = {{ printf "%.0f" .Values.node.config.bridge.configtoml.P2P.ConnManager.Low }}
High = {{ printf "%.0f" .Values.node.config.bridge.configtoml.P2P.ConnManager.High }}
GracePeriod = "{{ .Values.node.config.bridge.configtoml.P2P.ConnManager.GracePeriod }}"
[RPC]
Address = "{{ .Values.node.config.bridge.configtoml.RPC.Address }}"
Port = "{{ .Values.node.config.bridge.configtoml.RPC.Port }}"
SkipAuth = {{ .Values.node.config.bridge.configtoml.RPC.SkipAuth }}
[Gateway]
Address = "{{ .Values.node.config.bridge.configtoml.Gateway.Address }}"
Port = "{{ .Values.node.config.bridge.configtoml.Gateway.Port }}"
Enabled = {{ .Values.node.config.bridge.configtoml.Gateway.Enabled }}
[Share]
UseShareExchange = {{ .Values.node.config.bridge.configtoml.Share.UseShareExchange }}
[Share.EDSStoreParams]
GCInterval = "{{ .Values.node.config.bridge.configtoml.Share.EDSStoreParams.GCInterval }}"
RecentBlocksCacheSize = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Share.EDSStoreParams.RecentBlocksCacheSize }}
BlockstoreCacheSize = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Share.EDSStoreParams.BlockstoreCacheSize }}
[Share.ShrExEDSParams]
ServerReadTimeout = "{{ .Values.node.config.bridge.configtoml.Share.ShrExEDSParams.ServerReadTimeout }}"
ServerWriteTimeout = "{{ .Values.node.config.bridge.configtoml.Share.ShrExEDSParams.ServerWriteTimeout }}"
HandleRequestTimeout = "{{ .Values.node.config.bridge.configtoml.Share.ShrExEDSParams.HandleRequestTimeout }}"
ConcurrencyLimit = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Share.ShrExEDSParams.ConcurrencyLimit }}
BufferSize = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Share.ShrExEDSParams.BufferSize }}
[Share.ShrExNDParams]
ServerReadTimeout = "{{ .Values.node.config.bridge.configtoml.Share.ShrExNDParams.ServerReadTimeout }}"
ServerWriteTimeout = "{{ .Values.node.config.bridge.configtoml.Share.ShrExNDParams.ServerWriteTimeout }}"
HandleRequestTimeout = "{{ .Values.node.config.bridge.configtoml.Share.ShrExNDParams.HandleRequestTimeout }}"
ConcurrencyLimit = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Share.ShrExNDParams.ConcurrencyLimit }}
[Share.PeerManagerParams]
PoolValidationTimeout = "{{ .Values.node.config.bridge.configtoml.Share.PeerManagerParams.PoolValidationTimeout }}"
PeerCooldown = "{{ .Values.node.config.bridge.configtoml.Share.PeerManagerParams.PeerCooldown }}"
GcInterval = "{{ .Values.node.config.bridge.configtoml.Share.PeerManagerParams.GcInterval }}"
EnableBlackListing = {{ .Values.node.config.bridge.configtoml.Share.PeerManagerParams.EnableBlackListing }}
[Share.Discovery]
PeersLimit = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Share.Discovery.PeersLimit }}
AdvertiseInterval = "{{ .Values.node.config.bridge.configtoml.Share.Discovery.AdvertiseInterval }}"
[Header]
TrustedHash = "{{ .Values.node.config.bridge.configtoml.Header.TrustedHash }}"
TrustedPeers = {{ .Values.node.config.bridge.configtoml.Header.TrustedPeers }}
[Header.Store]
StoreCacheSize = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Header.Store.StoreCacheSize }}
IndexCacheSize = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Header.Store.IndexCacheSize }}
WriteBatchSize = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Header.Store.WriteBatchSize }}
[Header.Syncer]
TrustingPeriod = "{{ .Values.node.config.bridge.configtoml.Header.Syncer.TrustingPeriod }}"
[Header.Server]
WriteDeadline = "{{ .Values.node.config.bridge.configtoml.Header.Server.WriteDeadline }}"
ReadDeadline = "{{ .Values.node.config.bridge.configtoml.Header.Server.ReadDeadline }}"
RangeRequestTimeout = "{{ .Values.node.config.bridge.configtoml.Header.Server.RangeRequestTimeout }}"
[Header.Client]
MaxHeadersPerRangeRequest = {{ printf "%.0f" .Values.node.config.bridge.configtoml.Header.Client.MaxHeadersPerRangeRequest }}
RangeRequestTimeout = "{{ .Values.node.config.bridge.configtoml.Header.Client.RangeRequestTimeout }}"
[Pruner]
EnableService = {{ .Values.node.config.bridge.configtoml.Pruner.EnableService }}
{{- end }}
25 changes: 25 additions & 0 deletions charts/common-celestia-node/templates/_configmap.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{{- define "common-celestia-node.configmap" -}}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "common.names.fullname" . }}-configtoml
namespace: {{ include "common.names.namespace" . | quote }}
labels:
{{- include "common.labels.standard" ( dict "customLabels" .Values.commonLabels "context" $ ) | nindent 4 }}
app.kubernetes.io/component: node
{{- if .Values.commonAnnotations }}
annotations:
{{- include "common.tplvalues.render" ( dict "value" .Values.commonAnnotations "context" $ ) | nindent 4 }}
{{- end }}
data:
config.toml: |
{{- if eq .Values.node.settings.nodeType "bridge" -}}
{{ include "common-celestia-node.bridge_config.toml" . | nindent 4 }}
{{- else if eq .Values.node.settings.nodeType "full" -}}
{{ include "common-celestia-node.full_config.toml" . | nindent 4 }}
{{- else if eq .Values.node.settings.nodeType "light" -}}
{{ include "common-celestia-node.light_config.toml" . | nindent 4 }}
{{- else -}}
{{ fail "Unsupported nodeType value, must be one of: bridge, full, or light" }}
{{- end }}
{{- end }}
80 changes: 80 additions & 0 deletions charts/common-celestia-node/templates/_full_config.toml.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{{- define "common-celestia-node.full_config.toml" -}}
[Node]
StartupTimeout = "{{ .Values.node.config.full.configtoml.Node.StartupTimeout }}"
ShutdownTimeout = "{{ .Values.node.config.full.configtoml.Node.ShutdownTimeout }}"
[Core]
IP = "{{ .Values.node.config.full.configtoml.Core.IP }}"
RPCPort = "{{ .Values.node.config.full.configtoml.Core.RPCPort }}"
GRPCPort = "{{ .Values.node.config.full.configtoml.Core.GRPCPort }}"
[State]
DefaultKeyName = "{{ .Values.node.config.full.configtoml.State.DefaultKeyName }}"
DefaultBackendName = "{{ .Values.node.config.full.configtoml.State.DefaultBackendName }}"
[P2P]
ListenAddresses = [{{ range $index, $element := .Values.node.config.full.configtoml.P2P.ListenAddresses }}{{ if $index }}, {{ end }}"{{ $element }}"{{ end }}]
AnnounceAddresses = {{ .Values.node.config.full.configtoml.P2P.AnnounceAddresses }}
NoAnnounceAddresses = [{{ range $index, $element := .Values.node.config.full.configtoml.P2P.NoAnnounceAddresses }}{{ if $index }}, {{ end }}"{{ $element }}"{{ end }}]
MutualPeers = {{ .Values.node.config.full.configtoml.P2P.MutualPeers }}
PeerExchange = {{ .Values.node.config.full.configtoml.P2P.PeerExchange }}
RoutingTableRefreshPeriod = "{{ .Values.node.config.full.configtoml.P2P.RoutingTableRefreshPeriod }}"
[P2P.ConnManager]
Low = {{ printf "%.0f" .Values.node.config.full.configtoml.P2P.ConnManager.Low }}
High = {{ printf "%.0f" .Values.node.config.full.configtoml.P2P.ConnManager.High }}
GracePeriod = "{{ .Values.node.config.full.configtoml.P2P.ConnManager.GracePeriod }}"
[RPC]
Address = "{{ .Values.node.config.full.configtoml.RPC.Address }}"
Port = "{{ .Values.node.config.full.configtoml.RPC.Port }}"
SkipAuth = {{ .Values.node.config.full.configtoml.RPC.SkipAuth }}
[Gateway]
Address = "{{ .Values.node.config.full.configtoml.Gateway.Address }}"
Port = "{{ .Values.node.config.full.configtoml.Gateway.Port }}"
Enabled = {{ .Values.node.config.full.configtoml.Gateway.Enabled }}
[Share]
UseShareExchange = {{ .Values.node.config.full.configtoml.Share.UseShareExchange }}
[Share.EDSStoreParams]
GCInterval = "{{ .Values.node.config.full.configtoml.Share.EDSStoreParams.GCInterval }}"
RecentBlocksCacheSize = {{ printf "%.0f" .Values.node.config.full.configtoml.Share.EDSStoreParams.RecentBlocksCacheSize }}
BlockstoreCacheSize = {{ printf "%.0f" .Values.node.config.full.configtoml.Share.EDSStoreParams.BlockstoreCacheSize }}
[Share.ShrExEDSParams]
ServerReadTimeout = "{{ .Values.node.config.full.configtoml.Share.ShrExEDSParams.ServerReadTimeout }}"
ServerWriteTimeout = "{{ .Values.node.config.full.configtoml.Share.ShrExEDSParams.ServerWriteTimeout }}"
HandleRequestTimeout = "{{ .Values.node.config.full.configtoml.Share.ShrExEDSParams.HandleRequestTimeout }}"
ConcurrencyLimit = {{ printf "%.0f" .Values.node.config.full.configtoml.Share.ShrExEDSParams.ConcurrencyLimit }}
BufferSize = {{ printf "%.0f" .Values.node.config.full.configtoml.Share.ShrExEDSParams.BufferSize }}
[Share.ShrExNDParams]
ServerReadTimeout = "{{ .Values.node.config.full.configtoml.Share.ShrExNDParams.ServerReadTimeout }}"
ServerWriteTimeout = "{{ .Values.node.config.full.configtoml.Share.ShrExNDParams.ServerWriteTimeout }}"
HandleRequestTimeout = "{{ .Values.node.config.full.configtoml.Share.ShrExNDParams.HandleRequestTimeout }}"
ConcurrencyLimit = {{ printf "%.0f" .Values.node.config.full.configtoml.Share.ShrExNDParams.ConcurrencyLimit }}
[Share.PeerManagerParams]
PoolValidationTimeout = "{{ .Values.node.config.full.configtoml.Share.PeerManagerParams.PoolValidationTimeout }}"
PeerCooldown = "{{ .Values.node.config.full.configtoml.Share.PeerManagerParams.PeerCooldown }}"
GcInterval = "{{ .Values.node.config.full.configtoml.Share.PeerManagerParams.GcInterval }}"
EnableBlackListing = {{ .Values.node.config.full.configtoml.Share.PeerManagerParams.EnableBlackListing }}
[Share.Discovery]
PeersLimit = {{ printf "%.0f" .Values.node.config.full.configtoml.Share.Discovery.PeersLimit }}
AdvertiseInterval = "{{ .Values.node.config.full.configtoml.Share.Discovery.AdvertiseInterval }}"
[Header]
TrustedHash = "{{ .Values.node.config.full.configtoml.Header.TrustedHash }}"
TrustedPeers = {{ .Values.node.config.full.configtoml.Header.TrustedPeers }}
[Header.Store]
StoreCacheSize = {{ printf "%.0f" .Values.node.config.full.configtoml.Header.Store.StoreCacheSize }}
IndexCacheSize = {{ printf "%.0f" .Values.node.config.full.configtoml.Header.Store.IndexCacheSize }}
WriteBatchSize = {{ printf "%.0f" .Values.node.config.full.configtoml.Header.Store.WriteBatchSize }}
[Header.Syncer]
TrustingPeriod = "{{ .Values.node.config.full.configtoml.Header.Syncer.TrustingPeriod }}"
[Header.Server]
WriteDeadline = "{{ .Values.node.config.full.configtoml.Header.Server.WriteDeadline }}"
ReadDeadline = "{{ .Values.node.config.full.configtoml.Header.Server.ReadDeadline }}"
RangeRequestTimeout = "{{ .Values.node.config.full.configtoml.Header.Server.RangeRequestTimeout }}"
[Header.Client]
MaxHeadersPerRangeRequest = {{ printf "%.0f" .Values.node.config.full.configtoml.Header.Client.MaxHeadersPerRangeRequest }}
RangeRequestTimeout = "{{ .Values.node.config.full.configtoml.Header.Client.RangeRequestTimeout }}"
[DASer]
SamplingRange = {{ printf "%.0f" .Values.node.config.full.configtoml.DASer.SamplingRange }}
ConcurrencyLimit = {{ printf "%.0f" .Values.node.config.full.configtoml.DASer.ConcurrencyLimit }}
BackgroundStoreInterval = "{{ .Values.node.config.full.configtoml.DASer.BackgroundStoreInterval }}"
SampleFrom = {{ printf "%.0f" .Values.node.config.full.configtoml.DASer.SampleFrom }}
SampleTimeout = "{{ .Values.node.config.full.configtoml.DASer.SampleTimeout }}"
[Pruner]
EnableService = {{ .Values.node.config.full.configtoml.Pruner.EnableService }}
{{- end }}
Loading

0 comments on commit f2adcec

Please sign in to comment.