Skip to content
This repository was archived by the owner on Apr 10, 2026. It is now read-only.

Commit 6a27190

Browse files
authored
Merge PR #999: Add ability to run all paths in config easil
* Add ability to run all paths in config easily * PR review fixes * Fix tests and patch readme
1 parent be7e027 commit 6a27190

2 files changed

Lines changed: 29 additions & 13 deletions

File tree

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,8 @@ Additional information on how IBC works can be found [here](https://ibc.cosmos.n
203203
```shell
204204
$ rly paths list
205205
$ rly start [path]
206+
# Optionally you can omit the `path` argument to start all configured paths
207+
$ rly start
206208
```
207209

208210
You will need to start a separate shell instance for each path you wish to relay over.

cmd/start.go

Lines changed: 27 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
77
You may obtain a copy of the License at
88
9-
http://www.apache.org/licenses/LICENSE-2.0
9+
http://www.apache.org/licenses/LICENSE-2.0
1010
1111
Unless required by applicable law or agreed to in writing, software
1212
distributed under the License is distributed on an "AS IS" BASIS,
@@ -38,25 +38,39 @@ func startCmd(a *appState) *cobra.Command {
3838
Use: "start path_name",
3939
Aliases: []string{"st"},
4040
Short: "Start the listening relayer on a given path",
41-
Args: withUsage(cobra.MinimumNArgs(1)),
41+
Args: withUsage(cobra.MinimumNArgs(0)),
4242
Example: strings.TrimSpace(fmt.Sprintf(`
43-
$ %s start demo-path -p events # to use event processor
43+
$ %s start # start all configured paths
44+
$ %s start demo-path # start the 'demo-path' path
4445
$ %s start demo-path --max-msgs 3
45-
$ %s start demo-path2 --max-tx-size 10`, appName, appName, appName)),
46+
$ %s start demo-path2 --max-tx-size 10`, appName, appName, appName, appName)),
4647
RunE: func(cmd *cobra.Command, args []string) error {
4748
chains := make(map[string]*relayer.Chain)
4849
paths := make([]relayer.NamedPath, len(args))
4950

50-
for i, pathName := range args {
51-
path := a.Config.Paths.MustGet(pathName)
52-
paths[i] = relayer.NamedPath{
53-
Name: pathName,
54-
Path: path,
55-
}
51+
if len(args) > 0 {
52+
for i, pathName := range args {
53+
path := a.Config.Paths.MustGet(pathName)
54+
paths[i] = relayer.NamedPath{
55+
Name: pathName,
56+
Path: path,
57+
}
5658

57-
// collect unique chain IDs
58-
chains[path.Src.ChainID] = nil
59-
chains[path.Dst.ChainID] = nil
59+
// collect unique chain IDs
60+
chains[path.Src.ChainID] = nil
61+
chains[path.Dst.ChainID] = nil
62+
}
63+
} else {
64+
for n, path := range a.Config.Paths {
65+
paths = append(paths, relayer.NamedPath{
66+
Name: n,
67+
Path: path,
68+
})
69+
70+
// collect unique chain IDs
71+
chains[path.Src.ChainID] = nil
72+
chains[path.Dst.ChainID] = nil
73+
}
6074
}
6175

6276
chainIDs := make([]string, 0, len(chains))

0 commit comments

Comments
 (0)