@@ -6,7 +6,7 @@ Licensed under the Apache License, Version 2.0 (the "License");
66you may not use this file except in compliance with the License.
77You 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
1111Unless required by applicable law or agreed to in writing, software
1212distributed 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