Skip to content

Commit

Permalink
feat: allow configuring home dir (#16)
Browse files Browse the repository at this point in the history
  • Loading branch information
helder-moreira authored Mar 25, 2022
1 parent 7bdcccd commit 75c6396
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ shows the available configuration options and respective defaults:
| keyring-backend | KEYRING_BACKEND | keyring backend to be used | |
| legacy-send | LEGACY_SEND | whether to use legacy send command | false |
| coin-type | COIN_TYPE | registered coin type number for HD derivation (BIP-0044) | 118 |
| home | HOME | replaces the default home used by the chain | |
| | | | |

### [gaia](https://github.com/cosmos/gaia) example
Expand Down
5 changes: 5 additions & 0 deletions cmd/faucet/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ var (
nodeAddress string
legacySendCmd bool
coinType string
home string
)

func init() {
Expand Down Expand Up @@ -82,4 +83,8 @@ func init() {
environ.GetString("COIN_TYPE", "118"),
"registered coin type number for HD derivation (BIP-0044), defaults from (satoshilabs/SLIP-0044)",
)
flag.StringVar(&home, "home",
environ.GetString("HOME", ""),
"replaces the default home used by the chain",
)
}
7 changes: 7 additions & 0 deletions cmd/faucet/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ func main() {
chaincmd.WithNodeAddress(nodeAddress),
}

if home != "" {
ccoptions = append(ccoptions, chaincmd.WithHome(home))
}

if legacySendCmd {
ccoptions = append(ccoptions, chaincmd.WithLegacySendCommand())
}
Expand All @@ -48,6 +52,9 @@ func main() {
chaincmd.WithVersion(cosmosver.MaxLaunchpadVersion),
chaincmd.WithLaunchpadCLI(appCli),
)
if home != "" {
ccoptions = append(ccoptions, chaincmd.WithLaunchpadCLIHome(home))
}
default:
ccoptions = append(ccoptions,
chaincmd.WithVersion(cosmosver.Latest),
Expand Down

0 comments on commit 75c6396

Please sign in to comment.