Skip to content

Commit

Permalink
add 'preview' testnet configs
Browse files Browse the repository at this point in the history
  • Loading branch information
regel committed Jan 4, 2023
1 parent 107d761 commit e907078
Show file tree
Hide file tree
Showing 13 changed files with 351 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/cardano/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ description: A Cardano Helm chart for Kubernetes

type: application

version: 0.4.1
version: 0.4.2

appVersion: 1.35.4

Expand Down
4 changes: 2 additions & 2 deletions charts/cardano/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# cardano

![Version: 0.4.0](https://img.shields.io/badge/Version-0.4.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.35.4](https://img.shields.io/badge/AppVersion-1.35.4-informational?style=flat-square)
![Version: 0.4.2](https://img.shields.io/badge/Version-0.4.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 1.35.4](https://img.shields.io/badge/AppVersion-1.35.4-informational?style=flat-square)

A Cardano Helm chart for Kubernetes

Expand All @@ -21,7 +21,7 @@ A Cardano Helm chart for Kubernetes
| curl.pullPolicy | string | `"IfNotPresent"` | |
| curl.repository | string | `"ghcr.io/regel/lz4"` | |
| curl.tag | string | `"0.0.3"` | |
| environment.name | string | `"testnet"` | name of the Cardano network to use. Either 'testnet' or 'mainnet' |
| environment.name | string | `"testnet"` | name of the Cardano network to use. Either 'preview', 'testnet' or 'mainnet' |
| fullnameOverride | string | `""` | |
| global.storageClass | string | `nil` | Global StorageClass for Persistent Volume(s) |
| image.pullPolicy | string | `"IfNotPresent"` | |
Expand Down
Binary file not shown.
Binary file not shown.
122 changes: 122 additions & 0 deletions charts/cardano/files/preview/producer-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
{{- if semverCompare ">=1.28.0" .Values.image.tag }}
"AlonzoGenesisFile": "alonzo-genesis.json",
"AlonzoGenesisHash": "7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874",
{{- end }}
"ApplicationName": "cardano-sl",
"ApplicationVersion": 0,
"ByronGenesisFile": "byron-genesis.json",
"ByronGenesisHash": "83de1d7302569ad56cf9139a41e2e11346d4cb4a31c00142557b6ab3fa550761",
"EnableP2P": false,
"LastKnownBlockVersion-Alt": 0,
"LastKnownBlockVersion-Major": 3,
"LastKnownBlockVersion-Minor": 1,
"Protocol": "Cardano",
"RequiresNetworkMagic": "RequiresMagic",
"ShelleyGenesisFile": "shelley-genesis.json",
"ShelleyGenesisHash": "363498d1024f84bb39d3fa9593ce391483cb40d479b87233f868d6e57c3a400d",
"TargetNumberOfActivePeers": 20,
"TargetNumberOfEstablishedPeers": 50,
"TargetNumberOfKnownPeers": 100,
"TargetNumberOfRootPeers": 100,
"TestAllegraHardForkAtEpoch": 0,
"TestAlonzoHardForkAtEpoch": 0,
"TestEnableDevelopmentHardForkEras": true,
"TestEnableDevelopmentNetworkProtocols": true,
"TestMaryHardForkAtEpoch": 0,
"TestShelleyHardForkAtEpoch": 0,
"TraceAcceptPolicy": true,
"TraceBlockFetchClient": false,
"TraceBlockFetchDecisions": true,
"TraceBlockFetchProtocol": false,
"TraceBlockFetchProtocolSerialised": false,
"TraceBlockFetchServer": false,
"TraceChainDb": true,
"TraceChainSyncBlockServer": false,
"TraceChainSyncClient": false,
"TraceChainSyncHeaderServer": false,
"TraceChainSyncProtocol": false,
"TraceConnectionManager": true,
"TraceDNSResolver": true,
"TraceDNSSubscription": true,
"TraceDiffusionInitialization": true,
"TraceErrorPolicy": true,
"TraceForge": true,
"TraceHandshake": false,
"TraceInboundGovernor": true,
"TraceIpSubscription": true,
"TraceLedgerPeers": true,
"TraceLocalChainSyncProtocol": false,
"TraceLocalErrorPolicy": true,
"TraceLocalHandshake": false,
"TraceLocalRootPeers": true,
"TraceLocalTxSubmissionProtocol": false,
"TraceLocalTxSubmissionServer": false,
"TraceMempool": true,
"TraceMux": false,
"TracePeerSelection": true,
"TracePeerSelectionActions": true,
"TracePublicRootPeers": true,
"TraceServer": true,
"TraceTxInbound": false,
"TraceTxOutbound": false,
"TraceTxSubmissionProtocol": false,
"TracingVerbosity": "NormalVerbosity",
"TurnOnLogMetrics": true,
"TurnOnLogging": true,
"defaultBackends": [
"KatipBK"
],
"defaultScribes": [
[
"StdoutSK",
"stdout"
]
],
"hasEKG": 12788,
"hasPrometheus": [
"0.0.0.0",
12789
],
"minSeverity": "Info",
"options": {
"mapBackends": {
"cardano.node.metrics": [
"EKGViewBK"
],
"cardano.node.resources": [
"EKGViewBK"
],
"cardano.node.BlockFetchDecision.peers": [
"EKGViewBK"
],
"cardano.node.ChainDB.metrics": [
"EKGViewBK"
],
"cardano.node.Forge.metrics": [
"EKGViewBK"
]
},
"mapSubtrace": {
"cardano.node.metrics": {
"subtrace": "Neutral"
}
}
},
"rotation": {
"rpKeepFilesNum": 10,
"rpLogLimitBytes": 5000000,
"rpMaxAgeHours": 24
},
"setupBackends": [
"KatipBK"
],
"setupScribes": [
{
"scFormat": "ScText",
"scKind": "StdoutSK",
"scName": "stdout",
"scRotation": null
}
]
}
37 changes: 37 additions & 0 deletions charts/cardano/files/preview/producer-topology.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{{- $fullName := include "cardano.fullname" . }}
{{- $namespace := .Release.Namespace }}
{{- $replicaCount := .Values.relay.replicaCount | int }}

{{- $producers := list }}
{{- if .Values.producer.enabled }}
{{- range $index, $value := until $replicaCount }}
{{- $addr := printf "%s-relay-%d.%s-headless.%s.svc.cluster.local" $fullName $index $fullName $namespace }}
{{- $item := dict "addr" $addr "port" 3001 "valency" 1 }}
{{- $producers = prepend $producers $item }}
{{- end }}
{{- end }}

{
"Producers":
{{- toPrettyJson $producers | indent 4 }},
"LocalRoots": {
"groups": [
{
"localRoots": {
"accessPoints": [],
"advertise": false
},
"valency": 1
}
]
},
"PublicRoots": [
{
"publicRoots": {
"accessPoints": [],
"advertise": false
}
}
],
"useLedgerAfterSlot": 322000
}
122 changes: 122 additions & 0 deletions charts/cardano/files/preview/relay-config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
{{- if semverCompare ">=1.28.0" .Values.image.tag }}
"AlonzoGenesisFile": "alonzo-genesis.json",
"AlonzoGenesisHash": "7e94a15f55d1e82d10f09203fa1d40f8eede58fd8066542cf6566008068ed874",
{{- end }}
"ApplicationName": "cardano-sl",
"ApplicationVersion": 0,
"ByronGenesisFile": "byron-genesis.json",
"ByronGenesisHash": "83de1d7302569ad56cf9139a41e2e11346d4cb4a31c00142557b6ab3fa550761",
"EnableP2P": {{ .Values.p2p.enabled }},
"LastKnownBlockVersion-Alt": 0,
"LastKnownBlockVersion-Major": 3,
"LastKnownBlockVersion-Minor": 1,
"Protocol": "Cardano",
"RequiresNetworkMagic": "RequiresMagic",
"ShelleyGenesisFile": "shelley-genesis.json",
"ShelleyGenesisHash": "363498d1024f84bb39d3fa9593ce391483cb40d479b87233f868d6e57c3a400d",
"TargetNumberOfActivePeers": 20,
"TargetNumberOfEstablishedPeers": 50,
"TargetNumberOfKnownPeers": 100,
"TargetNumberOfRootPeers": 100,
"TestAllegraHardForkAtEpoch": 0,
"TestAlonzoHardForkAtEpoch": 0,
"TestEnableDevelopmentHardForkEras": true,
"TestEnableDevelopmentNetworkProtocols": true,
"TestMaryHardForkAtEpoch": 0,
"TestShelleyHardForkAtEpoch": 0,
"TraceAcceptPolicy": true,
"TraceBlockFetchClient": false,
"TraceBlockFetchDecisions": true,
"TraceBlockFetchProtocol": false,
"TraceBlockFetchProtocolSerialised": false,
"TraceBlockFetchServer": false,
"TraceChainDb": true,
"TraceChainSyncBlockServer": false,
"TraceChainSyncClient": false,
"TraceChainSyncHeaderServer": false,
"TraceChainSyncProtocol": false,
"TraceConnectionManager": true,
"TraceDNSResolver": true,
"TraceDNSSubscription": true,
"TraceDiffusionInitialization": true,
"TraceErrorPolicy": true,
"TraceForge": true,
"TraceHandshake": false,
"TraceInboundGovernor": true,
"TraceIpSubscription": true,
"TraceLedgerPeers": true,
"TraceLocalChainSyncProtocol": false,
"TraceLocalErrorPolicy": true,
"TraceLocalHandshake": false,
"TraceLocalRootPeers": true,
"TraceLocalTxSubmissionProtocol": false,
"TraceLocalTxSubmissionServer": false,
"TraceMempool": true,
"TraceMux": false,
"TracePeerSelection": true,
"TracePeerSelectionActions": true,
"TracePublicRootPeers": true,
"TraceServer": true,
"TraceTxInbound": false,
"TraceTxOutbound": false,
"TraceTxSubmissionProtocol": false,
"TracingVerbosity": "NormalVerbosity",
"TurnOnLogMetrics": true,
"TurnOnLogging": true,
"defaultBackends": [
"KatipBK"
],
"defaultScribes": [
[
"StdoutSK",
"stdout"
]
],
"hasEKG": 12788,
"hasPrometheus": [
"0.0.0.0",
12789
],
"minSeverity": "Info",
"options": {
"mapBackends": {
"cardano.node.metrics": [
"EKGViewBK"
],
"cardano.node.resources": [
"EKGViewBK"
],
"cardano.node.BlockFetchDecision.peers": [
"EKGViewBK"
],
"cardano.node.ChainDB.metrics": [
"EKGViewBK"
],
"cardano.node.Forge.metrics": [
"EKGViewBK"
]
},
"mapSubtrace": {
"cardano.node.metrics": {
"subtrace": "Neutral"
}
}
},
"rotation": {
"rpKeepFilesNum": 10,
"rpLogLimitBytes": 5000000,
"rpMaxAgeHours": 24
},
"setupBackends": [
"KatipBK"
],
"setupScribes": [
{
"scFormat": "ScText",
"scKind": "StdoutSK",
"scName": "stdout",
"scRotation": null
}
]
}
42 changes: 42 additions & 0 deletions charts/cardano/files/preview/relay-topology.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{{- $fullName := include "cardano.fullname" . }}
{{- $namespace := .Release.Namespace }}
{{- $replicaCount := .Values.producer.replicaCount | int }}

