コード例 #1
0
        public void Start()
        {
            Console.Clear();
            ConsoleWriter.PrintTitle();
            ConsoleWriter.PrintMenuHeader("Setup Pangaea Node - Keys ready?");
            Console.WriteLine(string.Empty);
            Console.WriteLine("Its mostly automate step 1 in the tutorial described here");
            Console.WriteLine("https://docs.harmony.one/pangaea/setup-your-node-and-connect-to-pangaea/node-setup/advanced-users/vultr");
            Console.WriteLine(string.Empty);
            Console.WriteLine("You should have received an email with information about your Pangaea key.");
            Console.WriteLine(string.Empty);
            ConsoleWriter.PrintRow();
            var ignore = Prompt.GetString("Press any key to continue?");

            Console.Clear();
            MigratingKey();
            //enable the foundation node
            TerraformConfigFile.SetValue("harmony_pangaea_count", "1");
            Console.Clear();
            ConsoleWriter.PrintTitle();
            ConsoleWriter.PrintMenuHeader("Setup Pangaea Node - Done");
            Console.WriteLine(string.Empty);
            Console.WriteLine($"The configuration is ready, next step is to choose \"{MenuBuilder.Apply.Description}\" in the Main Menu to generate the Node.");
            Console.WriteLine(string.Empty);
            ConsoleWriter.PrintRow();
            Prompt.GetString("Press any key to return the the Main menu");
        }
コード例 #2
0
        public void Start()
        {
            Console.Clear();
            ConsoleWriter.PrintTitle();
            ConsoleWriter.PrintMenuHeader("Change Vultr Api Key");
            Console.WriteLine(string.Empty);
            Console.WriteLine("To be able to create the required infrastructure you need to supply an access token.");
            Console.WriteLine($"Your current Vultr Api Key = {TerraformConfigFile.GetValue("vultr_api_key")}");
            Console.WriteLine(string.Empty);
            Console.WriteLine("Your personal token can be found here: https://my.vultr.com/settings/#settingsapi");
            Console.WriteLine("1. Click on the 'Enable the Vultr API' button ");
            Console.WriteLine("2. Locate the 'Access Control Area' to whitelist your IP or click 'Allow All IPv4?'");
            Console.WriteLine("3. Copy your Personal Access Token");
            Console.WriteLine(string.Empty);


            ConsoleWriter.PrintRow();

            var value = Prompt.GetString("Please enter your Vultr Personal Access Token:");

            while (value.Length < 10)
            {
                Console.WriteLine($"{value} is not valid, if unsure the key can be generated here https://my.vultr.com/settings/#settingsapi");
                value = Prompt.GetString("Please enter your Vultr Personal Access Token:");
            }

            TerraformConfigFile.SetValue("vultr_api_key", value);
        }
コード例 #3
0
        public static void EnsureVultApiSetting()
        {
            ConsoleWriter.PrintMenuHeader("Vultr Api key");
            Colors.WriteLine($"[vultr_api_key] Checking Vultr Api key".Yellow());
            var value = TerraformConfigFile.GetValue("vultr_api_key");

            if (value.Length < 10)
            {
                Colors.WriteLine($"[vultr_api_key] Missing Vultr Api key".Red());
                Console.WriteLine(string.Empty);
                Console.WriteLine("To be able to create the required infrastructure you need to supply an access token.");
                Console.WriteLine("Your personal token can be found here: https://my.vultr.com/settings/#settingsapi");
                Console.WriteLine("1. Click on the 'Enable the Vultr API' button ");
                Console.WriteLine("2. Locate the 'Access Control Area' to whitelist your IP or click 'Allow All IPv4?'");
                Console.WriteLine("3. Copy your Personal Access Token");

                value = Prompt.GetString("Please enter your Vultr Personal Access Token:");
                while (value.Length < 10)
                {
                    Console.WriteLine($"{value} is not valid, if unsure the key can be generated here https://my.vultr.com/settings/#settingsapi");
                    value = Prompt.GetString("Please enter your Vultr Personal Access Token:");
                }

                TerraformConfigFile.SetValue("vultr_api_key", value);
            }
            Colors.WriteLine($"[vultr_api_key] Vultr Api Key found".Green());
        }
コード例 #4
0
 public void Start()
 {
     Console.Clear();
     ConsoleWriter.PrintTitle();
     ConsoleWriter.PrintMenuHeader("Setup Foundation Node - Keys ready?");
     Console.WriteLine(string.Empty);
     Console.WriteLine("This tool mostly automate step 1 and 2 described here");
     Console.WriteLine("https://nodes.harmony.one/foundational-node-playbook/setting-up-your-node/vultr-setup");
     Console.WriteLine(string.Empty);
     Console.WriteLine("It's possible you already got the Harmony valid available and don't need to generate them, for example when you are migrating the Node. Then please copy them from your current node or backup.");
     Console.WriteLine(string.Empty);
     ConsoleWriter.PrintRow();
     if (Prompt.GetYesNo("Did you already generate the Harmony keys for the Node?", false))
     {
         Console.Clear();
         MigratingKey();
     }
     else
     {
         Console.Clear();
         ConsoleWriter.PrintTitle();
         ConsoleWriter.PrintMenuHeader("Setup Foundation Node - Generating keys");
         Console.WriteLine(string.Empty);
         Console.WriteLine("Since you already don't got the key we will need to generate new keys.");
         Console.WriteLine("This step will generate your new Harmony keys in the data/harmony-keys/ directory");
         Console.WriteLine(string.Empty);
         Prompt.GetString("Press any key to start the generation of the Harmony Foundation Node keys");
         GenerateHarmonyKeys();
         Console.WriteLine(string.Empty);
         Console.WriteLine("Backup the keys found in /data/harmony-keys and follow the guide here");
         Console.WriteLine("https://nodes.harmony.one/foundational-node-playbook/setting-up-your-node/vultr-setup");
         Console.WriteLine("...starting from the sentence \"Create a BLS key pair with...\" so you know what they are and what to do with them");
         Console.WriteLine(string.Empty);
         ConsoleWriter.PrintRow();
         Prompt.GetYesNo("Before proceed, confirm that you back upped your new keys and read about the email to [email protected]?", false);
     }
     //enable the foundation node
     TerraformConfigFile.SetValue("harmony_mainnet_count", "1");
     Console.Clear();
     ConsoleWriter.PrintTitle();
     ConsoleWriter.PrintMenuHeader("Setup Foundation Node - Done");
     Console.WriteLine(string.Empty);
     Console.WriteLine($"The configuration is ready, next step is to choose \"{MenuBuilder.Apply.Description}\" in the Main Menu to generate the Node.");
     Console.WriteLine(string.Empty);
     ConsoleWriter.PrintRow();
     Prompt.GetString("Press any key to return the the Main menu");
 }