Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: generate yaml from yaml #291

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from
Draft
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
more work
Anmol1696 committed Oct 23, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit f77aaa9afc55bdb74fc87491294c1f95dee30cd8
8 changes: 7 additions & 1 deletion pkg/loader/starship/chain.go
Original file line number Diff line number Diff line change
@@ -46,13 +46,19 @@ func getGenesisInits(chainConfig types.Chain) ([]types.Init, error) {
{"CHAIN_ID", chainConfig.GetChainID()},
}

// add faucet environment vars
faucetEnv := types.EnvVar{"FUACET_ENABLED", "false"}
if chainConfig.Faucet.Enabled {
faucetEnv.Value = "true"
}

envs = append(envs, faucetEnv)

// add timeout envrionment vars
for key, value := range chainConfig.Timeouts {
envs = append(envs, types.EnvVar{strings.ToUpper(key), value})
}
// todo: here

genesisInit := types.Init{
Name: "init-genesis",
Image: chainConfig.Image,
7 changes: 4 additions & 3 deletions pkg/types/config.go
Original file line number Diff line number Diff line change
@@ -22,9 +22,10 @@ type Chain struct {
CoinType string `name:"coin-type" json:"coin_type,omitempty" yaml:"coinType,omitempty"`
Repo string `name:"repo" json:"repo,omitempty" yaml:"repo,omitempty"`
// Custom modifications
Scripts map[string]ScriptData `name:"scripts" json:"scripts,omitempty" yaml:"scripts"`
Upgrade Upgrade `name:"upgrade" json:"upgrade,omitempty" yaml:"upgrade"`
Genesis map[string]interface{} `name:"genesis" json:"genesis,omitempty" yaml:"genesis"`
Scripts map[string]ScriptData `name:"scripts" json:"scripts,omitempty" yaml:"scripts"`
Upgrade Upgrade `name:"upgrade" json:"upgrade,omitempty" yaml:"upgrade"`
Genesis map[string]interface{} `name:"genesis" json:"genesis,omitempty" yaml:"genesis"`
Timeouts map[string]string `name:"timeouts" json:"timeouts,omitempty" yaml:"timeouts"`
// Feature toggles
Build Build `name:"build" json:"build,omitempty" yaml:"build,omitempty"`
Cometmock *Feature `name:"cometmock" json:"cometmock,omitempty" yaml:"cometmock,omitempty"`