cosmology-tech / starship

A k8s based unified development environment for Cosmos Ecosystem (and beyond)
https://docs.cosmology.zone/starship
MIT License
72 stars 25 forks source link

feature: add default setup scripts to be chain specific #273

Closed Anmol1696 closed 1 year ago

Anmol1696 commented 1 year ago

Overview

By default we should be able to support custom chain scripts.

Proposal

All the components to make this happen already exist. In default.yaml

chain:
- neutron:
  ...
  scripts:
    <define chain specific scripts>

Note: this will start increasing the size of of the helm charts produced, but is a nice feature to have for custom support.

Implementation

Support for:

Anmol1696 commented 1 year ago

Design

Chain specific scripts with dir

chains/devnets/
  scripts/
    default/
      build-chain.sh
      create-validator.sh
      update-config.sh
      create-genesis.sh
      transfer-tokens.sh
      update-genesis.sh
    <type>/

This will start to increase the number of files.

In the defaults.yaml

defaultChains:
  - name: cosmos
    scripts:
      createGenesis:
        file: scripts/default/create-custom-genesis.sh
      updateGenesis:
        file: scripts/default/update-custom-genesis.sh
      updateConfig:
        file: scripts/default/update-custom-config.sh
      createValidator:
        file: scripts/default/create-custom-validator.sh
      transferTokens:
        file: scripts/default/transfer-custom-tokens.sh
  - name: neutron
    scripts:
      createGenesis:
        file: scripts/neutron/create-custom-genesis.sh
      updateGenesis:
        file: scripts/neutron/update-custom-genesis.sh
      updateConfig:
        file: scripts/neutron/update-custom-config.sh
      createValidator:
        file: scripts/neutron/create-custom-validator.sh
      transferTokens:
        file: scripts/neutron/transfer-custom-tokens.sh

Alternative

Type of script can be derived from type of script.