MCPcopy Create free account
hub / github.com/CPChain/chain / showConfigs

Function showConfigs

tools/contract-admin/network/cmd_network.go:140–182  ·  view source on GitHub ↗
(ctx *cli.Context)

Source from the content-addressed store, hash-verified

138}
139
140func showConfigs(ctx *cli.Context) error {
141 ntw, _, _, err := createContractInstanceAndTransactor(ctx, false)
142 if err != nil {
143 return err
144 }
145
146 host, err := ntw.Host(nil)
147 if err != nil {
148 log.Info("Failed to get host", "err", err)
149 return err
150 }
151 log.Info("host", "value", host)
152
153 count, err := ntw.Count(nil)
154 if err != nil {
155 log.Info("Failed to get count", "err", err)
156 return err
157 }
158 log.Info("count", "value", count.Int64())
159
160 timeout, err := ntw.Timeout(nil)
161 if err != nil {
162 log.Info("Failed to get timeout", "err", err)
163 return err
164 }
165 log.Info("timeout", "value", timeout.Int64())
166
167 gap, err := ntw.Gap(nil)
168 if err != nil {
169 log.Info("Failed to get gap", "err", err)
170 return err
171 }
172 log.Info("gap", "value", gap.Int64())
173
174 open, err := ntw.Open(nil)
175 if err != nil {
176 log.Info("Failed to get open", "err", err)
177 return err
178 }
179 log.Info("open", "value", open)
180
181 return nil
182}
183
184func createContractInstanceAndTransactor(ctx *cli.Context, withTransactor bool) (contract *network.Network, opts *bind.TransactOpts, client *cpclient.Client, err error) {
185 contractAddr, client, key, err := utils.PrepareAll(ctx, withTransactor)

Callers

nothing calls this directly

Calls 8

Int64Method · 0.80
InfoMethod · 0.65
OpenMethod · 0.65
HostMethod · 0.45
CountMethod · 0.45
TimeoutMethod · 0.45
GapMethod · 0.45

Tested by

no test coverage detected