@@ -78,6 +78,9 @@ func GetAPIInfo(ctx *cli.Context, t lotus_repo.RepoType) (APIInfo, error) {
7878 strma := ctx .String (f )
7979 strma = strings .TrimSpace (strma )
8080
81+ if IsVeryVerbose {
82+ _ , _ = fmt .Fprintf (ctx .App .Writer , "extracted API endpoint %s from API flag %s\n " , strma , f )
83+ }
8184 return APIInfo {Addr : strma }, nil
8285 }
8386
@@ -88,14 +91,22 @@ func GetAPIInfo(ctx *cli.Context, t lotus_repo.RepoType) (APIInfo, error) {
8891 primaryEnv , fallbacksEnvs , deprecatedEnvs := EnvsForAPIInfos (t )
8992 env , ok := os .LookupEnv (primaryEnv )
9093 if ok {
94+ if IsVeryVerbose {
95+ _ , _ = fmt .Fprintf (ctx .App .Writer ,
96+ "extracted API endpoint %s from primary environment variable %s\n " , env , primaryEnv )
97+ }
9198 return ParseApiInfo (env ), nil
9299 }
93100
94101 for _ , env := range deprecatedEnvs {
95- env , ok := os .LookupEnv (env )
102+ envVal , ok := os .LookupEnv (env )
96103 if ok {
97104 log .Warnf ("Using deprecated env(%s) value, please use env(%s) instead." , env , primaryEnv )
98- return ParseApiInfo (env ), nil
105+ if IsVeryVerbose {
106+ _ , _ = fmt .Fprintf (ctx .App .Writer ,
107+ "extracted API endpoint %s from deprecated environment variable %s\n " , envVal , env )
108+ }
109+ return ParseApiInfo (envVal ), nil
99110 }
100111 }
101112
@@ -136,16 +147,24 @@ func GetAPIInfo(ctx *cli.Context, t lotus_repo.RepoType) (APIInfo, error) {
136147 log .Warnf ("Couldn't load CLI token, capabilities may be limited: %v" , err )
137148 }
138149
150+ if IsVeryVerbose {
151+ _ , _ = fmt .Fprintf (ctx .App .Writer , "extracted API endpoint %s from repo flag %s\n " , ma , f )
152+ }
153+
139154 return APIInfo {
140155 Addr : ma .String (),
141156 Token : token ,
142157 }, nil
143158 }
144159
145160 for _ , env := range fallbacksEnvs {
146- env , ok := os .LookupEnv (env )
161+ envVal , ok := os .LookupEnv (env )
147162 if ok {
148- return ParseApiInfo (env ), nil
163+ if IsVeryVerbose {
164+ _ , _ = fmt .Fprintf (ctx .App .Writer ,
165+ "extracted API endpoint %s from fallback environment variable %s\n " , envVal , env )
166+ }
167+ return ParseApiInfo (envVal ), nil
149168 }
150169 }
151170
@@ -180,7 +199,7 @@ func GetBoostAPI(ctx *cli.Context, opts ...GetBoostOption) (api.Boost, jsonrpc.C
180199 if options .PreferHttp {
181200 u , err := url .Parse (addr )
182201 if err != nil {
183- return nil , nil , fmt .Errorf ("parsing miner api URL: %w" , err )
202+ return nil , nil , fmt .Errorf ("parsing Boost API URL: %w" , err )
184203 }
185204
186205 switch u .Scheme {
@@ -194,7 +213,7 @@ func GetBoostAPI(ctx *cli.Context, opts ...GetBoostOption) (api.Boost, jsonrpc.C
194213 }
195214
196215 if IsVeryVerbose {
197- _ , _ = fmt .Fprintln (ctx .App .Writer , "using miner API v0 endpoint:" , addr )
216+ _ , _ = fmt .Fprintln (ctx .App .Writer , "using Boost API endpoint:" , addr )
198217 }
199218
200219 return client .NewBoostRPCV0 (ctx .Context , addr , headers )
0 commit comments