示例#1
0
        /// <summary>
        /// Get information witness list
        /// </summary>
        /// <param name="parameters">
        /// Parameter Index
        /// </param>
        /// <returns></returns>
        public static bool ListWitness(string command, string[] parameters)
        {
            string[] usage = new string[] {
                string.Format("{0} [command option] \n", command)
            };

            string[] command_option = new string[] { HelpCommandOption.Help };

            if (parameters != null)
            {
                OutputHelpMessage(usage, null, command_option, null);
                return(true);
            }

            try
            {
                RpcApiResult result = RpcApi.ListWitness(out WitnessList witnesses);
                if (result.Result)
                {
                    Console.WriteLine(PrintUtil.PrintWitnessList(witnesses));
                }

                OutputResultMessage(command, result.Result, result.Code, result.Message);
            }
            catch (System.Exception e)
            {
                Console.WriteLine(e.Message + "\n\n" + e.StackTrace);
            }

            return(true);
        }