Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: midl-dev/polkadot-k8s
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v7.30
Choose a base ref
...
head repository: midl-dev/polkadot-k8s
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref

Commits on Apr 4, 2023

  1. fix helm release gen

    nicolasochem committed Apr 4, 2023
    Copy the full SHA
    4192aad View commit details
  2. escape properly

    nicolasochem committed Apr 4, 2023
    Copy the full SHA
    adf18fe View commit details

Commits on Apr 21, 2023

  1. Copy the full SHA
    a335608 View commit details
  2. Copy the full SHA
    385adc4 View commit details

Commits on May 11, 2023

  1. Copy the full SHA
    20ea87b View commit details

Commits on May 18, 2023

  1. Copy the full SHA
    867a1ff View commit details

Commits on May 30, 2023

  1. Copy the full SHA
    47e61e6 View commit details

Commits on Jun 1, 2023

  1. Exit vote removal if democracy property couldn't be found (#38)

    * Exit vote removal if democracy property couldn't be found
    
    * fix deletion of gov2 votes
    
    ---------
    
    Co-authored-by: Nicolas Ochem <nicolas.ochem@gmail.com>
    puppetninja and nicolasochem authored Jun 1, 2023
    Copy the full SHA
    df5f8d6 View commit details

Commits on Jun 14, 2023

  1. Copy the full SHA
    20bc9fe View commit details
  2. deprecate port 9933

    nicolasochem committed Jun 14, 2023
    Copy the full SHA
    cd3b515 View commit details

Commits on Jun 18, 2023

  1. enable gov2 polkadot

    nicolasochem committed Jun 18, 2023
    Copy the full SHA
    098aa84 View commit details

Commits on Jun 19, 2023

  1. Copy the full SHA
    bd01f01 View commit details
  2. Copy the full SHA
    3acd58b View commit details

Commits on Aug 9, 2023

  1. add storage class

    nicolasochem committed Aug 9, 2023
    Copy the full SHA
    e777d71 View commit details
  2. Copy the full SHA
    af27e3c View commit details

Commits on Aug 17, 2023

  1. fix delete old votes

    nicolasochem committed Aug 17, 2023
    Copy the full SHA
    a8ce40a View commit details
  2. fix misplaced exit

    nicolasochem committed Aug 17, 2023
    Copy the full SHA
    79c683f View commit details

Commits on Aug 18, 2023

  1. Copy the full SHA
    a800277 View commit details

Commits on Aug 22, 2023

  1. Copy the full SHA
    9a332a5 View commit details

Commits on Sep 10, 2023

  1. Copy the full SHA
    7289e41 View commit details
  2. Copy the full SHA
    99c6aa4 View commit details

Commits on Sep 14, 2023

  1. Copy the full SHA
    96724e9 View commit details
  2. add no-beefy otherwise kusama validators fail to start

    also remove deprecated param
    nicolasochem committed Sep 14, 2023
    Copy the full SHA
    84bf3a4 View commit details

Commits on Dec 7, 2023

  1. Copy the full SHA
    bb736a9 View commit details

