Skip to content

Commit

Permalink
Initial clean commit
Browse files Browse the repository at this point in the history
  • Loading branch information
kw1knode committed Jan 2, 2025
0 parents commit bac8d46
Show file tree
Hide file tree
Showing 22 changed files with 946 additions and 0 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/update-index.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Release Charts

on:
push:
branches:
- main

jobs:
release:
permissions:
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Configure Git
run: |
git config user.name "$GITHUB_ACTOR"
git config user.email "[email protected]"
- name: Run chart-releaser
uses: helm/[email protected]
env:
CR_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Ignore macOS system files
.DS_Store
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Nodeify Helm Charts

This repository contains Helm charts for Nodeify's tools and services.

## Available Charts

- indexer-tools - Tools for blockchain indexing

## Usage

```bash
helm repo add nodeify https://nodeify-eth.github.io/helm-charts
helm repo update
helm install indexer-tools nodeify/indexer-tools
16 changes: 16 additions & 0 deletions charts/cosmoshub/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: v2
name: cosmoshub-rpc
description: A Helm chart for deploying a Cosmoshub node
type: application
version: 1.0.0
appVersion: v21.0.0
maintainers:
- name: vince
email: [email protected]
keywords:
- cosmoshub
- blockchain
- rpc
home: https://nodeify.net
sources:
- https://github.com/cosmos/gaia
63 changes: 63 additions & 0 deletions charts/cosmoshub/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# cosmoshub

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

A Helm chart for deploying a Cosmoshub node

**Homepage:** <https://github.com/cosmos/gaia>

## Maintainers

| Name | Email | Url |
| ---- | ------ | --- |
| vince | <[email protected]> | |

## Source Code

* <https://github.com/cosmos/gaia>

## Values

| Key | Type | Default | Description |
|-----|------|---------|-------------|
| affinity | object | `{}` | |
| flags | string | `nil` | |
| fullnameOverride | string | `""` | |
| image.hash | string | `"2998c7af42d7f2f86c0d78cc6b9ffc13d36fb64de8129c5bc6cddec0eaebb889"` | |
| image.name | string | `"ghcr.io/cosmos/gaia"` | |
| image.tag | string | `"v21.0.0"` | |
| imagePullSecrets | list | `[]` | |
| ingress.annotations | object | `{}` | |
| ingress.className | string | `""` | |
| ingress.enabled | bool | `false` | |
| ingress.hosts[0].host | string | `"chart-example.local"` | |
| ingress.hosts[0].paths[0].path | string | `"/"` | |
| ingress.hosts[0].paths[0].pathType | string | `"Prefix"` | |
| ingress.hosts[0].paths[0].servicePort | string | `"rpc"` | |
| ingress.tls | list | `[]` | |
| nameOverride | string | `""` | |
| net | string | `"mainnet"` | |
| nodeSelector | object | `{}` | |
| persistence.accessMode | string | `"ReadWriteOnce"` | |
| persistence.enabled | bool | `true` | |
| persistence.size | string | `"250Gi"` | |
| persistence.storageClass | string | `"-"` | |
| podAnnotations | object | `{}` | |
| podSecurityContext.fsGroup | int | `1000` | |
| pvc.annotations | object | `{}` | |
| replicaCount | int | `1` | |
| resources.limits.memory | string | `"48Gi"` | |
| resources.requests.cpu | int | `4` | |
| resources.requests.memory | string | `"16Gi"` | |
| securityContext | object | `{}` | |
| service.annotations | object | `{}` | |
| service.port.grpc | int | `9090` | |
| service.port.p2p | int | `26656` | |
| service.port.rpc | int | `26657` | |
| service.type | string | `"ClusterIP"` | |
| snapshot.enabled | bool | `true` | |
| snapshot.url | string | `"$(curl -s https://polkachu.com/api/v2/chain_snapshots/cosmos/mainnet | jq -r .snapshot.url)"` | |
| tolerations | list | `[]` | |

----------------------------------------------
Autogenerated from chart metadata using [helm-docs v1.14.2](https://github.com/norwoodj/helm-docs/releases/v1.14.2)
71 changes: 71 additions & 0 deletions charts/cosmoshub/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# templates/_helpers.tpl
{{/*
Expand the name of the chart.
*/}}
{{- define "cosmoshub.name" -}}
{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
*/}}
{{- define "cosmoshub.fullname" -}}
{{- if .Values.fullnameOverride }}
{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "cosmoshub.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "cosmoshub.labels" -}}
helm.sh/chart: {{ include "cosmoshub.chart" . }}
{{ include "cosmoshub.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "cosmoshub.selectorLabels" -}}
app.kubernetes.io/name: {{ include "cosmoshub.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}

{{/*
Define RPC port
*/}}
{{- define "cosmoshub.rpc" -}}
{{- .Values.service.port.rpc }}
{{- end }}

{{/*
Define P2P port
*/}}
{{- define "cosmoshub.p2p" -}}
{{- .Values.service.port.p2p }}
{{- end }}

{{/*
Define GRPC port
*/}}
{{- define "cosmoshub.grpc" -}}
{{- .Values.service.port.grpc }}
{{- end }}
76 changes: 76 additions & 0 deletions charts/cosmoshub/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: {{ include "cosmoshub.fullname" . }}-scripts
labels:
{{- include "cosmoshub.labels" . | nindent 4 }}
data:
probe.sh: |
#!/bin/sh
set -euo pipefail
FILE=/root/.gaia/.probe_last_height
STATUS=$(curl -s --fail -m 20 http://localhost:26657/status) || { echo "Curl failed"; exit 1; }
CATCHING_UP=$(echo "$STATUS" | jq -r '.result.sync_info.catching_up')
CURRENT_HEIGHT=$(echo "$STATUS" | jq -r '.result.sync_info.latest_block_height')
if [ ! -f "$FILE" ]; then
echo "First run, writing height: $CURRENT_HEIGHT"
echo "$CURRENT_HEIGHT" > "$FILE"
exit 1
fi
LAST_HEIGHT=$(cat "$FILE")
echo "Previous height: $LAST_HEIGHT, Current height: $CURRENT_HEIGHT"
if [ "$CURRENT_HEIGHT" -le "$LAST_HEIGHT" ]; then
echo "Block height not increasing"
exit 1
fi
if [ "$CATCHING_UP" = "true" ]; then
echo "Node still catching up"
echo "$CURRENT_HEIGHT" > "$FILE"
exit 1
fi
echo "Node is synced and progressing"
echo "$CURRENT_HEIGHT" > "$FILE"
exit 0
init.sh: |
#!/bin/sh
set -euo pipefail
mkdir -p /root/.gaia/config /root/.gaia/data
{{- if eq .Values.net "testnet" }}
GENESIS_URL="https://snapshots.polkachu.com/testnet-genesis/cosmos/genesis.json"
ADDRBOOK_URL="https://snapshots.polkachu.com/testnet-addrbook/cosmos/addrbook.json"
{{- else }}
GENESIS_URL="https://snapshots.polkachu.com/genesis/cosmos/genesis.json"
ADDRBOOK_URL="https://snapshots.polkachu.com/addrbook/cosmos/addrbook.json"
{{- end }}
# Pull genesis if not present
[ -f "/root/.gaia/config/genesis.json" ] || wget -O /root/.gaia/config/genesis.json $GENESIS_URL
# Update addrbook
wget -O /root/.gaia/config/addrbook.json $ADDRBOOK_URL || true
# Exit if data exists
[ -f "/root/.gaia/data/priv_validator_state.json" ] && { rm -f /root/.gaia/*.lz4; exit 0; }
{{- if .Values.snapshot.enabled }}
# Install required packages
apk add --no-cache aria2 lz4 curl jq
# Download and extract snapshot
cd /root/.gaia
eval "SNAPSHOT_URL={{ .Values.snapshot.url }}"
aria2c -c -x10 "$SNAPSHOT_URL"
lz4 -c -d "$(basename "$SNAPSHOT_URL")" | tar xf -
rm -f *.lz4
{{- end }}
Loading

0 comments on commit bac8d46

Please sign in to comment.