Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
github-merge-queue[bot] committed Jan 21, 2025
1 parent 3d4468d commit c75125f
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
2 changes: 1 addition & 1 deletion charts/sequencer/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ type: application
# 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.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 1.0.1
version: 1.0.2
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
Expand Down
26 changes: 26 additions & 0 deletions charts/sequencer/files/scripts/init-cometbft.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,39 @@ set -o errexit -o nounset

# Only need to configure cometbft data if not already initialized
if [ ! -d "/cometbft/data" ]; then
# Load the snapshot on load if enabled
{{- if .Values.snapshotLoad.enabled }}
echo "Downdloading snapshot..."
rclone config create r2 s3 \
provider={{ .Values.snapshotLoad.config.provider }} \
access_key_id={{ .Values.snapshotLoad.config.accessKeyId }} \
secret_access_key={{ .Values.snapshotLoad.config.secretAccessKey }} \
region={{ .Values.snapshotLoad.config.region }} \
endpoint={{ .Values.snapshotLoad.config.endpoint }} \
acl={{ .Values.snapshotLoad.config.acl }}
rclone copy -P r2:astria-mainnet-snapshots/ /snapshot/

echo "Extracting snapshot..."
mkdir /cometbft/data
mkdir /sequencer/penumbra.db
tar -C /cometbft/data/ --strip-components=2 -xzf /snapshot/cometbft_*.tar.gz cometbft/data
tar -C /sequencer/penumbra.db/ --strip-components=2 -xzf /snapshot/sequencer_*.tar.gz sequencer/penumbra.db
rm /snapshot/cometbft_*.tar.gz /snapshot/sequencer_*.tar.gz
{{- else }}
# Otherwise initialize with basic values
echo "Intializing cometbft with empty data directory..."
cp -LR /data/ /cometbft/data
{{- end }}
else
echo "CometBFT data directory already initialized"
fi

# Don't replace the config directory if it already exists
if [ ! -d "/cometbft/config" ]; then
echo "Creating Config Directory..."
cp -LR /config/ /cometbft/config
else
echo "Updating config directory..."
cp /config/* /cometbft/config/
fi

Expand Down
6 changes: 6 additions & 0 deletions charts/sequencer/templates/statefulsets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@ spec:
- mountPath: /cometbft
name: sequencer-shared-storage-vol
subPath: {{ .Values.moniker }}/cometbft
- mountPath: /sequencer
name: sequencer-shared-storage-vol
subPath: {{ .Values.moniker }}/sequencer
- mountPath: /snapshot
name: sequencer-shared-storage-vol
subPath: {{ .Values.moniker }}/snapshot
containers:
- name: sequencer
image: {{ include "sequencer.image" . }}
Expand Down
14 changes: 12 additions & 2 deletions charts/sequencer/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,22 @@ global:
useTTY: true
dev: false

snapshotLoad:
enabled: false
config:
provider: Cloudflare
accessKeyId: 0d8d8005e468dd86498bde6dfa02044f
secretAccessKey: e33ea43e00d9b655cb72d8a8107fa2957bd6b77e5718df0a26f259956532bba8
region: auto
endpoint: https://fb1caa337c8e4e3101363ca1240e03ca.r2.cloudflarestorage.com
acl: private

# sequencer core images
images:
init:
repo: ghcr.io/tomwright/dasel
repo: rclone/rclone
pullPolicy: IfNotPresent
tag: alpine
tag: 1.56.0
cometBFT:
repo: docker.io/cometbft/cometbft
pullPolicy: IfNotPresent
Expand Down

0 comments on commit c75125f

Please sign in to comment.