Esempio n. 1
0
    def get(self):
        try:
            configuration_file = RaidenConfigurationFile.get_available_configurations(
            ).pop()
        except IndexError:
            configuration_file = None

        self.render("index.html", configuration_file=configuration_file)
Esempio n. 2
0
    def get(self):
        try:
            configuration_file = RaidenConfigurationFile.get_available_configurations(
                self.installer_settings).pop()
        except IndexError:
            configuration_file = None

        self.render("home.html", configuration_file=configuration_file)
Esempio n. 3
0
def run_action_configuration_list():
    print(
        "\nAvailable setups (Not necessarily satisfying conditions for running raiden)\n"
    )
    for config in RaidenConfigurationFile.get_available_configurations():
        print("\t", pretty_print_configuration(config))

    print("\n")
    return main_prompt()
Esempio n. 4
0
    def get(self):
        try:
            configuration_file = [
                rc for rc in
                RaidenConfigurationFile.get_available_configurations()
                if rc.network.name == DEFAULT_NETWORK.name
            ].pop()
        except IndexError:
            configuration_file = None

        self.render("index.html", configuration_file=configuration_file)
Esempio n. 5
0
    def get(self):
        if not self.installer_settings.network == "mainnet":
            try:
                configuration_file = RaidenConfigurationFile.get_available_configurations(
                    self.installer_settings).pop()
            except IndexError:
                configuration_file = None

            self.render("home.html", configuration_file=configuration_file)

        self.render("index.html")
Esempio n. 6
0
def run_action_launch_raiden():
    selected_setup = prompt([
        {
            "name":
            "configuration",
            "type":
            "list",
            "message":
            Messages.input_launch_configuration,
            "choices":
            [{
                "name": f"{pretty_print_configuration(cfg)}",
                "value": cfg
            }
             for cfg in RaidenConfigurationFile.get_available_configurations()
             ],
        },
        {
            "name":
            "raiden",
            "type":
            "list",
            "message":
            Messages.input_launch_release,
            "choices": [{
                "name": raiden.release,
                "value": raiden
            } for raiden in RELEASE_MAP.values()],
        },
    ])

    raiden = selected_setup["raiden"]
    configuration = selected_setup["configuration"]

    print("Launching raiden...")
    raiden.launch(configuration)
    print("Launch successful...")
Esempio n. 7
0
def main_prompt():

    configuration_choices = [Messages.action_configuration_setup]
    account_choices = [Messages.action_account_create]
    raiden_release_management_choices = [Messages.action_release_manager]

    if RaidenConfigurationFile.get_available_configurations():
        configuration_choices.insert(0, Messages.action_launch_raiden)
        configuration_choices.append(Messages.action_configuration_list)

    if Account.get_user_accounts():
        account_choices.append(Messages.action_account_list)
        account_choices.append(Messages.action_account_fund)
        account_choices.append(Messages.action_swap_kyber)

    available_choices = configuration_choices + account_choices + raiden_release_management_choices

    available_choices.append(Messages.action_quit)

    return {
        "type": "list",
        "message": "What would you like to do?",
        "choices": available_choices
    }
Esempio n. 8
0
 def tearDown(self):
     for config in RaidenConfigurationFile.get_available_configurations():
         config.passphrase_file_path.unlink()
         config.path.unlink()
Esempio n. 9
0
 def test_can_create_configuration(self):
     self.configuration_file.save()
     all_configs = RaidenConfigurationFile.get_available_configurations()
     self.assertEqual(len(all_configs), 1)
Esempio n. 10
0
 def tearDown(self):
     for config in RaidenConfigurationFile.get_available_configurations(
             self.settings):
         config.path.unlink()
     self.account.keystore_file_path.unlink()
Esempio n. 11
0
 def test_cannot_get_config_for_different_settings(self):
     self.configuration_file.save()
     settings = load_settings("mainnet")
     all_configs = RaidenConfigurationFile.get_available_configurations(
         settings)
     self.assertEqual(len(all_configs), 0)