(cmd *cobra.Command)
| 167 | } |
| 168 | |
| 169 | func getConn(cmd *cobra.Command) *grpc.ClientConn { |
| 170 | server := common.GetServerInfo(cmd) |
| 171 | orgID := common.GetORGID(cmd) |
| 172 | paramData.RpcIP = server.IP |
| 173 | paramData.RpcPort = strconv.Itoa(int(server.RpcPort)) |
| 174 | paramData.OrgID = uint32(orgID) |
| 175 | addr := net.JoinHostPort(paramData.RpcIP, paramData.RpcPort) |
| 176 | conn, err := grpc.Dial(addr, grpc.WithInsecure(), grpc.WithMaxMsgSize(1024*1024*200)) |
| 177 | if err != nil { |
| 178 | fmt.Println(err) |
| 179 | return nil |
| 180 | } |
| 181 | |
| 182 | return conn |
| 183 | } |
| 184 | |
| 185 | func initCmd(cmd *cobra.Command, cmds []CmdExecute) { |
| 186 | conn := getConn(cmd) |
no test coverage detected