From b54fd9a9133c90156d5299c24641518f02c89e64 Mon Sep 17 00:00:00 2001 From: Kim Fehrs Date: Wed, 19 Jul 2023 16:35:31 +0200 Subject: [PATCH 01/13] add templating for the config files when using migration mode --- node-runner-cli/commands/dockercommand.py | 19 ++++++++- node-runner-cli/config/DockerConfig.py | 3 ++ node-runner-cli/config/MigrationConfig.py | 42 +++++++++++++++++++ node-runner-cli/config/SystemDConfig.py | 4 ++ .../templates/radix-fullnode-compose.yml.j2 | 9 ++++ .../templates/systemd-default.config.j2 | 10 +++++ node-runner-cli/tests/test_config.py | 14 ++++++- node-runner-cli/tests/test_systemd.py | 2 + node-runner-cli/tests/test_validator.py | 6 ++- node-runner-cli/utils/PromptFeeder.py | 4 ++ node-runner-cli/utils/Prompts.py | 37 ++++++++++++++++ 11 files changed, 146 insertions(+), 4 deletions(-) create mode 100644 node-runner-cli/config/MigrationConfig.py diff --git a/node-runner-cli/commands/dockercommand.py b/node-runner-cli/commands/dockercommand.py index 19dde80e..5652040f 100644 --- a/node-runner-cli/commands/dockercommand.py +++ b/node-runner-cli/commands/dockercommand.py @@ -52,7 +52,14 @@ def dockercommand(dockercommand_args=[], parent=docker_parser): \n\nGATEWAY: Use this value to setup GATEWAY using defaults. \n\nDETAILED: Default value if not provided. This mode takes your through series of questions. """, - choices=["CORE", "GATEWAY", "DETAILED"], action="store"), + choices=["CORE", "GATEWAY", "DETAILED", "MIGRATION"], action="store"), + argument("-miu", "--migration_url", help="The url of the olympia node to migrate the ledger from", action="store"), + argument("-miau", "--migration_auth_user", help="The user to authenticate to the olympia node for migration", + action="store"), + argument("-miap", "--migration_auth_password", + help="The password to authenticate to the olympia node for migration", action="store"), + argument("-miba", "--migration_bech_url", help="The bech url of the olympia node to migrate the ledger from", + action="store"), argument("-n", "--networkid", help="Network id of network you want to connect.For stokenet it is 2 and for mainnet it is 1." "If not provided you will be prompted to enter a value ", @@ -89,6 +96,11 @@ def config(args): new_keystore = args.newkeystore validator = args.validator + olympia_node_url = args.migration_url + olympia_node_bech32_address = args.migration_auth_user + olympia_node_auth_user = args.migration_auth_user + olympia_node_auth_password = args.migration_auth_password + if "DETAILED" in setupmode.mode and len(setupmode.mode) > 1: print(f"{bcolors.FAIL}You cannot have DETAILED option with other options together." f"\nDETAILED option goes through asking each and every question that to customize setup. " @@ -154,6 +166,11 @@ def config(args): # else: # configuration.common_config.nginx_settings.protect_gateway = "false" + if "MIGRATION" in setupmode.mode: + configuration.migration.ask_migration_config(olympia_node_url, olympia_node_auth_user, + olympia_node_auth_password, + olympia_node_bech32_address) + if configuration.common_config.check_nginx_required(): configuration.common_config.ask_nginx_release() if configuration.core_node.enable_transaction == "true": diff --git a/node-runner-cli/config/DockerConfig.py b/node-runner-cli/config/DockerConfig.py index 4a56a7a6..8b798776 100644 --- a/node-runner-cli/config/DockerConfig.py +++ b/node-runner-cli/config/DockerConfig.py @@ -8,6 +8,7 @@ from config.CommonDockerSettings import CommonDockerSettings from config.GatewayDockerConfig import GatewayDockerSettings from config.KeyDetails import KeyDetails +from config.MigrationConfig import CommonMigrationSettings from env_vars import MOUNT_LEDGER_VOLUME, CORE_DOCKER_REPO_OVERRIDE from setup.Base import Base from utils.Prompts import Prompts @@ -94,6 +95,7 @@ class DockerConfig(BaseConfig): core_node: CoreDockerSettings = CoreDockerSettings({}) common_config: CommonDockerSettings = CommonDockerSettings({}) gateway_settings: GatewayDockerSettings = GatewayDockerSettings({}) + migration: CommonMigrationSettings = CommonMigrationSettings({}) def __init__(self, release: str): self.core_node = CoreDockerSettings({}) @@ -125,5 +127,6 @@ def to_yaml(self): config_to_dump["common_config"] = dict(self.common_config) config_to_dump["core_node"] = dict(self.core_node) config_to_dump["gateway_settings"] = dict(self.gateway_settings) + config_to_dump["migration"] = dict(self.migration) return yaml.dump(config_to_dump, sort_keys=False, default_flow_style=False, explicit_start=True, allow_unicode=True) diff --git a/node-runner-cli/config/MigrationConfig.py b/node-runner-cli/config/MigrationConfig.py new file mode 100644 index 00000000..02285c6d --- /dev/null +++ b/node-runner-cli/config/MigrationConfig.py @@ -0,0 +1,42 @@ +from config.BaseConfig import BaseConfig +from utils.Prompts import Prompts + + +class CommonMigrationSettings(BaseConfig): + use_olympia: bool = False + olympia_node_url: str = "" + olympia_node_auth_user: str = "" + olympia_node_auth_password: str = "" + olympia_node_bech32_address: str = "" + + def __init__(self, settings: dict): + super().__init__(settings) + for key, value in settings.items(): + setattr(self, key, value) + + def __iter__(self): + class_variables = {key: value + for key, value in self.__class__.__dict__.items() + if not key.startswith('__') and not callable(value)} + for attr, value in class_variables.items(): + yield attr, self.__getattribute__(attr) + + def ask_migration_config(self, olympia_node_url, olympia_node_auth_user, olympia_node_auth_password, + olympia_node_bech32_address): + self.use_olympia = True + + if olympia_node_url is None: + olympia_node_url = Prompts.ask_olympia_node_url(olympia_node_url) + self.olympia_node_url = olympia_node_url + + if olympia_node_bech32_address is None: + olympia_node_bech32_address = Prompts.ask_olympia_node_bech32_address(olympia_node_bech32_address) + self.olympia_node_bech32_address = olympia_node_bech32_address + + if olympia_node_auth_user is None: + olympia_node_auth_user = Prompts.ask_olympia_node_auth_user(olympia_node_auth_user) + self.olympia_node_auth_user = olympia_node_auth_user + + if olympia_node_auth_password is None: + olympia_node_auth_password = Prompts.ask_olympia_node_auth_password(olympia_node_auth_password) + self.olympia_node_auth_password = olympia_node_auth_password diff --git a/node-runner-cli/config/SystemDConfig.py b/node-runner-cli/config/SystemDConfig.py index 91bea329..1e95956d 100644 --- a/node-runner-cli/config/SystemDConfig.py +++ b/node-runner-cli/config/SystemDConfig.py @@ -6,6 +6,7 @@ from config.BaseConfig import BaseConfig, SetupMode from config.KeyDetails import KeyDetails +from config.MigrationConfig import CommonMigrationSettings from config.Nginx import SystemdNginxConfig from config.Renderer import Renderer from env_vars import MOUNT_LEDGER_VOLUME, NODE_BINARY_OVERIDE, NGINX_BINARY_OVERIDE, APPEND_DEFAULT_CONFIG_OVERIDES @@ -166,6 +167,7 @@ class SystemDSettings(BaseConfig): core_node: CoreSystemdSettings = CoreSystemdSettings({}) common_config: CommonSystemdSettings = CommonSystemdSettings({}) gateway_settings: None + migration: CommonMigrationSettings = CommonMigrationSettings({}) def __iter__(self): class_variables = {key: value @@ -183,6 +185,7 @@ def to_yaml(self): config_to_dump["core_node"]["keydetails"] = dict(self.core_node.keydetails) config_to_dump["common_config"] = dict(self.common_config) config_to_dump["common_config"]["nginx_settings"] = dict(self.common_config.nginx_settings) + config_to_dump["migration"] = dict(self.migration) return yaml.dump(config_to_dump, sort_keys=True, default_flow_style=False, explicit_start=True, allow_unicode=True) @@ -192,6 +195,7 @@ def to_file(self, config_file): config_to_dump["core_node"]["keydetails"] = dict(self.core_node.keydetails) config_to_dump["common_config"] = dict(self.common_config) config_to_dump["common_config"]["nginx_settings"] = dict(self.common_config.nginx_settings) + config_to_dump["migration"] = dict(self.migration) with open(config_file, 'w') as f: yaml.dump(config_to_dump, f, sort_keys=True, default_flow_style=False) diff --git a/node-runner-cli/templates/radix-fullnode-compose.yml.j2 b/node-runner-cli/templates/radix-fullnode-compose.yml.j2 index 60eeaf70..d6b9ea48 100644 --- a/node-runner-cli/templates/radix-fullnode-compose.yml.j2 +++ b/node-runner-cli/templates/radix-fullnode-compose.yml.j2 @@ -15,6 +15,15 @@ services: RADIXDLT_TRANSACTIONS_API_ENABLE: '{{core_node.enable_transaction}}' RADIXDLT_VALIDATOR_KEY_LOCATION: /home/radixdlt/node-keystore.ks RADIX_NODE_KEYSTORE_PASSWORD: '{{core_node.keydetails.keystore_password}}' + {% if migration.use_olympia is defined %} + {% if migration.use_olympia %} + RADIXDLT_GENESIS_USE_OLYMPIA: '{{migration.use_olympia}}' + RADIXDLT_GENESIS_OLYMPIA_NODE_CORE_API_URL: '{{migration.olympia_node_url}}' + RADIXDLT_GENESIS_OLYMPIA_NODE_CORE_API_AUTH_USER: '{{migration.olympia_node_auth_user}}' + RADIXDLT_GENESIS_OLYMPIA_NODE_CORE_API_AUTH_PASSWORD: '{{migration.olympia_node_auth_password}}' + RADIXDLT_GENESIS_OLYMPIA_NODE_BECH32_ADDRESS: '{{migration.olympia_node_bech32_address}}' + {% endif %} + {% endif %} {% if common_config.genesis_bin_data_file is defined %} RADIXDLT_GENESIS_DATA_FILE: "/home/radixdlt/genesis_data_file.bin" {% endif %} diff --git a/node-runner-cli/templates/systemd-default.config.j2 b/node-runner-cli/templates/systemd-default.config.j2 index 7cee4eb1..1664fd4f 100644 --- a/node-runner-cli/templates/systemd-default.config.j2 +++ b/node-runner-cli/templates/systemd-default.config.j2 @@ -25,4 +25,14 @@ db.location=/home/radixdlt/data {% if core_node.validator_address is defined and core_node.validator_address is not none %} consensus.validator_address={{core_node.validator_address}} +{% endif %} + +{% if migration.use_olympia is defined %} +{% if migration.use_olympia %} +genesis.use_olympia={{migration.use_olympia}} +genesis.olympia.node_core_api_url={{migration.olympia_node_url}} +genesis.olympia.node_core_api_auth_user={{migration.olympia_node_auth_user}} +genesis.olympia.node_core_api_auth_password={{migration.olympia_node_auth_password}} +genesis.olympia.node_bech32_address={{migration.olympia_node_bech32_address}} +{% endif %} {% endif %} \ No newline at end of file diff --git a/node-runner-cli/tests/test_config.py b/node-runner-cli/tests/test_config.py index 6a485e89..f6c590ea 100644 --- a/node-runner-cli/tests/test_config.py +++ b/node-runner-cli/tests/test_config.py @@ -62,6 +62,12 @@ def test_config_systemd_defaut_config_matches_fixture(self): node_dir: /someDir/node-config node_secrets_dir: /someDir/node-config/secret nodetype: fullnode +migration: + olympia_node_auth_password: '' + olympia_node_auth_user: '' + olympia_node_bech32_address: '' + olympia_node_url: '' + use_olympia: false """ self.assertEqual(config_as_yaml, fixture) @@ -118,6 +124,12 @@ def test_config_docker_defaut_config_matches_fixture(self): dbname: radixdlt_ledger setup: local host: host.docker.internal:5432 +migration: + use_olympia: false + olympia_node_url: '' + olympia_node_auth_user: '' + olympia_node_auth_password: '' + olympia_node_bech32_address: '' """ self.assertEqual(config_as_yaml, fixture) @@ -135,7 +147,7 @@ def test_network_id_can_be_parsed(self): def suite(): """ This defines all the tests of a module""" suite = unittest.TestSuite() - suite.addTest(unittest.makeSuite(SystemdUnitTests)) + suite.addTest(unittest.makeSuite(ConfigUnitTests)) return suite diff --git a/node-runner-cli/tests/test_systemd.py b/node-runner-cli/tests/test_systemd.py index 3bc37d8c..934565d4 100644 --- a/node-runner-cli/tests/test_systemd.py +++ b/node-runner-cli/tests/test_systemd.py @@ -149,6 +149,7 @@ def test_systemd_setup_default_config(self, mockout): db.location=/home/radixdlt/data consensus.validator_address=validatorAddress + """ self.maxDiff = None print(fixture) @@ -231,6 +232,7 @@ def test_systemd_setup_default_config_jinja(self, mockout): db.location=/home/radixdlt/data consensus.validator_address=validatorAddress + """ self.maxDiff = None self.assertEqual(render_template, fixture) diff --git a/node-runner-cli/tests/test_validator.py b/node-runner-cli/tests/test_validator.py index 49a77a1a..30f96368 100644 --- a/node-runner-cli/tests/test_validator.py +++ b/node-runner-cli/tests/test_validator.py @@ -37,7 +37,8 @@ def test_validator_address_get_templated_into_docker_compose(self, mock_stdout): 'core_release': '2.4', 'keydetails': {'something': 'else'} }, - 'common_config': {'test': 'test'}} + 'common_config': {'test': 'test'}, + 'migration': {}} compose_yml = Renderer().load_file_based_template("radix-fullnode-compose.yml.j2").render( dict(settings)).to_yaml() compose_yml_str = str(compose_yml) @@ -48,7 +49,8 @@ def test_validator_address_gets_omitted_in_docker_compose_if_not_set(self): 'core_release': '2.4', 'keydetails': {'something': 'else'} }, - 'common_config': {'test': 'test'}} + 'common_config': {'test': 'test'}, + 'migration': {'use_olympia': 'true'}} compose_yml = Renderer().load_file_based_template("radix-fullnode-compose.yml.j2").render( dict(settings)).to_yaml() compose_yml_str = str(compose_yml) diff --git a/node-runner-cli/utils/PromptFeeder.py b/node-runner-cli/utils/PromptFeeder.py index 7dcb78cd..afad8fa3 100644 --- a/node-runner-cli/utils/PromptFeeder.py +++ b/node-runner-cli/utils/PromptFeeder.py @@ -6,6 +6,10 @@ class QuestionKeys: + olympia_migrations_bech32 = "olympia_migrations_bech32" + olympia_migrations_user = "olympia_migrations_user" + olympia_migrations_password = "olympia_migrations_password" + olympia_migrations_url = "olympia_migrations_url" select_network = "select_network" first_time_config = "first_time_config" have_existing_compose = "have_existing_compose" diff --git a/node-runner-cli/utils/Prompts.py b/node-runner-cli/utils/Prompts.py index 84a817b0..ec74d9ca 100644 --- a/node-runner-cli/utils/Prompts.py +++ b/node-runner-cli/utils/Prompts.py @@ -364,3 +364,40 @@ def ask_validator_address(cls) -> str: else: print("\nYou can find your validator address using 'radixnode api system identity'") return validator_address + + @classmethod + def ask_olympia_node_url(cls) -> str: + Helpers.section_headline("Migration: Olympia API Url") + answer = Helpers.input_guestion(f"Enter the API Url of your Olympia node with olympia-end-state.: " + , QuestionKeys.olympia_migrations_url) + return answer + + @classmethod + def ask_olympia_node_auth(cls) -> str: + Helpers.section_headline("Migration: Olympia API Authentication") + answer = Helpers.input_guestion( + f"Enter the credentials for your olympia node. Leave blank if no authentication is required: " + , QuestionKeys.olympia_migrations_user) + return answer + + @classmethod + def ask_olympia_node_auth_user(cls) -> str: + Helpers.section_headline("Migration: Olympia API Authentication") + answer = Helpers.input_guestion( + f"Enter the credentials for your olympia node. Leave blank if no authentication is required: \n User:" + , QuestionKeys.olympia_migrations_user) + return answer + + @classmethod + def ask_olympia_node_auth_password(cls) -> str: + answer = Helpers.input_guestion( + f"Password: " + , QuestionKeys.olympia_migrations_password) + return answer + + @classmethod + def ask_olympia_node_bech32_address(cls) -> str: + answer = Helpers.input_guestion( + f"Enter the bech32 address of your olympia node" + , QuestionKeys.olympia_migrations_bech32) + return answer From d7e79257abb534c46613c77f77378d9aa1a7dd1c Mon Sep 17 00:00:00 2001 From: Kim Fehrs Date: Wed, 19 Jul 2023 16:39:50 +0200 Subject: [PATCH 02/13] add migration setting to systemd --- node-runner-cli/commands/systemdcommand.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/node-runner-cli/commands/systemdcommand.py b/node-runner-cli/commands/systemdcommand.py index cb8d8fdc..4cf37574 100644 --- a/node-runner-cli/commands/systemdcommand.py +++ b/node-runner-cli/commands/systemdcommand.py @@ -50,7 +50,14 @@ def systemdcommand(systemdcommand_args=None, parent=systemd_parser): \n\nCORE: Use this value to setup CORE using defaults. \n\nDETAILED: Default value if not provided. This mode takes your through series of questions. """, - choices=["CORE", "DETAILED"], action="store"), + choices=["CORE", "DETAILED", "MIGRATION"], action="store"), + argument("-miu", "--migration_url", help="The url of the olympia node to migrate the ledger from", action="store"), + argument("-miau", "--migration_auth_user", help="The user to authenticate to the olympia node for migration", + action="store"), + argument("-miap", "--migration_auth_password", + help="The password to authenticate to the olympia node for migration", action="store"), + argument("-miba", "--migration_bech_url", help="The bech url of the olympia node to migrate the ledger from", + action="store"), argument("-n", "--networkid", help="Network id of network you want to connect.For stokenet it is 2 and for mainnet it is 1." "If not provided you will be prompted to enter a value ", @@ -95,6 +102,11 @@ def config(args): data_directory = args.data_directory new_keystore = args.newkeystore + olympia_node_url = args.migration_url + olympia_node_bech32_address = args.migration_auth_user + olympia_node_auth_user = args.migration_auth_user + olympia_node_auth_password = args.migration_auth_password + Helpers.section_headline("CONFIG FILE") config_file = f"{args.configdir}/config.yaml" Path(f"{args.configdir}").mkdir(parents=True, exist_ok=True) @@ -117,6 +129,12 @@ def config(args): trustednode, keystore_password, new_keystore) configuration.common_config.ask_enable_nginx_for_core(nginx_on_core) + + if "MIGRATION" in setupmode.mode: + configuration.migration.ask_migration_config(olympia_node_url, olympia_node_auth_user, + olympia_node_auth_password, + olympia_node_bech32_address) + config_to_dump["core_node"] = dict(configuration.core_node) if configuration.common_config.check_nginx_required(): From dd9e64becf4083629dd3e73efb9a2a8c4d04bf9c Mon Sep 17 00:00:00 2001 From: Kim Fehrs Date: Wed, 19 Jul 2023 16:49:13 +0200 Subject: [PATCH 03/13] add ubuntu focal and jammy as seperate dockerfiles --- node-runner-cli/Dockerfile.ubuntufocal | 8 ++--- node-runner-cli/Dockerfile.ubuntujammy | 43 ++++++++++++++++++++++++++ node-runner-cli/Makefile | 3 ++ node-runner-cli/version/__init__.py | 4 +-- 4 files changed, 52 insertions(+), 6 deletions(-) create mode 100644 node-runner-cli/Dockerfile.ubuntujammy diff --git a/node-runner-cli/Dockerfile.ubuntufocal b/node-runner-cli/Dockerfile.ubuntufocal index 6cc31f2d..ce5c8aee 100644 --- a/node-runner-cli/Dockerfile.ubuntufocal +++ b/node-runner-cli/Dockerfile.ubuntufocal @@ -1,8 +1,8 @@ -FROM ubuntu:22.04 as BUILD +FROM ubuntu:20.04 as BUILD MAINTAINER radixdlt ENV DEBIAN_FRONTEND noninteractive -ENV PYTHON_VERSION 3.10.6 +ENV PYTHON_VERSION 3.7.6 CMD /bin/bash @@ -22,11 +22,11 @@ RUN set -ex \ && pyenv update -RUN CONFIGURE_OPTS=--enable-shared pyenv install 3.10.6 +RUN CONFIGURE_OPTS=--enable-shared pyenv install 3.7.6 -RUN pyenv virtualenv 3.10.6 nodecli +RUN pyenv virtualenv 3.7.6 nodecli RUN pyenv local nodecli RUN pip install pyinstaller==4.10 diff --git a/node-runner-cli/Dockerfile.ubuntujammy b/node-runner-cli/Dockerfile.ubuntujammy new file mode 100644 index 00000000..6cc31f2d --- /dev/null +++ b/node-runner-cli/Dockerfile.ubuntujammy @@ -0,0 +1,43 @@ +FROM ubuntu:22.04 as BUILD +MAINTAINER radixdlt + +ENV DEBIAN_FRONTEND noninteractive +ENV PYTHON_VERSION 3.10.6 + +CMD /bin/bash + +RUN apt-get update \ + && apt-get install -y --no-install-recommends make build-essential libssl-dev zlib1g-dev \ + libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \ + libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev ca-certificates git > /dev/null + + + +ENV PYENV_ROOT /root/.pyenv +ENV PATH $PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH + +# Install pyenv +RUN set -ex \ + && curl https://pyenv.run | bash \ + && pyenv update + + +RUN CONFIGURE_OPTS=--enable-shared pyenv install 3.10.6 + + + +RUN pyenv virtualenv 3.10.6 nodecli +RUN pyenv local nodecli +RUN pip install pyinstaller==4.10 + +WORKDIR /app +COPY requirements.txt /app/requirements.txt +RUN pip install -r requirements.txt + +COPY . /app +RUN pyinstaller --onefile --windowed radixnode.spec + +RUN DISABLE_VERSION_CHECK=true /app/dist/radixnode version + +FROM scratch AS export-stage +COPY --from=BUILD /app/dist / \ No newline at end of file diff --git a/node-runner-cli/Makefile b/node-runner-cli/Makefile index 5b1b94ae..a8fba4d5 100644 --- a/node-runner-cli/Makefile +++ b/node-runner-cli/Makefile @@ -7,6 +7,9 @@ install: .PHONY: output output-ubuntu-focal: install DOCKER_BUILDKIT=1 docker build --platform linux/amd64 --output type=local,dest=out/ubuntu/focal --progress plain -f Dockerfile.ubuntufocal . +.PHONY: output +output-ubuntu-jammy: install + DOCKER_BUILDKIT=1 docker build --platform linux/amd64 --output type=local,dest=out/ubuntu/jammy --progress plain -f Dockerfile.ubuntujammy . .PHONY: local local: install diff --git a/node-runner-cli/version/__init__.py b/node-runner-cli/version/__init__.py index a507a77a..88de153a 100644 --- a/node-runner-cli/version/__init__.py +++ b/node-runner-cli/version/__init__.py @@ -1,2 +1,2 @@ -__version__= "2.0.rcnet-rc.4-30-g2655ef5" -__base_version__= "2.0.rcnet-rc.4" +__version__= "2.0.rcnet-v2-rc1-2-gd7e7925" +__base_version__= "2.0.rcnet-v2-rc1" From 2ddb3a7aa8262b1ed7957acefdb12494a8482e3b Mon Sep 17 00:00:00 2001 From: Kim Fehrs Date: Wed, 19 Jul 2023 17:04:08 +0200 Subject: [PATCH 04/13] update workflow file --- .github/workflows/ci.yml | 41 +++++++++++++++++++++++------ node-runner-cli/version/__init__.py | 2 +- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0f806fc9..09d186cc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -67,16 +67,26 @@ jobs: token: ${{ secrets.GITHUB_TOKEN }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Build the binary for ubuntu + - name: Build the binary for ubuntu jammy run: | cd node-runner-cli - make output-ubuntu-focal + make output-ubuntu-jammy env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: "Upload generated cli file" uses: actions/upload-artifact@v3.1.2 with: name: ubuntu 22.04 + path: "${{ github.workspace }}/node-runner-cli/out/ubuntu/jammy/radixnode" + - name: Build the binary for ubuntu focal + run: | + make output-ubuntu-focal + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: "Upload generated cli file" + uses: actions/upload-artifact@v3.1.2 + with: + name: ubuntu 20.04 path: "${{ github.workspace }}/node-runner-cli/out/ubuntu/focal/radixnode" upload-asset-store: @@ -119,7 +129,7 @@ jobs: ls */** aws s3 cp radixnode s3://${{secrets.ARTIFACT_AWS_BUCKET }}/radixnode/${{env.BRANCH_WITH_COMMIT}}/radixnode-ubuntu-22.04 - upload-release: + upload-release-jammy: runs-on: ubuntu-22.04 if: ${{ github.event_name == 'release' }} needs: @@ -129,18 +139,33 @@ jobs: uses: actions/download-artifact@v3 with: name: ubuntu 22.04 - - name: Get release - id: get_release - uses: bruceadams/get-release@v1.2.2 + - name: Upload radixcli ubuntu binary + uses: actions/upload-release-asset@v1 env: - GITHUB_TOKEN: ${{ github.token }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ github.event.release.upload_url }} + asset_path: ./radixnode + asset_name: radixnode-ubuntu-22.04 + asset_content_type: application/octet-stream + if: ${{ github.event_name == 'release' }} + upload-release-focal: + runs-on: ubuntu-20.04 + if: ${{ github.event_name == 'release' }} + needs: + - package_ubuntu_cli + steps: + - name: Download packaged cli + uses: actions/download-artifact@v3 + with: + name: ubuntu 20.04 - name: Upload radixcli ubuntu binary uses: actions/upload-release-asset@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - upload_url: ${{ steps.get_release.outputs.upload_url }} + upload_url: ${{ github.event.release.upload_url }} asset_path: ./radixnode asset_name: radixnode-ubuntu-22.04 asset_content_type: application/octet-stream diff --git a/node-runner-cli/version/__init__.py b/node-runner-cli/version/__init__.py index 88de153a..2d58ee6e 100644 --- a/node-runner-cli/version/__init__.py +++ b/node-runner-cli/version/__init__.py @@ -1,2 +1,2 @@ -__version__= "2.0.rcnet-v2-rc1-2-gd7e7925" +__version__= "2.0.rcnet-v2-rc1-3-gdd9e64b" __base_version__= "2.0.rcnet-v2-rc1" From 605a1b69405da8169dd6bb0b25105b1995f30466 Mon Sep 17 00:00:00 2001 From: Kim Fehrs Date: Mon, 24 Jul 2023 11:34:44 +0200 Subject: [PATCH 05/13] change default config folder --- .../test-prompts/core-gateway-all-local.yml | 2 +- node-runner-cli/test-prompts/corenode-01.yml | 2 +- node-runner-cli/test-prompts/corenode-02.yml | 2 +- node-runner-cli/tests/test_config.py | 12 +++++----- node-runner-cli/tests/test_systemd.py | 22 +++++++++---------- node-runner-cli/utils/utils.py | 2 +- node-runner-cli/version/__init__.py | 2 +- 7 files changed, 22 insertions(+), 22 deletions(-) diff --git a/node-runner-cli/test-prompts/core-gateway-all-local.yml b/node-runner-cli/test-prompts/core-gateway-all-local.yml index 6d16856b..b6407351 100644 --- a/node-runner-cli/test-prompts/core-gateway-all-local.yml +++ b/node-runner-cli/test-prompts/core-gateway-all-local.yml @@ -5,7 +5,7 @@ - input_seednode: "radix://node_tdx_d_1qwq2nfe6vxqwe3mqmfm9l2xl97as7lkwndval63cymvc3qszn8nqx6g2s3m@3.109.161.178" - have_validator_address: "N" - have_keystore_file: Y -- input_path_keystore: "/home/runner/node-config" +- input_path_keystore: "/home/runner/babylon-node" - enter_keystore_name: "node-keystore.ks" - input_ledger_path: "/tmp/data" - input_transaction_api: "true" diff --git a/node-runner-cli/test-prompts/corenode-01.yml b/node-runner-cli/test-prompts/corenode-01.yml index c102f2e5..56721bbc 100644 --- a/node-runner-cli/test-prompts/corenode-01.yml +++ b/node-runner-cli/test-prompts/corenode-01.yml @@ -5,7 +5,7 @@ - input_seednode: "radix://node_tdx_d_1qwq2nfe6vxqwe3mqmfm9l2xl97as7lkwndval63cymvc3qszn8nqx6g2s3m@3.109.161.178" - have_validator_address: "N" - have_keystore_file: Y -- input_path_keystore: "/home/runner/node-config" +- input_path_keystore: "/home/runner/babylon-node" - enter_keystore_name: "node-keystore.ks" - input_ledger_path: "/tmp/data" - input_transaction_api: "true" diff --git a/node-runner-cli/test-prompts/corenode-02.yml b/node-runner-cli/test-prompts/corenode-02.yml index ac500410..95393aa2 100644 --- a/node-runner-cli/test-prompts/corenode-02.yml +++ b/node-runner-cli/test-prompts/corenode-02.yml @@ -6,7 +6,7 @@ - input_seednode: "radix://node_tdx_d_1qwq2nfe6vxqwe3mqmfm9l2xl97as7lkwndval63cymvc3qszn8nqx6g2s3m@3.109.161.178" - have_validator_address: "N" - have_keystore_file: N -- input_path_keystore: "/home/runner/node-config" +- input_path_keystore: "/home/runner/babylon-node" - enter_keystore_name: "node-keystore.ks" - input_ledger_path: "/tmp/data" - input_transaction_api: "false" diff --git a/node-runner-cli/tests/test_config.py b/node-runner-cli/tests/test_config.py index f6c590ea..915ba23b 100644 --- a/node-runner-cli/tests/test_config.py +++ b/node-runner-cli/tests/test_config.py @@ -35,8 +35,8 @@ def test_config_systemd_nginx_can_be_serialized(self): def test_config_systemd_defaut_config_matches_fixture(self): config = SystemDSettings({}) home_directory = Path.home() - config.core_node.node_dir = f"/someDir/node-config" - config.core_node.node_secrets_dir = f"/someDir/node-config/secret" + config.core_node.node_dir = f"/someDir/babylon-node" + config.core_node.node_secrets_dir = f"/someDir/babylon-node/secret" config_as_yaml = config.to_yaml() self.maxDiff = None fixture = f"""--- @@ -57,10 +57,10 @@ def test_config_systemd_defaut_config_matches_fixture(self): -Djavax.net.ssl.trustStoreType=jks -Djava.security.egd=file:/dev/urandom -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector keydetails: keyfile_name: node-keystore.ks - keyfile_path: {home_directory}/node-config + keyfile_path: {home_directory}/babylon-node keygen_tag: 1.3.2 - node_dir: /someDir/node-config - node_secrets_dir: /someDir/node-config/secret + node_dir: /someDir/babylon-node + node_secrets_dir: /someDir/babylon-node/secret nodetype: fullnode migration: olympia_node_auth_password: '' @@ -80,7 +80,7 @@ def test_config_docker_defaut_config_matches_fixture(self): core_node: nodetype: fullnode keydetails: - keyfile_path: {home_directory}/node-config + keyfile_path: {home_directory}/babylon-node keyfile_name: node-keystore.ks keygen_tag: 1.3.2 repo: radixdlt/babylon-node diff --git a/node-runner-cli/tests/test_systemd.py b/node-runner-cli/tests/test_systemd.py index 934565d4..5d230824 100644 --- a/node-runner-cli/tests/test_systemd.py +++ b/node-runner-cli/tests/test_systemd.py @@ -39,8 +39,8 @@ def test_systemd_config_can_be_saved_and_restored_as_yaml(self): # Make Python Class YAML Serializable settings = SystemDSettings({}) home_directory = Path.home() - settings.core_node.node_dir = "/somedir/node-config" - settings.core_node.node_secrets_dir = "/somedir/node-config/secret" + settings.core_node.node_dir = "/somedir/babylon-node" + settings.core_node.node_secrets_dir = "/somedir/babylon-node/secret" key_details = KeyDetails({}) settings.core_node.keydetails = key_details settings.common_config.host_ip = "6.6.6.6" @@ -52,7 +52,7 @@ def test_systemd_config_can_be_saved_and_restored_as_yaml(self): self.maxDiff = None new_settings = SystemD.load_settings(config_file) self.assertEqual(new_settings.to_yaml(), settings.to_yaml()) - self.assertEqual(new_settings.core_node.node_dir, "/somedir/node-config") + self.assertEqual(new_settings.core_node.node_dir, "/somedir/babylon-node") @unittest.skip("Can only be executed on Ubuntu") def test_systemd_dependencies(self): @@ -94,7 +94,7 @@ def test_docker_config_all_local(self, mockout): 'radix://node_tdx_22_1qvsml9pe32rzcrmw6jx204gjeng09adzkqqfz0ewhxwmjsaas99jzrje4u3@34.243.93.185', 'N', 'Y', - '/tmp/node-config', + '/tmp/babylon-node', 'node-keystore.ks', '/tmp/data', 'true', @@ -107,7 +107,7 @@ def test_docker_config_all_local(self, mockout): @unittest.skip("For verification only") def test_systemd_install_manual(self): with patch("sys.argv", - ["main", "systemd", "install", "-a", "-m", "-f", "/tmp/node-config/test-config.yaml"]): + ["main", "systemd", "install", "-a", "-m", "-f", "/tmp/babylon-node/test-config.yaml"]): main() @patch('sys.stdout', new_callable=StringIO) @@ -116,7 +116,7 @@ def test_systemd_setup_default_config(self, mockout): settings = SystemDSettings({}) settings.common_config.host_ip = "1.1.1.1" settings.common_config.network_id = 1 - settings.core_node.keydetails.keyfile_path = "/tmp/node-config" + settings.core_node.keydetails.keyfile_path = "/tmp/babylon-node" settings.core_node.keydetails.keyfile_name = "node-keystore.ks" settings.core_node.trusted_node = "someNode" settings.core_node.validator_address = "validatorAddress" @@ -131,7 +131,7 @@ def test_systemd_setup_default_config(self, mockout): network.id=1 -node.key.path=/tmp/node-config/node-keystore.ks +node.key.path=/tmp/babylon-node/node-keystore.ks network.p2p.broadcast_port=30000 network.p2p.listen_port=30001 @@ -161,7 +161,7 @@ def test_systemd_setup_default_config_without_validator(self, mockout): settings = SystemDSettings({}) settings.common_config.host_ip = "1.1.1.1" settings.common_config.network_id = 1 - settings.core_node.keydetails.keyfile_path = "/tmp/node-config" + settings.core_node.keydetails.keyfile_path = "/tmp/babylon-node" settings.core_node.keydetails.keyfile_name = "node-keystore.ks" settings.core_node.trusted_node = "someNode" settings.core_node.validator_address = None @@ -176,7 +176,7 @@ def test_systemd_setup_default_config_without_validator(self, mockout): network.id=1 -node.key.path=/tmp/node-config/node-keystore.ks +node.key.path=/tmp/babylon-node/node-keystore.ks network.p2p.broadcast_port=30000 network.p2p.listen_port=30001 @@ -201,7 +201,7 @@ def test_systemd_setup_default_config_jinja(self, mockout): with patch('builtins.input', side_effect=[]): settings = SystemDSettings({}) settings.common_config.genesis_bin_data_file = None - settings.core_node.keydetails.keyfile_path = "/tmp/node-config" + settings.core_node.keydetails.keyfile_path = "/tmp/babylon-node" settings.core_node.keydetails.keyfile_name = "node-keystore.ks" settings.core_node.trusted_node = "someNode" settings.common_config.host_ip = "1.1.1.1" @@ -214,7 +214,7 @@ def test_systemd_setup_default_config_jinja(self, mockout): network.id=1 -node.key.path=/tmp/node-config/node-keystore.ks +node.key.path=/tmp/babylon-node/node-keystore.ks network.p2p.broadcast_port=30000 network.p2p.listen_port=30001 diff --git a/node-runner-cli/utils/utils.py b/node-runner-cli/utils/utils.py index 47147ca2..bcf51274 100644 --- a/node-runner-cli/utils/utils.py +++ b/node-runner-cli/utils/utils.py @@ -273,7 +273,7 @@ def get_home_dir(): @staticmethod def get_default_node_config_dir(): - return f"{Path.home()}/node-config" + return f"{Path.home()}/babylon-node-config" @staticmethod def get_default_monitoring_config_dir(): diff --git a/node-runner-cli/version/__init__.py b/node-runner-cli/version/__init__.py index 2d58ee6e..208525fe 100644 --- a/node-runner-cli/version/__init__.py +++ b/node-runner-cli/version/__init__.py @@ -1,2 +1,2 @@ -__version__= "2.0.rcnet-v2-rc1-3-gdd9e64b" +__version__= "2.0.rcnet-v2-rc1-4-g2ddb3a7" __base_version__= "2.0.rcnet-v2-rc1" From 8af6cfb4f908d3e6cf7b191812354bfde32e9292 Mon Sep 17 00:00:00 2001 From: Kim Fehrs Date: Mon, 24 Jul 2023 11:36:01 +0200 Subject: [PATCH 06/13] change babylon default ledger folder --- node-runner-cli/config/DockerConfig.py | 2 +- node-runner-cli/config/SystemDConfig.py | 2 +- node-runner-cli/monitoring/__init__.py | 8 ++++---- node-runner-cli/release_ymls/Setup.md | 6 +++--- .../release_ymls/radix-fullnode-compose.yml | 4 ++-- node-runner-cli/setup/Base.py | 4 ++-- node-runner-cli/setup/SystemD.py | 4 ++-- node-runner-cli/templates/systemd-default.config.j2 | 2 +- .../test-prompts/core-gateway-all-local.yml | 2 +- node-runner-cli/test-prompts/corenode-01.yml | 2 +- node-runner-cli/test-prompts/corenode-02.yml | 2 +- .../systemd_install_default_config.yml | 2 +- node-runner-cli/tests/e2e_test.sh | 2 +- node-runner-cli/tests/test_config.py | 4 ++-- node-runner-cli/tests/test_systemd.py | 10 +++++----- 15 files changed, 28 insertions(+), 28 deletions(-) diff --git a/node-runner-cli/config/DockerConfig.py b/node-runner-cli/config/DockerConfig.py index 8b798776..19105a4d 100644 --- a/node-runner-cli/config/DockerConfig.py +++ b/node-runner-cli/config/DockerConfig.py @@ -21,7 +21,7 @@ class CoreDockerSettings(BaseConfig): keydetails: KeyDetails = KeyDetails({}) core_release: str = None repo: str = os.getenv(CORE_DOCKER_REPO_OVERRIDE, "radixdlt/babylon-node") - data_directory: str = f"{Helpers.get_home_dir()}/data" + data_directory: str = f"{Helpers.get_home_dir()}/babylon-ledger" enable_transaction: str = "false" trusted_node: str = None validator_address: str = None diff --git a/node-runner-cli/config/SystemDConfig.py b/node-runner-cli/config/SystemDConfig.py index 1e95956d..f49f12f3 100644 --- a/node-runner-cli/config/SystemDConfig.py +++ b/node-runner-cli/config/SystemDConfig.py @@ -24,7 +24,7 @@ class CoreSystemdSettings(BaseConfig): core_release: str = None core_binary_url: str = None core_library_url: str = None - data_directory: str = f"{Helpers.get_home_dir()}/data" + data_directory: str = f"{Helpers.get_home_dir()}/babylon-ledger" enable_transaction: str = "false" trusted_node: str = None node_dir: str = '/etc/radixdlt/node' diff --git a/node-runner-cli/monitoring/__init__.py b/node-runner-cli/monitoring/__init__.py index 7197d7a7..3bbc93be 100644 --- a/node-runner-cli/monitoring/__init__.py +++ b/node-runner-cli/monitoring/__init__.py @@ -78,15 +78,15 @@ def setup_datasource(default_datasource_cfg_url, monitoring_config_dir): req = requests.Request('GET', f'{default_datasource_cfg_url}') prepared = req.prepare() resp = Helpers.send_request(prepared, print_response=False) - Path(f"{monitoring_config_dir}/grafana/provisioning/datasources").mkdir(parents=True, exist_ok=True) - with open(f"{monitoring_config_dir}/grafana/provisioning/datasources/datasource.yml", 'wb') as f: + Path(f"{monitoring_config_dir}/grafana/provisioning/babylon-ledgersources").mkdir(parents=True, exist_ok=True) + with open(f"{monitoring_config_dir}/grafana/provisioning/babylon-ledgersources/babylon-ledgersource.yml", 'wb') as f: f.write(resp.content) @staticmethod def template_datasource(monitoring_config_dir): render_template = Renderer().load_file_based_template("datasource.yml.j2").render({}).to_yaml() - Path(f"{monitoring_config_dir}/grafana/provisioning/datasources").mkdir(parents=True, exist_ok=True) - file_location = f"{monitoring_config_dir}/grafana/provisioning/datasources/datasource.yml" + Path(f"{monitoring_config_dir}/grafana/provisioning/babylon-ledgersources").mkdir(parents=True, exist_ok=True) + file_location = f"{monitoring_config_dir}/grafana/provisioning/babylon-ledgersources/babylon-ledgersource.yml" Helpers.section_headline("Downloading datasource for grafana") Helpers.dump_rendered_template(render_template, file_location) diff --git a/node-runner-cli/release_ymls/Setup.md b/node-runner-cli/release_ymls/Setup.md index 2914ca3c..47c8672e 100644 --- a/node-runner-cli/release_ymls/Setup.md +++ b/node-runner-cli/release_ymls/Setup.md @@ -47,8 +47,8 @@ Mounting radix ledger to external directory ```bash This is required if you want to map radix ledger to external directory -sudo mkdir /data -sudo chmod 647 /data +sudo mkdir /babylon-ledger +sudo chmod 647 /babylon-ledger ``` Add below line under volumes section for docker service core @@ -63,7 +63,7 @@ Add below lines under volumes section for the main file driver_opts: o: bind type: none - device: /data + device: /babylon-ledger ``` diff --git a/node-runner-cli/release_ymls/radix-fullnode-compose.yml b/node-runner-cli/release_ymls/radix-fullnode-compose.yml index 73bb8291..91b2cd45 100644 --- a/node-runner-cli/release_ymls/radix-fullnode-compose.yml +++ b/node-runner-cli/release_ymls/radix-fullnode-compose.yml @@ -46,10 +46,10 @@ services: - "nginx_secrets:/etc/nginx/secrets" volumes: nginx_secrets: -# BIND MOUNT Named core ledger volume : Uncomment below lines to bind core_ledger volume. The directory /data should exist before in hand and should have permission 640 +# BIND MOUNT Named core ledger volume : Uncomment below lines to bind core_ledger volume. The directory /babylon-ledger should exist before in hand and should have permission 640 # core_ledger: # driver: local # driver_opts: # o: bind # type: none -# device: /data \ No newline at end of file +# device: /babylon-ledger \ No newline at end of file diff --git a/node-runner-cli/setup/Base.py b/node-runner-cli/setup/Base.py index 4fa3ae0b..e488e1aa 100644 --- a/node-runner-cli/setup/Base.py +++ b/node-runner-cli/setup/Base.py @@ -106,10 +106,10 @@ def get_data_dir(create_dir=True): f"\nRadix node stores all the ledger data on a folder. " f"Mounting this location as a docker volume, " f"will allow to restart the node without a need to download ledger" - f"\n{bcolors.WARNING}Press Enter to store ledger on \"{Helpers.get_home_dir()}/data\" directory OR " + f"\n{bcolors.WARNING}Press Enter to store ledger on \"{Helpers.get_home_dir()}/babylon-ledger\" directory OR " f"Type the absolute path of existing ledger data folder:{bcolors.ENDC}", QuestionKeys.input_ledger_path) if data_dir_path == "": - data_dir_path = f"{Helpers.get_home_dir()}/data" + data_dir_path = f"{Helpers.get_home_dir()}/babylon-ledger" if create_dir: run_shell_command(f'sudo mkdir -p {data_dir_path}', shell=True) return data_dir_path diff --git a/node-runner-cli/setup/SystemD.py b/node-runner-cli/setup/SystemD.py index 7a2c5ec1..8212e810 100644 --- a/node-runner-cli/setup/SystemD.py +++ b/node-runner-cli/setup/SystemD.py @@ -64,8 +64,8 @@ def make_etc_directory(): @staticmethod def make_data_directory(): - run_shell_command('sudo mkdir -p /data', shell=True) - run_shell_command('sudo chown radixdlt:radixdlt -R /data', shell=True) + run_shell_command('sudo mkdir -p /babylon-ledger', shell=True) + run_shell_command('sudo chown radixdlt:radixdlt -R /babylon-ledger', shell=True) @staticmethod def fetch_universe_json(trustenode, extraction_path): diff --git a/node-runner-cli/templates/systemd-default.config.j2 b/node-runner-cli/templates/systemd-default.config.j2 index 1664fd4f..bdd5248f 100644 --- a/node-runner-cli/templates/systemd-default.config.j2 +++ b/node-runner-cli/templates/systemd-default.config.j2 @@ -21,7 +21,7 @@ api.transactions.enable=true api.sign.enable=true api.bind.address=0.0.0.0 -db.location=/home/radixdlt/data +db.location=/home/radixdlt/babylon-ledger {% if core_node.validator_address is defined and core_node.validator_address is not none %} consensus.validator_address={{core_node.validator_address}} diff --git a/node-runner-cli/test-prompts/core-gateway-all-local.yml b/node-runner-cli/test-prompts/core-gateway-all-local.yml index b6407351..1182cddd 100644 --- a/node-runner-cli/test-prompts/core-gateway-all-local.yml +++ b/node-runner-cli/test-prompts/core-gateway-all-local.yml @@ -7,7 +7,7 @@ - have_keystore_file: Y - input_path_keystore: "/home/runner/babylon-node" - enter_keystore_name: "node-keystore.ks" -- input_ledger_path: "/tmp/data" +- input_ledger_path: "/tmp/babylon-ledger" - input_transaction_api: "true" - core_nginx_setup: "true" #- setup_gateway: Y diff --git a/node-runner-cli/test-prompts/corenode-01.yml b/node-runner-cli/test-prompts/corenode-01.yml index 56721bbc..c801459b 100644 --- a/node-runner-cli/test-prompts/corenode-01.yml +++ b/node-runner-cli/test-prompts/corenode-01.yml @@ -7,7 +7,7 @@ - have_keystore_file: Y - input_path_keystore: "/home/runner/babylon-node" - enter_keystore_name: "node-keystore.ks" -- input_ledger_path: "/tmp/data" +- input_ledger_path: "/tmp/babylon-ledger" - input_transaction_api: "true" - core_nginx_setup: "true" #- setup_gateway: "false" diff --git a/node-runner-cli/test-prompts/corenode-02.yml b/node-runner-cli/test-prompts/corenode-02.yml index 95393aa2..3d37f1a7 100644 --- a/node-runner-cli/test-prompts/corenode-02.yml +++ b/node-runner-cli/test-prompts/corenode-02.yml @@ -8,7 +8,7 @@ - have_keystore_file: N - input_path_keystore: "/home/runner/babylon-node" - enter_keystore_name: "node-keystore.ks" -- input_ledger_path: "/tmp/data" +- input_ledger_path: "/tmp/babylon-ledger" - input_transaction_api: "false" - core_nginx_setup: "false" #- setup_gateway: "false" \ No newline at end of file diff --git a/node-runner-cli/test-prompts/individual-prompts/systemd_install_default_config.yml b/node-runner-cli/test-prompts/individual-prompts/systemd_install_default_config.yml index c4f0b5e1..bfc6b36c 100644 --- a/node-runner-cli/test-prompts/individual-prompts/systemd_install_default_config.yml +++ b/node-runner-cli/test-prompts/individual-prompts/systemd_install_default_config.yml @@ -1,4 +1,4 @@ --- - select_network: S -- input_ledger_path: "/tmp/data" +- input_ledger_path: "/tmp/babylon-ledger" - continue_systemd_install: Y \ No newline at end of file diff --git a/node-runner-cli/tests/e2e_test.sh b/node-runner-cli/tests/e2e_test.sh index b5316dcb..16ba4a47 100644 --- a/node-runner-cli/tests/e2e_test.sh +++ b/node-runner-cli/tests/e2e_test.sh @@ -1,4 +1,4 @@ #!/bin/bash -radixnode systemd config -a -t "somenode" -i "1.1.1.1" -k "password" -n S -dd "/tmp/data" +radixnode systemd config -a -t "somenode" -i "1.1.1.1" -k "password" -n S -dd "/tmp/babylon-ledger" radixnode systemd install -a \ No newline at end of file diff --git a/node-runner-cli/tests/test_config.py b/node-runner-cli/tests/test_config.py index 915ba23b..4c420769 100644 --- a/node-runner-cli/tests/test_config.py +++ b/node-runner-cli/tests/test_config.py @@ -50,7 +50,7 @@ def test_config_systemd_defaut_config_matches_fixture(self): secrets_dir: /etc/nginx/secrets service_user: radixdlt core_node: - data_directory: {home_directory}/data + data_directory: {home_directory}/babylon-ledger enable_transaction: 'false' java_opts: --enable-preview -server -Xms8g -Xmx8g -XX:MaxDirectMemorySize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCompressedOops -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts @@ -84,7 +84,7 @@ def test_config_docker_defaut_config_matches_fixture(self): keyfile_name: node-keystore.ks keygen_tag: 1.3.2 repo: radixdlt/babylon-node - data_directory: {home_directory}/data + data_directory: {home_directory}/babylon-ledger enable_transaction: 'false' java_opts: --enable-preview -server -Xms8g -Xmx8g -XX:MaxDirectMemorySize=2048m -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCompressedOops -Djavax.net.ssl.trustStore=/etc/ssl/certs/java/cacerts diff --git a/node-runner-cli/tests/test_systemd.py b/node-runner-cli/tests/test_systemd.py index 5d230824..859a3941 100644 --- a/node-runner-cli/tests/test_systemd.py +++ b/node-runner-cli/tests/test_systemd.py @@ -32,7 +32,7 @@ def test_systemd_config_can_run_without_prompt(self): "-k", "password", "-n", "S", "-d", "/tmp/config", - "-dd", "/tmp/data"]): + "-dd", "/tmp/babylon-ledger"]): main() def test_systemd_config_can_be_saved_and_restored_as_yaml(self): @@ -96,7 +96,7 @@ def test_docker_config_all_local(self, mockout): 'Y', '/tmp/babylon-node', 'node-keystore.ks', - '/tmp/data', + '/tmp/babylon-ledger', 'true', 'true', 'development-latest']): @@ -146,7 +146,7 @@ def test_systemd_setup_default_config(self, mockout): api.sign.enable=true api.bind.address=0.0.0.0 -db.location=/home/radixdlt/data +db.location=/home/radixdlt/babylon-ledger consensus.validator_address=validatorAddress @@ -191,7 +191,7 @@ def test_systemd_setup_default_config_without_validator(self, mockout): api.sign.enable=true api.bind.address=0.0.0.0 -db.location=/home/radixdlt/data +db.location=/home/radixdlt/babylon-ledger """ self.maxDiff = None self.assertEqual(default_config.strip(), fixture.strip()) @@ -229,7 +229,7 @@ def test_systemd_setup_default_config_jinja(self, mockout): api.sign.enable=true api.bind.address=0.0.0.0 -db.location=/home/radixdlt/data +db.location=/home/radixdlt/babylon-ledger consensus.validator_address=validatorAddress From 1319a13020515974e56a9a6a03f6cefc5acbc4e5 Mon Sep 17 00:00:00 2001 From: Kim Fehrs Date: Mon, 24 Jul 2023 12:46:57 +0200 Subject: [PATCH 07/13] add gateway behaviour to systemd --- node-runner-cli/config/DockerConfig.py | 1 + node-runner-cli/config/SystemDConfig.py | 5 +++- node-runner-cli/tests/test_config.py | 38 +++++++++++++++++++++---- 3 files changed, 37 insertions(+), 7 deletions(-) diff --git a/node-runner-cli/config/DockerConfig.py b/node-runner-cli/config/DockerConfig.py index 19105a4d..f227e8fe 100644 --- a/node-runner-cli/config/DockerConfig.py +++ b/node-runner-cli/config/DockerConfig.py @@ -101,6 +101,7 @@ def __init__(self, release: str): self.core_node = CoreDockerSettings({}) self.common_config = CommonDockerSettings({}) self.gateway_settings = GatewayDockerSettings({}) + self.migration = CommonMigrationSettings({}) self.core_node.core_release = release def loadConfig(self, file): diff --git a/node-runner-cli/config/SystemDConfig.py b/node-runner-cli/config/SystemDConfig.py index f49f12f3..07c67c25 100644 --- a/node-runner-cli/config/SystemDConfig.py +++ b/node-runner-cli/config/SystemDConfig.py @@ -5,6 +5,7 @@ import yaml from config.BaseConfig import BaseConfig, SetupMode +from config.GatewayDockerConfig import GatewayDockerSettings from config.KeyDetails import KeyDetails from config.MigrationConfig import CommonMigrationSettings from config.Nginx import SystemdNginxConfig @@ -166,7 +167,7 @@ def ask_nginx_release(self): class SystemDSettings(BaseConfig): core_node: CoreSystemdSettings = CoreSystemdSettings({}) common_config: CommonSystemdSettings = CommonSystemdSettings({}) - gateway_settings: None + gateway_settings: GatewayDockerSettings = GatewayDockerSettings({}) migration: CommonMigrationSettings = CommonMigrationSettings({}) def __iter__(self): @@ -186,6 +187,7 @@ def to_yaml(self): config_to_dump["common_config"] = dict(self.common_config) config_to_dump["common_config"]["nginx_settings"] = dict(self.common_config.nginx_settings) config_to_dump["migration"] = dict(self.migration) + config_to_dump["gateway_settings"] = dict(self.gateway_settings) return yaml.dump(config_to_dump, sort_keys=True, default_flow_style=False, explicit_start=True, allow_unicode=True) @@ -196,6 +198,7 @@ def to_file(self, config_file): config_to_dump["common_config"] = dict(self.common_config) config_to_dump["common_config"]["nginx_settings"] = dict(self.common_config.nginx_settings) config_to_dump["migration"] = dict(self.migration) + config_to_dump["gateway_settings"] = dict(self.gateway_settings) with open(config_file, 'w') as f: yaml.dump(config_to_dump, f, sort_keys=True, default_flow_style=False) diff --git a/node-runner-cli/tests/test_config.py b/node-runner-cli/tests/test_config.py index 4c420769..7f0963aa 100644 --- a/node-runner-cli/tests/test_config.py +++ b/node-runner-cli/tests/test_config.py @@ -35,8 +35,8 @@ def test_config_systemd_nginx_can_be_serialized(self): def test_config_systemd_defaut_config_matches_fixture(self): config = SystemDSettings({}) home_directory = Path.home() - config.core_node.node_dir = f"/someDir/babylon-node" - config.core_node.node_secrets_dir = f"/someDir/babylon-node/secret" + config.core_node.node_dir = f"/someDir/babylon-node-config" + config.core_node.node_secrets_dir = f"/someDir/babylon-node-config/secret" config_as_yaml = config.to_yaml() self.maxDiff = None fixture = f"""--- @@ -57,11 +57,37 @@ def test_config_systemd_defaut_config_matches_fixture(self): -Djavax.net.ssl.trustStoreType=jks -Djava.security.egd=file:/dev/urandom -DLog4jContextSelector=org.apache.logging.log4j.core.async.AsyncLoggerContextSelector keydetails: keyfile_name: node-keystore.ks - keyfile_path: {home_directory}/babylon-node + keyfile_path: {home_directory}/babylon-node-config keygen_tag: 1.3.2 - node_dir: /someDir/babylon-node - node_secrets_dir: /someDir/babylon-node/secret + node_dir: /someDir/babylon-node-config + node_secrets_dir: /someDir/babylon-node-config/secret nodetype: fullnode +gateway_settings: + data_aggregator: + coreApiNode: + Name: Core + core_api_address: http://core:3333 + enabled: 'true' + request_weighting: 1 + trust_weighting: 1 + repo: radixdlt/babylon-ng-data-aggregator + restart: unless-stopped + gateway_api: + coreApiNode: + Name: Core + core_api_address: http://core:3333 + enabled: 'true' + request_weighting: 1 + trust_weighting: 1 + enable_swagger: 'true' + max_page_size: '30' + repo: radixdlt/babylon-ng-gateway-api + restart: unless-stopped + postgres_db: + dbname: radixdlt_ledger + host: host.docker.internal:5432 + setup: local + user: postgres migration: olympia_node_auth_password: '' olympia_node_auth_user: '' @@ -80,7 +106,7 @@ def test_config_docker_defaut_config_matches_fixture(self): core_node: nodetype: fullnode keydetails: - keyfile_path: {home_directory}/babylon-node + keyfile_path: {home_directory}/babylon-node-config keyfile_name: node-keystore.ks keygen_tag: 1.3.2 repo: radixdlt/babylon-node From ebfe03a28e706d64c894a9f8511e68c44a572958 Mon Sep 17 00:00:00 2001 From: Kim Fehrs Date: Mon, 24 Jul 2023 15:33:58 +0200 Subject: [PATCH 08/13] add migration and gateway settings to config output --- node-runner-cli/commands/dockercommand.py | 2 ++ node-runner-cli/config/MigrationConfig.py | 8 ++++---- node-runner-cli/templates/radix-fullnode-compose.yml.j2 | 4 ++-- node-runner-cli/utils/Prompts.py | 4 ++-- node-runner-cli/version/__init__.py | 2 +- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/node-runner-cli/commands/dockercommand.py b/node-runner-cli/commands/dockercommand.py index 5652040f..ef06df61 100644 --- a/node-runner-cli/commands/dockercommand.py +++ b/node-runner-cli/commands/dockercommand.py @@ -182,6 +182,8 @@ def config(args): configuration.common_config.nginx_settings = None config_to_dump["common_config"] = dict(configuration.common_config) + config_to_dump["migration"] = dict(configuration.migration) + config_to_dump["gateway_settings"] = dict(configuration.gateway_settings) yaml.add_representer(type(None), Helpers.represent_none) Helpers.section_headline("CONFIG is Generated as below") diff --git a/node-runner-cli/config/MigrationConfig.py b/node-runner-cli/config/MigrationConfig.py index 02285c6d..d907ee24 100644 --- a/node-runner-cli/config/MigrationConfig.py +++ b/node-runner-cli/config/MigrationConfig.py @@ -26,17 +26,17 @@ def ask_migration_config(self, olympia_node_url, olympia_node_auth_user, olympia self.use_olympia = True if olympia_node_url is None: - olympia_node_url = Prompts.ask_olympia_node_url(olympia_node_url) + olympia_node_url = Prompts.ask_olympia_node_url() self.olympia_node_url = olympia_node_url if olympia_node_bech32_address is None: - olympia_node_bech32_address = Prompts.ask_olympia_node_bech32_address(olympia_node_bech32_address) + olympia_node_bech32_address = Prompts.ask_olympia_node_bech32_address() self.olympia_node_bech32_address = olympia_node_bech32_address if olympia_node_auth_user is None: - olympia_node_auth_user = Prompts.ask_olympia_node_auth_user(olympia_node_auth_user) + olympia_node_auth_user = Prompts.ask_olympia_node_auth_user() self.olympia_node_auth_user = olympia_node_auth_user if olympia_node_auth_password is None: - olympia_node_auth_password = Prompts.ask_olympia_node_auth_password(olympia_node_auth_password) + olympia_node_auth_password = Prompts.ask_olympia_node_auth_password() self.olympia_node_auth_password = olympia_node_auth_password diff --git a/node-runner-cli/templates/radix-fullnode-compose.yml.j2 b/node-runner-cli/templates/radix-fullnode-compose.yml.j2 index d6b9ea48..00bbcf95 100644 --- a/node-runner-cli/templates/radix-fullnode-compose.yml.j2 +++ b/node-runner-cli/templates/radix-fullnode-compose.yml.j2 @@ -46,7 +46,7 @@ services: soft: 65536 volumes: {% if core_node.data_directory is defined %} - - core_ledger:/home/radixdlt/RADIXDB + - babylon_ledger:/home/radixdlt/RADIXDB {% endif %} - {{core_node.keydetails.keyfile_path ~ '/' ~ core_node.keydetails.keyfile_name }}:/home/radixdlt/node-keystore.ks {% if common_config.genesis_bin_data_file is defined %} @@ -134,7 +134,7 @@ services: {% endif %} volumes: {% if core_node is defined and core_node.data_directory is defined %} - core_ledger: + babylon_ledger: driver: local driver_opts: device: {{ core_node.data_directory }} diff --git a/node-runner-cli/utils/Prompts.py b/node-runner-cli/utils/Prompts.py index ec74d9ca..e0fde6d6 100644 --- a/node-runner-cli/utils/Prompts.py +++ b/node-runner-cli/utils/Prompts.py @@ -384,7 +384,7 @@ def ask_olympia_node_auth(cls) -> str: def ask_olympia_node_auth_user(cls) -> str: Helpers.section_headline("Migration: Olympia API Authentication") answer = Helpers.input_guestion( - f"Enter the credentials for your olympia node. Leave blank if no authentication is required: \n User:" + f"Enter the credentials for your olympia node. Leave blank if no authentication is required: \nUser:" , QuestionKeys.olympia_migrations_user) return answer @@ -398,6 +398,6 @@ def ask_olympia_node_auth_password(cls) -> str: @classmethod def ask_olympia_node_bech32_address(cls) -> str: answer = Helpers.input_guestion( - f"Enter the bech32 address of your olympia node" + f"Enter the bech32 address of your olympia node." , QuestionKeys.olympia_migrations_bech32) return answer diff --git a/node-runner-cli/version/__init__.py b/node-runner-cli/version/__init__.py index 208525fe..f46cdce6 100644 --- a/node-runner-cli/version/__init__.py +++ b/node-runner-cli/version/__init__.py @@ -1,2 +1,2 @@ -__version__= "2.0.rcnet-v2-rc1-4-g2ddb3a7" +__version__= "2.0.rcnet-v2-rc1-7-g1319a13" __base_version__= "2.0.rcnet-v2-rc1" From 0d26e890089568c28fb713fb64b9eca3607b6f88 Mon Sep 17 00:00:00 2001 From: Kim Fehrs Date: Mon, 24 Jul 2023 15:42:11 +0200 Subject: [PATCH 09/13] fix workflow syntax --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 09d186cc..e92b80b6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -80,6 +80,7 @@ jobs: path: "${{ github.workspace }}/node-runner-cli/out/ubuntu/jammy/radixnode" - name: Build the binary for ubuntu focal run: | + cd node-runner-cli make output-ubuntu-focal env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 6535f6883b84d0de9f041162d1d269f18b093b88 Mon Sep 17 00:00:00 2001 From: Kim Fehrs Date: Mon, 24 Jul 2023 17:09:21 +0200 Subject: [PATCH 10/13] update workflow to specify config directory --- .github/workflows/ci.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e92b80b6..a310788e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -274,6 +274,7 @@ jobs: echo "PATH=$PWD" export PROMPT_FEEDS="node-runner-cli/test-prompts/core-gateway-all-local.yml" ./radixnode docker config -m DETAILED \ + -d $HOME/node-config \ -k $KEYSTORE_PASSWORD -nk -a env: KEYSTORE_PASSWORD: ${{secrets.KEYSTORE_PASSWORD}} @@ -286,6 +287,7 @@ jobs: chmod +x ./radixnode export PROMPT_FEEDS="node-runner-cli/test-prompts/corenode-01.yml" ./radixnode docker config -m DETAILED \ + -d $HOME/node-config \ -k $KEYSTORE_PASSWORD -nk -a env: KEYSTORE_PASSWORD: ${{secrets.KEYSTORE_PASSWORD}} @@ -297,6 +299,7 @@ jobs: ls -a export PROMPT_FEEDS="node-runner-cli/test-prompts/corenode-02.yml" ./radixnode docker config -m DETAILED \ + -d $HOME/node-config \ -k $KEYSTORE_PASSWORD -nk -a env: KEYSTORE_PASSWORD: ${{secrets.KEYSTORE_PASSWORD}} @@ -309,6 +312,7 @@ jobs: # ls -a # export PROMPT_FEEDS="node-runner-cli/test-prompts/gateway-remote-core-local-postgress.yml" # ./radixnode docker config -m DETAILED \ +# -d $HOME/node-config \ # -k $KEYSTORE_PASSWORD -nk -a # env: # KEYSTORE_PASSWORD: ${{secrets.KEYSTORE_PASSWORD}} @@ -319,6 +323,7 @@ jobs: # ls -a # export PROMPT_FEEDS="node-runner-cli/test-prompts/gateway-remote-core-remote-postgress.yml" # ./radixnode docker config -m DETAILED \ +# -d $HOME/node-config \ # -k $KEYSTORE_PASSWORD -nk -a # env: # KEYSTORE_PASSWORD: ${{secrets.KEYSTORE_PASSWORD}} @@ -357,6 +362,7 @@ jobs: export DOCKER_COMPOSE_LOCATION="/usr/local/bin/docker-compose" export PROMPT_FEEDS="node-runner-cli/test-prompts/core-gateway-all-local.yml" ./radixnode docker config -m DETAILED \ + -d $HOME/node-config \ -k $KEYSTORE_PASSWORD -nk -a env: KEYSTORE_PASSWORD: ${{secrets.KEYSTORE_PASSWORD}} From c38c3db88191a0c4ec98e007d7b97e1ff884ada3 Mon Sep 17 00:00:00 2001 From: Kim Fehrs Date: Wed, 26 Jul 2023 12:48:47 +0200 Subject: [PATCH 11/13] minor bugfixes regarding usability and templating --- Readme.adoc | 56 ------------------- node-runner-cli/commands/systemdcommand.py | 12 +++- node-runner-cli/config/SystemDConfig.py | 1 + node-runner-cli/setup/SystemD.py | 3 +- .../templates/systemd-default.config.j2 | 6 +- node-runner-cli/utils/Prompts.py | 5 +- node-runner-cli/version/__init__.py | 2 +- 7 files changed, 17 insertions(+), 68 deletions(-) diff --git a/Readme.adoc b/Readme.adoc index 862cd58d..cf5b1171 100644 --- a/Readme.adoc +++ b/Readme.adoc @@ -94,59 +94,3 @@ optional arguments: -h, --help show this help message and exit ---- - - -== Testing with babylon releases - -The babylon release is still not public. Therefor testing with babylon will be difficult. -Docker images, version references and binaries can not be fetched without authorization. Because of this, we added this -documentation as a guideline on how to work with babylon. - -[source, bash] ----- -# This command references https://raw.githubusercontent.com/radixdlt/babylon-nodecli -# It needs access to github in order to load the ansible files. The babylon-nodecli repository is still private. -# So a private access token (PAT) is required. This can be put into the environment variable GITHUB_TOKEN and will then -# be used to fetch the ansible script. -# See here for more information on PAT: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token -export GITHUB_TOKEN="token " -/tmp/radixnode docker dependencies - - -# This command heavily uses latest_version. This function extracts the latest -# version of a resource/repo from github releases. Since the repositories are -# private, fetching the latest version also requires a PAT. See above. - - -export GITHUB_TOKEN="token " -/tmp/radixnode docker config -m CORE - -# There is however not a release yet for all resources. So fetching the latest -# version might not always be possible. This is the case for the gateway for -# example. This can be solved by manually overriding the version of these resources. -# Use the below mentioned environment variables for that. -export RADIXDLT_APP_VERSION_OVERRIDE=1.3.1 -export RADIXDLT_NGINX_VERSION_OVERRIDE=1.3.3 -export RADIXDLT_CLI_VERSION_OVERRIDE=1.3.2 -export RADIXDLT_GATEWAY_VERSION_OVERRIDE=1.5.0 -/tmp/radixnode docker config -m CORE GATEWAY - - -# Will try to download ansible playbooks as a resource from a github release at: -# https://raw.githubusercontent.com/radixdlt/babylon-nodecli//node-runner-cli -# Make sure your CLI version is set to a released version of the babylon-nodecli. -# This is done by setting a tag at the current commit before building the binary. -# It will also try to download docker images. As these are not public yet, it is -# mandatory to download the image you are trying to test youself beforehand. -# For this you need to log in to the google registry, download the image and -# then retag it to the expected format. See the example - - -docker login eu.gcr.io # keeping this secret -docker pull eu.gcr.io/dev-container-repo/babylon-node:pr-247 -docker tag eu.gcr.io/dev-container-repo/babylon-node:pr-247 radixdlt/babylon-node:$RADIXDLT_APP_VERSION_OVERRIDE -docker pull radixdlt/babylon-nginx:development-latest -docker tag radixdlt/babylon-nginx:development-latest radixdlt/babylon-nginx:$RADIXDLT_NGINX_VERSION_OVERRIDE - -/tmp/radixnode docker install ----- \ No newline at end of file diff --git a/node-runner-cli/commands/systemdcommand.py b/node-runner-cli/commands/systemdcommand.py index 4cf37574..c8faa17a 100644 --- a/node-runner-cli/commands/systemdcommand.py +++ b/node-runner-cli/commands/systemdcommand.py @@ -144,6 +144,9 @@ def config(args): config_to_dump["common_config"] = dict(configuration.common_config) + config_to_dump["migration"] = dict(configuration.migration) + config_to_dump["gateway_settings"] = dict(configuration.gateway_settings) + yaml.add_representer(type(None), Helpers.represent_none) Helpers.section_headline("CONFIG is Generated as below") print(f"\n{yaml.dump(config_to_dump)}") @@ -271,14 +274,19 @@ def restart(args): sys.exit(1) -@systemdcommand([]) +@systemdcommand([ + argument("-s", "--skip", default="false", + help="Skip installation of base dependencies", + action="store_true") +]) def dependencies(args): """ This commands installs all necessary software on the Virtual Machine(VM). Run this command on fresh VM or on an existing VM as the command is tested to be idempotent """ - Base.dependencies() + if not args.skip: + Base.dependencies() SystemD.install_java() SystemD.setup_user() SystemD.make_etc_directory() diff --git a/node-runner-cli/config/SystemDConfig.py b/node-runner-cli/config/SystemDConfig.py index 07c67c25..25f9927f 100644 --- a/node-runner-cli/config/SystemDConfig.py +++ b/node-runner-cli/config/SystemDConfig.py @@ -263,4 +263,5 @@ def from_dict(dictionary: dict) -> SystemDSettings: settings.core_node.keydetails = KeyDetails(dictionary["core_node"]["keydetails"]) settings.common_config = CommonSystemdSettings(dictionary["common_config"]) settings.common_config.nginx_settings = SystemdNginxConfig(dictionary["common_config"]["nginx_settings"]) + settings.migration = CommonMigrationSettings(dictionary["migration"]) return settings diff --git a/node-runner-cli/setup/SystemD.py b/node-runner-cli/setup/SystemD.py index 8212e810..f8354edc 100644 --- a/node-runner-cli/setup/SystemD.py +++ b/node-runner-cli/setup/SystemD.py @@ -111,7 +111,8 @@ def download_binaries(binary_location_url, library_location_url, node_dir, node_ run_shell_command( ['wget', '--no-check-certificate', '-O', 'babylon-node-lib.zip', library_location_url]) run_shell_command('unzip babylon-node-lib.zip', shell=True) - run_shell_command(f'mkdir -p /usr/lib/jni', shell=True) + run_shell_command(f'sudo mkdir -p /usr/lib/jni', shell=True) + run_shell_command(f'sudo chown radixdlt:radixdlt /usr/lib/jni', shell=True) run_shell_command(f'sudo mv libcorerust.so /usr/lib/jni/libcorerust.so', shell=True) @staticmethod diff --git a/node-runner-cli/templates/systemd-default.config.j2 b/node-runner-cli/templates/systemd-default.config.j2 index bdd5248f..18a30816 100644 --- a/node-runner-cli/templates/systemd-default.config.j2 +++ b/node-runner-cli/templates/systemd-default.config.j2 @@ -27,12 +27,8 @@ db.location=/home/radixdlt/babylon-ledger consensus.validator_address={{core_node.validator_address}} {% endif %} -{% if migration.use_olympia is defined %} -{% if migration.use_olympia %} genesis.use_olympia={{migration.use_olympia}} genesis.olympia.node_core_api_url={{migration.olympia_node_url}} genesis.olympia.node_core_api_auth_user={{migration.olympia_node_auth_user}} genesis.olympia.node_core_api_auth_password={{migration.olympia_node_auth_password}} -genesis.olympia.node_bech32_address={{migration.olympia_node_bech32_address}} -{% endif %} -{% endif %} \ No newline at end of file +genesis.olympia.node_bech32_address={{migration.olympia_node_bech32_address}} \ No newline at end of file diff --git a/node-runner-cli/utils/Prompts.py b/node-runner-cli/utils/Prompts.py index e0fde6d6..d95f5158 100644 --- a/node-runner-cli/utils/Prompts.py +++ b/node-runner-cli/utils/Prompts.py @@ -201,14 +201,13 @@ def ask_keyfile_name() -> str: @staticmethod def ask_trusted_node() -> str: Helpers.section_headline("Trusted node settings") - default_trusted_nodes = "radix://node_tdx_d_1qwq2nfe6vxqwe3mqmfm9l2xl97as7lkwndval63cymvc3qszn8nqx6g2s3m@3.109.161.178" + # default_trusted_nodes = "radix://node_tdx_d_1qwq2nfe6vxqwe3mqmfm9l2xl97as7lkwndval63cymvc3qszn8nqx6g2s3m@3.109.161.178" value = Helpers.input_guestion(f"Fullnode requires another node to connect to network. " # ToDo: Add after main release of babylon # "\nTo connect to MAINNET or STOKENET details on these node can be found here " # "- https://docs.radixdlt.com/main/node-and-gateway/seed-nodes.html" "\nType in the node you want to connect to in format radix://@" - "\n OR press Enter to accept default for ansharnet/rcnet-v2-phase1 :" - f"{default_trusted_nodes}", + "\n OR press Enter to accept default for ansharnet/rcnet-v2-phase1 :", QuestionKeys.input_seednode) trustednode = Prompts.check_default(value, default_trusted_nodes) Helpers.parse_trustednode(trustednode) diff --git a/node-runner-cli/version/__init__.py b/node-runner-cli/version/__init__.py index f46cdce6..bc13eaa7 100644 --- a/node-runner-cli/version/__init__.py +++ b/node-runner-cli/version/__init__.py @@ -1,2 +1,2 @@ -__version__= "2.0.rcnet-v2-rc1-7-g1319a13" +__version__= "2.0.rcnet-v2-rc1-10-g6535f68" __base_version__= "2.0.rcnet-v2-rc1" From a9fd4e148ed93f6404c0c9f2fd359a085b7d78f8 Mon Sep 17 00:00:00 2001 From: Kim Fehrs Date: Wed, 26 Jul 2023 12:53:26 +0200 Subject: [PATCH 12/13] fix unit test bugs --- node-runner-cli/templates/systemd-default.config.j2 | 6 +++++- node-runner-cli/utils/Prompts.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/node-runner-cli/templates/systemd-default.config.j2 b/node-runner-cli/templates/systemd-default.config.j2 index 18a30816..bdd5248f 100644 --- a/node-runner-cli/templates/systemd-default.config.j2 +++ b/node-runner-cli/templates/systemd-default.config.j2 @@ -27,8 +27,12 @@ db.location=/home/radixdlt/babylon-ledger consensus.validator_address={{core_node.validator_address}} {% endif %} +{% if migration.use_olympia is defined %} +{% if migration.use_olympia %} genesis.use_olympia={{migration.use_olympia}} genesis.olympia.node_core_api_url={{migration.olympia_node_url}} genesis.olympia.node_core_api_auth_user={{migration.olympia_node_auth_user}} genesis.olympia.node_core_api_auth_password={{migration.olympia_node_auth_password}} -genesis.olympia.node_bech32_address={{migration.olympia_node_bech32_address}} \ No newline at end of file +genesis.olympia.node_bech32_address={{migration.olympia_node_bech32_address}} +{% endif %} +{% endif %} \ No newline at end of file diff --git a/node-runner-cli/utils/Prompts.py b/node-runner-cli/utils/Prompts.py index d95f5158..6feb078c 100644 --- a/node-runner-cli/utils/Prompts.py +++ b/node-runner-cli/utils/Prompts.py @@ -201,7 +201,7 @@ def ask_keyfile_name() -> str: @staticmethod def ask_trusted_node() -> str: Helpers.section_headline("Trusted node settings") - # default_trusted_nodes = "radix://node_tdx_d_1qwq2nfe6vxqwe3mqmfm9l2xl97as7lkwndval63cymvc3qszn8nqx6g2s3m@3.109.161.178" + default_trusted_nodes = "radix://node_tdx_d_1qwq2nfe6vxqwe3mqmfm9l2xl97as7lkwndval63cymvc3qszn8nqx6g2s3m@3.109.161.178" value = Helpers.input_guestion(f"Fullnode requires another node to connect to network. " # ToDo: Add after main release of babylon # "\nTo connect to MAINNET or STOKENET details on these node can be found here " From f529843860c315e48f6bef26f47394e02f1658d3 Mon Sep 17 00:00:00 2001 From: Kim Fehrs Date: Wed, 26 Jul 2023 13:14:55 +0200 Subject: [PATCH 13/13] fix bug where the release would try to write both ubuntu versions to the same release file --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a310788e..6ba071c5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -168,7 +168,7 @@ jobs: with: upload_url: ${{ github.event.release.upload_url }} asset_path: ./radixnode - asset_name: radixnode-ubuntu-22.04 + asset_name: radixnode-ubuntu-20.04 asset_content_type: application/octet-stream if: ${{ github.event_name == 'release' }}