{{- $producers := list }}
{{- if .Values.producer.enabled }}
{{- range $index, $value := until $replicaCount }}
{{- $addr := printf "%s-producer-%d.%s-headless.%s.svc.cluster.local" $fullName $index $fullName $namespace }}
{{- $item := dict "addr" $addr "port" 3001 "valency" 1 }}
{{- $producers = prepend $producers $item }}
{{- end }}
{{- end }}

{
"Producers":
{{- toPrettyJson $producers | indent 4 }},
"LocalRoots": {
"groups": [
{
"localRoots": {
"accessPoints": [],
"advertise": false
},
"valency": 1
}
]
},
"PublicRoots": [
{
"publicRoots": {
"accessPoints": [
{
"address": "preview-node.world.dev.cardano.org",
"port": 30002
}
],
"advertise": false
}
}
],
"useLedgerAfterSlot": 322000
}
Binary file not shown.
18 changes: 18 additions & 0 deletions charts/cardano/templates/preview-configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{- if eq .Values.environment.name "preview" }}
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "cardano.configName" . }}-preview
data:
{{ (tpl (.Files.Glob "files/readiness.sh").AsConfig . ) | indent 2 }}
{{ (tpl (.Files.Glob "files/preview/producer-topology.json").AsConfig . ) | indent 2 }}
{{ (tpl (.Files.Glob "files/preview/producer-config.json").AsConfig . ) | indent 2 }}
{{ (tpl (.Files.Glob "files/preview/relay-topology.json").AsConfig . ) | indent 2 }}
{{ (tpl (.Files.Glob "files/preview/relay-config.json").AsConfig . ) | indent 2 }}
binaryData:
{{- $root := . }}
{{- $location := "files/preview/*.json.gz" }}
{{- range $path, $bytes := .Files.Glob $location }}
{{ base $path }}: {{ $root.Files.Get $path | b64enc | quote }}
{{- end }}
{{- end }}
3 changes: 3 additions & 0 deletions charts/cardano/templates/producer-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ spec:
template:
metadata:
annotations:
{{- if eq .Values.environment.name "preview" }}
checksum/preview: {{ include (print $.Template.BasePath "/preview-configmap.yaml") . | sha256sum }}
{{- end }}
{{- if eq .Values.environment.name "testnet" }}
checksum/testnet: {{ include (print $.Template.BasePath "/testnet-configmap.yaml") . | sha256sum }}
{{- end }}
Expand Down
3 changes: 3 additions & 0 deletions charts/cardano/templates/relay-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ spec:
template:
metadata:
annotations:
{{- if eq .Values.environment.name "preview" }}
checksum/preview: {{ include (print $.Template.BasePath "/preview-configmap.yaml") . | sha256sum }}
{{- end }}
{{- if eq .Values.environment.name "testnet" }}
checksum/testnet: {{ include (print $.Template.BasePath "/testnet-configmap.yaml") . | sha256sum }}
{{- end }}
Expand Down
Loading

0 comments on commit e907078

Please sign in to comment.