@@ -78,6 +78,9 @@ func GetAPIInfo(ctx *cli.Context, t lotus_repo.RepoType) (APIInfo, error) {
78
78
strma := ctx .String (f )
79
79
strma = strings .TrimSpace (strma )
80
80
81
+ if IsVeryVerbose {
82
+ _ , _ = fmt .Fprintf (ctx .App .Writer , "extracted API endpoint %s from API flag %s\n " , strma , f )
83
+ }
81
84
return APIInfo {Addr : strma }, nil
82
85
}
83
86
@@ -88,14 +91,22 @@ func GetAPIInfo(ctx *cli.Context, t lotus_repo.RepoType) (APIInfo, error) {
88
91
primaryEnv , fallbacksEnvs , deprecatedEnvs := EnvsForAPIInfos (t )
89
92
env , ok := os .LookupEnv (primaryEnv )
90
93
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
+ }
91
98
return ParseApiInfo (env ), nil
92
99
}
93
100
94
101
for _ , env := range deprecatedEnvs {
95
- env , ok := os .LookupEnv (env )
102
+ envVal , ok := os .LookupEnv (env )
96
103
if ok {
97
104
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
99
110
}
100
111
}
101
112
@@ -136,16 +147,24 @@ func GetAPIInfo(ctx *cli.Context, t lotus_repo.RepoType) (APIInfo, error) {
136
147
log .Warnf ("Couldn't load CLI token, capabilities may be limited: %v" , err )
137
148
}
138
149
150
+ if IsVeryVerbose {
151
+ _ , _ = fmt .Fprintf (ctx .App .Writer , "extracted API endpoint %s from repo flag %s\n " , ma , f )
152
+ }
153
+
139
154
return APIInfo {
140
155
Addr : ma .String (),
141
156
Token : token ,
142
157
}, nil
143
158
}
144
159
145
160
for _ , env := range fallbacksEnvs {
146
- env , ok := os .LookupEnv (env )
161
+ envVal , ok := os .LookupEnv (env )
147
162
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
149
168
}
150
169
}
151
170
@@ -180,7 +199,7 @@ func GetBoostAPI(ctx *cli.Context, opts ...GetBoostOption) (api.Boost, jsonrpc.C
180
199
if options .PreferHttp {
181
200
u , err := url .Parse (addr )
182
201
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 )
184
203
}
185
204
186
205
switch u .Scheme {
@@ -194,7 +213,7 @@ func GetBoostAPI(ctx *cli.Context, opts ...GetBoostOption) (api.Boost, jsonrpc.C
194
213
}
195
214
196
215
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 )
198
217
}
199
218
200
219
return client .NewBoostRPCV0 (ctx .Context , addr , headers )
0 commit comments