| 138 | } |
| 139 | |
| 140 | func 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 | |
| 184 | func 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) |