Skip to content

Commit

Permalink
Merge branch 'main' into feat/new_staking_params
Browse files Browse the repository at this point in the history
  • Loading branch information
vimystic authored Sep 10, 2023
2 parents 5bb21ae + 256544c commit c3299af
Show file tree
Hide file tree
Showing 21 changed files with 381 additions and 220 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/interchaintest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,4 +152,8 @@ jobs:
${{ runner.os }}-go-
- name: interchaintest
run: make interchaintest-scenario
run: make interchaintest-scenario

- name: Prune Docker images
if: always() #ensure dangling images are pruned after interchain-test scenario passes or fails
run: docker image prune -f
14 changes: 5 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,18 +112,14 @@ Additional information on how IBC works can be found [here](https://ibc.cosmos.n
$ rly keys restore osmosis [key-name] "mnemonic words here"
```
5. **Edit the relayer's `key` values in the config file to match the `key-name`'s chosen above.**
5. **Use the `key-name` created above.**
>This step is necessary if you chose a `key-name` other than "default"
Example:
```yaml
- type: cosmos
value:
key: YOUR-KEY-NAME-HERE
chain-id: cosmoshub-4
rpc-addr: http://localhost:26657
```
```shell
$ rly keys use cosmoshub [key-name]
$ rly keys use osmosis [key-name]
```
6. **Ensure the keys associated with the configured chains are funded.**
Expand Down
31 changes: 31 additions & 0 deletions cmd/appstate.go
Original file line number Diff line number Diff line change
Expand Up @@ -251,3 +251,34 @@ func (a *appState) updatePathConfig(
return nil
})
}

func (a *appState) useKey(chainName, key string) error {

chain, exists := a.config.Chains[chainName]
if !exists {
return fmt.Errorf("chain %s not found in config", chainName)
}

cc := chain.ChainProvider

info, err := cc.ListAddresses()
if err != nil {
return err
}
value, exists := info[key]
currentValue := a.config.Chains[chainName].ChainProvider.Key()

if currentValue == key {
return fmt.Errorf("config is already using %s -> %s for %s", key, value, cc.ChainName())
}

if exists {
fmt.Printf("Config will now use %s -> %s for %s\n", key, value, cc.ChainName())
} else {
return fmt.Errorf("key %s does not exist for chain %s", key, cc.ChainName())
}
return a.performConfigLockingOperation(context.Background(), func() error {
a.config.Chains[chainName].ChainProvider.UseKey(key)
return nil
})
}
4 changes: 2 additions & 2 deletions cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,8 @@ func UnmarshalJSONProviderConfig(data []byte, customTypes map[string]reflect.Typ
}

typeName, ok := m["type"].(string)
if !ok {
return nil, errors.New("cannot find type");
if !ok {
return nil, errors.New("cannot find type")
}

var provCfg provider.ProviderConfig
Expand Down
17 changes: 17 additions & 0 deletions cmd/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ func keysCmd(a *appState) *cobra.Command {

cmd.AddCommand(
keysAddCmd(a),
keysUseCmd(a),
keysRestoreCmd(a),
keysDeleteCmd(a),
keysListCmd(a),
Expand All @@ -55,6 +56,22 @@ func keysCmd(a *appState) *cobra.Command {
return cmd
}

func keysUseCmd(a *appState) *cobra.Command {

cmd := &cobra.Command{
Use: "use chain_name key_name",
Aliases: []string{"u"},
Short: "Use a key from the keychain associated with a particular chain. Run 'rly keys list ibc-0' to view available keys",
Args: withUsage(cobra.ExactArgs(2)),
Example: strings.TrimSpace(fmt.Sprintf(`
$ %s keys use ibc-0 key_name`, appName)),
RunE: func(cmd *cobra.Command, args []string) error {
return a.useKey(args[0], args[1])
},
}
return cmd
}

// keysAddCmd respresents the `keys add` command
func keysAddCmd(a *appState) *cobra.Command {
cmd := &cobra.Command{
Expand Down
64 changes: 37 additions & 27 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,18 @@ go 1.20

require (
cosmossdk.io/api v0.3.1
cosmossdk.io/errors v1.0.0-beta.7
cosmossdk.io/math v1.0.1
cosmossdk.io/errors v1.0.0
cosmossdk.io/math v1.1.2
github.com/avast/retry-go/v4 v4.3.2
github.com/btcsuite/btcd v0.23.4
github.com/btcsuite/btcd/btcutil v1.1.3
github.com/cometbft/cometbft v0.37.2
github.com/cosmos/cosmos-proto v1.0.0-beta.2
github.com/cosmos/cosmos-sdk v0.47.3
github.com/cosmos/cosmos-sdk v0.47.5
github.com/cosmos/go-bip39 v1.0.0
github.com/cosmos/gogoproto v1.4.10
github.com/cosmos/ibc-go/v7 v7.2.0
github.com/cosmos/ibc-go/modules/capability v1.0.0-rc1
github.com/cosmos/ibc-go/v7 v7.3.0
github.com/cosmos/ics23/go v0.10.0
github.com/ethereum/go-ethereum v1.10.26
github.com/gofrs/flock v0.8.1
Expand All @@ -29,23 +30,23 @@ require (
github.com/tyler-smith/go-bip39 v1.1.0
go.uber.org/multierr v1.8.0
go.uber.org/zap v1.24.0
golang.org/x/mod v0.8.0
golang.org/x/sync v0.1.0
golang.org/x/text v0.9.0
google.golang.org/grpc v1.55.0
golang.org/x/mod v0.11.0
golang.org/x/sync v0.2.0
golang.org/x/text v0.12.0
google.golang.org/grpc v1.56.2
gopkg.in/yaml.v2 v2.4.0
gopkg.in/yaml.v3 v3.0.1
)

require (
cloud.google.com/go v0.110.0 // indirect
cloud.google.com/go/compute v1.19.0 // indirect
cloud.google.com/go v0.110.4 // indirect
cloud.google.com/go/compute v1.20.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v0.13.0 // indirect
cloud.google.com/go/storage v1.29.0 // indirect
cloud.google.com/go/iam v1.1.0 // indirect
cloud.google.com/go/storage v1.30.1 // indirect
cosmossdk.io/core v0.5.1 // indirect
cosmossdk.io/depinject v1.0.0-alpha.3 // indirect
cosmossdk.io/log v1.1.0 // indirect
cosmossdk.io/depinject v1.0.0-alpha.4 // indirect
cosmossdk.io/log v1.2.1 // indirect
cosmossdk.io/tools/rosetta v0.2.1 // indirect
filippo.io/edwards25519 v1.0.0 // indirect
github.com/99designs/go-keychain v0.0.0-20191008050251-8e49817e8af4 // indirect
Expand All @@ -63,6 +64,9 @@ require (
github.com/cespare/xxhash v1.1.0 // indirect
github.com/cespare/xxhash/v2 v2.2.0 // indirect
github.com/chzyer/readline v1.5.1 // indirect
github.com/cockroachdb/errors v1.10.0 // indirect
github.com/cockroachdb/logtags v0.0.0-20230118201751-21c54148d20b // indirect
github.com/cockroachdb/redact v1.1.5 // indirect
github.com/coinbase/rosetta-sdk-go/types v1.0.0 // indirect
github.com/cometbft/cometbft-db v0.8.0 // indirect
github.com/confio/ics23/go v0.9.0 // indirect
Expand All @@ -83,6 +87,7 @@ require (
github.com/dvsekhvalnov/jose2go v1.5.0 // indirect
github.com/felixge/httpsnoop v1.0.2 // indirect
github.com/fsnotify/fsnotify v1.6.0 // indirect
github.com/getsentry/sentry-go v0.23.0 // indirect
github.com/go-kit/kit v0.12.0 // indirect
github.com/go-kit/log v0.2.1 // indirect
github.com/go-logfmt/logfmt v0.6.0 // indirect
Expand All @@ -98,10 +103,10 @@ require (
github.com/google/btree v1.1.2 // indirect
github.com/google/go-querystring v1.1.0 // indirect
github.com/google/orderedcode v0.0.1 // indirect
github.com/google/s2a-go v0.1.3 // indirect
github.com/google/s2a-go v0.1.4 // indirect
github.com/google/uuid v1.3.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.2.3 // indirect
github.com/googleapis/gax-go/v2 v2.8.0 // indirect
github.com/googleapis/gax-go/v2 v2.11.0 // indirect
github.com/gorilla/handlers v1.5.1 // indirect
github.com/gorilla/mux v1.8.0 // indirect
github.com/gorilla/websocket v1.5.0 // indirect
Expand All @@ -124,13 +129,15 @@ require (
github.com/jmespath/go-jmespath v0.4.0 // indirect
github.com/jmhodges/levigo v1.0.0 // indirect
github.com/klauspost/compress v1.16.3 // indirect
github.com/kr/pretty v0.3.1 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/lib/pq v1.10.7 // indirect
github.com/libp2p/go-buffer-pool v0.1.0 // indirect
github.com/linxGnu/grocksdb v1.7.16 // indirect
github.com/magiconair/properties v1.8.7 // indirect
github.com/manifoldco/promptui v0.9.0 // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.18 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-runewidth v0.0.13 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/mimoo/StrobeGo v0.0.0-20210601165009-122bf33a46e0 // indirect
Expand All @@ -148,8 +155,9 @@ require (
github.com/prometheus/procfs v0.9.0 // indirect
github.com/rakyll/statik v0.1.7 // indirect
github.com/rcrowley/go-metrics v0.0.0-20201227073835-cf1acfcdf475 // indirect
github.com/rogpeppe/go-internal v1.11.0 // indirect
github.com/rs/cors v1.8.3 // indirect
github.com/rs/zerolog v1.29.1 // indirect
github.com/rs/zerolog v1.30.0 // indirect
github.com/sasha-s/go-deadlock v0.3.1 // indirect
github.com/spf13/afero v1.9.5 // indirect
github.com/spf13/cast v1.5.1 // indirect
Expand All @@ -166,17 +174,19 @@ require (
go.etcd.io/bbolt v1.3.7 // indirect
go.opencensus.io v0.24.0 // indirect
go.uber.org/atomic v1.10.0 // indirect
golang.org/x/crypto v0.9.0 // indirect
golang.org/x/exp v0.0.0-20230515195305-f3d0a9c9a5cc // indirect
golang.org/x/net v0.10.0 // indirect
golang.org/x/oauth2 v0.7.0 // indirect
golang.org/x/sys v0.8.0 // indirect
golang.org/x/term v0.8.0 // indirect
golang.org/x/crypto v0.11.0 // indirect
golang.org/x/exp v0.0.0-20230711153332-06a737ee72cb // indirect
golang.org/x/net v0.12.0 // indirect
golang.org/x/oauth2 v0.8.0 // indirect
golang.org/x/sys v0.11.0 // indirect
golang.org/x/term v0.10.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
google.golang.org/api v0.122.0 // indirect
google.golang.org/api v0.126.0 // indirect
google.golang.org/appengine v1.6.7 // indirect
google.golang.org/genproto v0.0.0-20230410155749-daa745c078e1 // indirect
google.golang.org/protobuf v1.30.0 // indirect
google.golang.org/genproto v0.0.0-20230706204954-ccb25ca9f130 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20230629202037-9506855d4529 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230711160842-782d3b101e98 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
nhooyr.io/websocket v1.8.6 // indirect
pgregory.net/rapid v0.5.5 // indirect
Expand Down
Loading

0 comments on commit c3299af

Please sign in to comment.