Commits on Dec 12, 2023

  1. Finish job without failure when balance is too low (#43)

    * Bump node version for vote-bot
    
    * Catch errors for vote removal
    
    * Apply update for payout bot as well
    
    * Update messages
    
    * Fix message for payout bot
    
    * Update messages again
    puppetninja authored Dec 12, 2023
    Copy the full SHA
    ca8855f View commit details
  2. Copy the full SHA
    54ca3c3 View commit details

Commits on Jan 2, 2024

  1. Copy the full SHA
    bf5eff2 View commit details

Commits on Feb 27, 2024

  1. enable beefy

    nicolasochem committed Feb 27, 2024
    Copy the full SHA
    0c08245 View commit details

Commits on Apr 19, 2024

  1. claimedRewards => legacyClaimedRewards

    nicolasochem committed Apr 19, 2024
    Copy the full SHA
    5ce662f View commit details

Commits on Apr 21, 2024

  1. fix detection of already made payouts with new API

    nicolasochem committed Apr 21, 2024
    Copy the full SHA
    44f1a0b View commit details

Commits on Jun 11, 2024

  1. Update npm modules for payout jobs

    puppetninja committed Jun 11, 2024
    Copy the full SHA
    e8f8a77 View commit details

Commits on Jul 23, 2024

  1. update polkadot api for vote bot

    nicolasochem committed Jul 23, 2024
    Copy the full SHA
    40657e6 View commit details

Commits on Oct 19, 2024

  1. no hw benchmark param + unsake node key generation

    Node key generation has to be done at the pod's first boot, so we allow
    it.
    
    Add a chart param for hardware benchmarks.
    nicolasochem committed Oct 19, 2024
    Copy the full SHA
    fbc0984 View commit details

Commits on Oct 20, 2024

  1. fix script error

    nicolasochem committed Oct 20, 2024
    Copy the full SHA
    9a90a27 View commit details
  2. add new polkadot option

    nicolasochem committed Oct 20, 2024
    Copy the full SHA
    f43af81 View commit details

Commits on Nov 13, 2024

  1. verbosity to 1

    nicolasochem committed Nov 13, 2024
    Copy the full SHA
    53c50e3 View commit details

Commits on Mar 3, 2025

  1. enable litep2p (#46)

    * enable litep2p
    
    * litep2p automatic for all kusama
    
    ---------
    
    Co-authored-by: Nicolas Ochem <nicolas.ochem@gmail.com>
    puppetninja and nicolasochem authored Mar 3, 2025
    Copy the full SHA
    69ec49d View commit details
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -42,7 +42,7 @@ jobs:
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
uses: docker/metadata-action@v4
with:
images: ghcr.io/${{ github.repository_owner }}/${{ matrix.container }}
tags: |
@@ -108,7 +108,7 @@ jobs:
# Update the release version of each of polkadot-k8s images
for image in $custom_images; do
image_name=$(yq e ".polkadot_k8s_images.$image" $chart/values.yaml | sed -E "s/polkadot-(.*):.*/\1/")
image_name=$(yq e ".polkadot_k8s_images.$image" $chart/values.yaml | sed -E "s/ghcr.io\/midl-dev\/polkadot-(.*):.*/\1/")
yq e ".polkadot_k8s_images.$image = \"ghcr.io/midl-dev/polkadot-$image_name:$(echo $RELEASE_VERSION | sed s/v//)\"" -i $chart/values.yaml
done
done
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -5,7 +5,6 @@ This project is a collection of helm charts to help you deploy [Polkadot](https:
Features:

* compatible with Kusama and Polkadot
* download and import a [pre-synced database](https://polkashots.io) for faster synchronization of the node
* includes a [payout cronjob](charts/polkadot-payout) for automated payouts
* includes a [vote bot](charts/polkadot-votebot) for easy governance voting

82 changes: 25 additions & 57 deletions charts/polkadot-votebot/templates/cronjob.yaml
Original file line number Diff line number Diff line change
@@ -15,66 +15,34 @@ spec:
spec:
nodeSelector:
{{ toYaml .Values.node_selector | indent 12 }}
initContainers:
containers:
- name: polkadot-votebot-gov2-cron
image: {{ .Values.polkadot_k8s_images.polkadot_votebot_gov2_cron }}
env:
- name: PROXY_ACCOUNT_MNEMONIC
valueFrom:
secretKeyRef:
name: polkadot-proxy-secrets
key: proxy-account-mnemonic
- name: "SLACK_ALERT_TOKEN"
valueFrom:
secretKeyRef:
name: polkadot-proxy-secrets
key: slack-alert-token
- name: "STASH_ACCOUNT_ADDRESS"
value: "{{ .Values.stash_account_address }}"
- name: "STASH_ACCOUNT_ALIAS"
value: "{{ .Values.stash_account_alias }}"
- name: "SLACK_ALERT_CHANNEL"
value: "{{ .Values.slack_alert_channel }}"
- name: "NODE_ENDPOINT"
value: "{{ .Values.node_endpoint }}"
- name: "VOTE_REPO"
value: "{{ .Values.vote_repo }}"
- name: "PROXY_ACCOUNT_ALIAS"
value: "{{ .Values.proxy_account_alias }}"
- name: "CHAIN"
value: "{{ .Values.chain }}"
resources:
limits:
cpu: 0
imagePullPolicy: IfNotPresent
containers:
- name: polkadot-votebot-cron
image: {{ .Values.polkadot_k8s_images.polkadot_votebot_cron }}
env:
- name: PROXY_ACCOUNT_MNEMONIC
valueFrom:
secretKeyRef:
name: polkadot-proxy-secrets
key: proxy-account-mnemonic
- name: "SLACK_ALERT_TOKEN"
valueFrom:
secretKeyRef:
name: polkadot-proxy-secrets
key: slack-alert-token
- name: "STASH_ACCOUNT_ADDRESS"
value: "{{ .Values.stash_account_address }}"
- name: "STASH_ACCOUNT_ALIAS"
value: "{{ .Values.stash_account_alias }}"
- name: "SLACK_ALERT_CHANNEL"
value: "{{ .Values.slack_alert_channel }}"
- name: "NODE_ENDPOINT"
value: "{{ .Values.node_endpoint }}"
- name: "VOTE_REPO"
value: "{{ .Values.vote_repo }}"
- name: "PROXY_ACCOUNT_ALIAS"
value: "{{ .Values.proxy_account_alias }}"
- name: "CHAIN"
value: "{{ .Values.chain }}"
- name: PROXY_ACCOUNT_MNEMONIC
valueFrom:
secretKeyRef:
name: polkadot-proxy-secrets
key: proxy-account-mnemonic
- name: "SLACK_ALERT_TOKEN"
valueFrom:
secretKeyRef:
name: polkadot-proxy-secrets
key: slack-alert-token
- name: "STASH_ACCOUNT_ADDRESS"
value: "{{ .Values.stash_account_address }}"
- name: "STASH_ACCOUNT_ALIAS"
value: "{{ .Values.stash_account_alias }}"
- name: "SLACK_ALERT_CHANNEL"
value: "{{ .Values.slack_alert_channel }}"
- name: "NODE_ENDPOINT"
value: "{{ .Values.node_endpoint }}"
- name: "VOTE_REPO"
value: "{{ .Values.vote_repo }}"
- name: "PROXY_ACCOUNT_ALIAS"
value: "{{ .Values.proxy_account_alias }}"
- name: "CHAIN"
value: "{{ .Values.chain }}"
resources:
limits:
cpu: 0
3 changes: 3 additions & 0 deletions charts/polkadot-votebot/values.yaml
Original file line number Diff line number Diff line change
@@ -21,3 +21,6 @@ cron_schedule: "2 */3 * * *"
# sensitive
proxy_account_mnemonic: "12 word secret seed for your proxy account. it must be registered on-chain as goverenane proxy for your stash. put very little money on it"
slack_alert_token: "the token to connect to slack and send alerts"

skip_gov1: false

64 changes: 40 additions & 24 deletions charts/polkadot/scripts/polkadot-node.sh
Original file line number Diff line number Diff line change
@@ -4,52 +4,68 @@ set -e
set -x

if [ -e /polkadot/k8s_local_node_key ]; then
node_key_param="--node-key-file /polkadot/k8s_local_node_key"
node_key_param="--node-key-file /polkadot/k8s_local_node_key"
fi

if [ -e /polkadot/k8s_local_peer_cmd ]; then
local_peer_param="$(cat /polkadot/k8s_local_peer_cmd)"
local_peer_param="$(cat /polkadot/k8s_local_peer_cmd)"
fi

if [ ! -z "$VALIDATOR_NAME" ]; then
name_param="--name \"$VALIDATOR_NAME\""
name_param="--name \"$VALIDATOR_NAME\""
fi

if [ ! -z "$CHAIN" ]; then
chain_param="--chain \"$CHAIN\""
chain_param="--chain \"$CHAIN\""
fi

if [ ! -z "$IN_PEERS" ]; then
in_peers_param="--in-peers=${IN_PEERS}"
in_peers_param="--in-peers=${IN_PEERS}"
fi

if [ ! -z "$OUT_PEERS" ]; then
out_peers_param="--out-peers=${OUT_PEERS}"
out_peers_param="--out-peers=${OUT_PEERS}"
fi

if [ ! -z "$NO_TELEMETRY" ]; then
no_telemetry_param="--no-telemetry"
fi

if [ ! -z "$TELEMETRY_URL" ]; then
telemetry_url_param="--telemetry-url \"$TELEMETRY_URL 0\""
telemetry_url_param="--telemetry-url \"$TELEMETRY_URL 1\""
fi

if [ ! -z "$PUBLIC_MULTIADDR" ]; then
public_address_param="--public-addr=${PUBLIC_MULTIADDR}"
public_address_param="--public-addr=${PUBLIC_MULTIADDR}"
fi

if [ ! -z "$NO_HARDWARE_BENCHMARKS" ] && [ "$NO_HARDWARE_BENCHMARKS" == "true" ]; then
hw_bench_param="--no-hardware-benchmarks"
fi

if [ "$CHAIN" == "kusama" ]; then
litep2p_param="--network-backend litep2p"
fi

# sleep 1000
eval /usr/bin/polkadot --validator --wasm-execution Compiled \
--pruning=1000 \
--prometheus-external \
--execution native \
--unsafe-ws-external \
--unsafe-rpc-external \
--rpc-methods=Unsafe \
--rpc-cors=all \
--no-hardware-benchmarks \
$out_peers_param \
$in_peers_param \
$node_key_param \
$name_param \
$telemetry_url_param \
$chain_param \
$public_address_param \
$local_peer_param
--base-path=/polkadot/.local/share/polkadot/ \
--state-pruning=256 \
--blocks-pruning=256 \
--prometheus-external \
--unsafe-rpc-external \
--unsafe-force-node-key-generation \
--rpc-methods=Unsafe \
--rpc-cors=all \
$litep2p_param \
$hw_bench_param \
--sync=warp \
$out_peers_param \
$in_peers_param \
$node_key_param \
$name_param \
$telemetry_url_param \
$no_telemetry_param \
$chain_param \
$public_address_param \
$local_peer_param
4 changes: 4 additions & 0 deletions charts/polkadot/templates/configmap.yaml
Original file line number Diff line number Diff line change
@@ -3,12 +3,16 @@ apiVersion: v1
data:
ARCHIVE_URL: "{{ .Values.polkadot_archive_url }}"
TELEMETRY_URL: "{{ .Values.polkadot_telemetry_url }}"
{{- if .Values.no_telemetry }}
NO_TELEMETRY: "true"
{{- end }}
VALIDATOR_NAME: "{{ .Values.polkadot_validator_name }}"
OUT_PEERS: "{{ .Values.number_of_out_peers }}"
IN_PEERS: "{{ .Values.number_of_in_peers }}"
CHAIN: "{{ .Values.chain}}"
NAMESPACE: "{{ .Release.Namespace }}"
PUBLIC_MULTIADDR: "/ip4/{{ .Values.p2p_ip }}/tcp/{{ .Values.p2p_port }}"
NO_HARDWARE_BENCHMARKS: "{{ .Values.no_hardware_benchmarks }}"
kind: ConfigMap
metadata:
name: polkadot-configmap
4 changes: 1 addition & 3 deletions charts/polkadot/templates/services.yaml
Original file line number Diff line number Diff line change
@@ -8,10 +8,8 @@ metadata:
app: polkadot-node
spec:
ports:
- port: 9933
name: rpc
- port: 9944
name: wss
name: rpc
- port: 9615
name: metrics
selector:
5 changes: 4 additions & 1 deletion charts/polkadot/templates/statefulset.yaml
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@ spec:
- |
{{ tpl (.Files.Get "scripts/polkadot-node.sh") . | indent 12 }}
ports:
- containerPort: 9933
- containerPort: 9944
name: dot-rpc-port
- containerPort: 9615
name: metrics
@@ -117,6 +117,9 @@ spec:
name: polkadot-node-pv-claim
spec:
accessModes: [ "ReadWriteOnce" ]
{{- if hasKey .Values "storage_class" }}
storageClassName: {{ .Values.storage_class }}
{{- end }}
resources:
requests:
storage: {{ .Values.vol_size }}Gi
13 changes: 12 additions & 1 deletion charts/polkadot/values.yaml
Original file line number Diff line number Diff line change
@@ -8,10 +8,14 @@ polkadot_k8s_images:
polkadot_sidecar: ghcr.io/midl-dev/polkadot-sidecar:master
polkadot_session_key_check: ghcr.io/midl-dev/polkadot-session-key-check:master

polkadot_archive_url: https://ksm-rocksdb.polkashots.io/snapshot
#polkadot_archive_url:

# customize telemetry url
polkadot_telemetry_url: null

# set to true to not upload any telemetry
no_telemetry: false

polkadot_validator_name: polkadot_k8s_pulumi

number_of_out_peers: 10
@@ -50,6 +54,10 @@ node_selector: {}
# Instead, you must resize the pvc directly.
vol_size: 50

# storage class name
# to specify the storage class for polkadot storage backend volume
# storage_class: my-storage-class

# deploy service monitor?
# only set to true if you have the prometheus operator installed.
# Otherwise, helm installation will fail
@@ -66,3 +74,6 @@ resources:
livenessProbe:
periodSeconds: 30
failureThreshold: 40

#disable hardware benchmarks
no_hardware_benchmarks: "true"
2 changes: 1 addition & 1 deletion polkadot-node-key-configurator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM parity/subkey:2.0.0
FROM parity/subkey:2.0.2
USER root
# install tools and dependencies
RUN apt-get update --allow-insecure-repositories && \
2 changes: 1 addition & 1 deletion polkadot-payout-cron/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-alpine
FROM node:20-alpine

RUN mkdir /home/node/app/ && chown -R node:node /home/node/app

Loading