Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/olympia end state api changes #51

Merged
merged 4 commits into from
Aug 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,9 @@ jobs:
echo "HOME=$HOME"
echo "PATH=$PWD"
./babylonnode systemd config -m CORE \
-n 13 \
-t radix://node_tdx_d_1qwq2nfe6vxqwe3mqmfm9l2xl97as7lkwndval63cymvc3qszn8nqx6g2s3m@3.109.161.178 \
-i 35.178.142.54 \
-n 14 \
-t radix://node_tdx_e_1q0gm3fwqh8ggl09g7l8ru96krzlxdyrc694mqw8cf227v62vjyrmccv8md5@13.126.65.118 \
-i 13.126.65.118 \
-v "not_a_real_validator_address" \
-k $KEYSTORE_PASSWORD -nk -a \
-dd $HOME/babylon-ledger
Expand Down Expand Up @@ -462,7 +462,7 @@ jobs:
chmod +x ./babylonnode
mkdir -p $HOME/babylon-node-config
export DISABLE_VERSION_CHECK=true
export RADIXDLT_APP_VERSION_OVERRIDE="rcnet-v2-phase2-r4"
export RADIXDLT_APP_VERSION_OVERRIDE="rcnet-v3-r2"
export DOCKER_COMPOSE_LOCATION="/usr/local/bin/docker-compose"
export PROMPT_FEEDS="node-runner-cli/test-prompts/core-gateway-all-local.yml"
./babylonnode docker config -m DETAILED \
Expand Down
2 changes: 1 addition & 1 deletion node-runner-cli/commands/dockercommand.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def dockercommand(dockercommand_args=[], parent=docker_parser):
default=""),
argument("-t", "--trustednode",
help="Trusted node on radix network."
"Example format: 'radix://node_tdx_d_1qwq2nfe6vxqwe3mqmfm9l2xl97as7lkwndval63cymvc3qszn8nqx6g2s3m@3.109.161.178'."
"Example format: 'radix://node_tdx_e_1q0gm3fwqh8ggl09g7l8ru96krzlxdyrc694mqw8cf227v62vjyrmccv8md5@13.126.65.118'."
"This is required only if you are creating config to run a CORE node and "
"if not provided you will be prompted to enter a value",
default="",
Expand Down
6 changes: 3 additions & 3 deletions node-runner-cli/release_ymls/radix-fullnode-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ services:
RADIXDLT_API_PORT: 3333
RADIXDLT_GENESIS_DATA_FILE: /home/radixdlt/genesis_data_file.bin
RADIXDLT_LOG_LEVEL: info
RADIXDLT_NETWORK_ID: 13
RADIXDLT_NETWORK_ID: 14
RADIXDLT_NETWORK_SEEDS_REMOTE: "${RADIXDLT_NETWORK_NODE}"
RADIXDLT_NETWORK_USE_PROXY_PROTOCOL: 'false'
RADIXDLT_SIGN_ENABLE: 'true'
RADIXDLT_TRANSACTIONS_API_ENABLE: 'false'
RADIXDLT_VALIDATOR_KEY_LOCATION: /home/radixdlt/node-keystore.ks
RADIX_NODE_KEYSTORE_PASSWORD: "${RADIXDLT_NODE_KEY_PASSWORD}"
image: radixdlt/babylon-node:rcnet-v2-phase2-r4
image: radixdlt/babylon-node:rcnet-v3-r2
init: true
mem_limit: 12000m
restart: unless-stopped
Expand All @@ -30,7 +30,7 @@ services:
volumes:
- babylon_ledger:/home/radixdlt/RADIXDB
- /home/radixdlt/babylon-node-config/node-keystore.ks:/home/radixdlt/node-keystore.ks
- /home/radixdlt/ansharnet_genesis_data_file.bin:/home/radixdlt/genesis_data_file.bin
- /home/radixdlt/zabanet_genesis_data_file.bin:/home/radixdlt/genesis_data_file.bin
nginx:
environment:
RADIXDLT_GATEWAY_API_ENABLE: 'true'
Expand Down
6 changes: 3 additions & 3 deletions node-runner-cli/templates/radix-fullnode-compose.yml.j2
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ services:
{% 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_END_STATE_API_URL: '{{migration.olympia_node_url}}'
RADIXDLT_GENESIS_OLYMPIA_NODE_END_STATE_API_AUTH_USER: '{{migration.olympia_node_auth_user}}'
RADIXDLT_GENESIS_OLYMPIA_NODE_END_STATE_API_AUTH_PASSWORD: '{{migration.olympia_node_auth_password}}'
RADIXDLT_GENESIS_OLYMPIA_NODE_BECH32_ADDRESS: '{{migration.olympia_node_bech32_address}}'
{% endif %}
{% endif %}
Expand Down
6 changes: 3 additions & 3 deletions node-runner-cli/templates/systemd-default.config.j2
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ consensus.validator_address={{core_node.validator_address}}
{% 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_end_state_api_url={{migration.olympia_node_url}}
genesis.olympia.node_end_state_api_auth_user={{migration.olympia_node_auth_user}}
genesis.olympia.node_end_state_api_auth_password={{migration.olympia_node_auth_password}}
genesis.olympia.node_bech32_address={{migration.olympia_node_bech32_address}}
{% endif %}
{% endif %}
4 changes: 2 additions & 2 deletions node-runner-cli/test-prompts/core-gateway-all-local.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- select_network: "13"
- select_network: "14"
- first_time_config: Y
- setup_fullnode: Y
- input_seednode: "radix://node_tdx_d_1qwq2nfe6vxqwe3mqmfm9l2xl97as7lkwndval63cymvc3qszn8nqx6g2s3m@3.109.161.178"
- input_seednode: "radix://node_tdx_e_1q0gm3fwqh8ggl09g7l8ru96krzlxdyrc694mqw8cf227v62vjyrmccv8md5@13.126.65.118"
- have_validator_address: "N"
- have_keystore_file: Y
- input_path_keystore: "/home/runner/babylon-node"
Expand Down
4 changes: 2 additions & 2 deletions node-runner-cli/test-prompts/corenode-01.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
- select_network: "13"
- select_network: "14"
- first_time_config: Y
- setup_fullnode: Y
- input_seednode: "radix://node_tdx_d_1qwq2nfe6vxqwe3mqmfm9l2xl97as7lkwndval63cymvc3qszn8nqx6g2s3m@3.109.161.178"
- input_seednode: "radix://node_tdx_e_1q0gm3fwqh8ggl09g7l8ru96krzlxdyrc694mqw8cf227v62vjyrmccv8md5@13.126.65.118"
- have_validator_address: "N"
- have_keystore_file: Y
- input_path_keystore: "/home/runner/babylon-node"
Expand Down
4 changes: 2 additions & 2 deletions node-runner-cli/test-prompts/corenode-02.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
---
- select_network: "13"
- select_network: "14"
- first_time_config: N
- have_existing_compose: "/home/runner/docker-compose.yml"
- setup_fullnode: Y
- input_seednode: "radix://node_tdx_d_1qwq2nfe6vxqwe3mqmfm9l2xl97as7lkwndval63cymvc3qszn8nqx6g2s3m@3.109.161.178"
- input_seednode: "radix://node_tdx_e_1q0gm3fwqh8ggl09g7l8ru96krzlxdyrc694mqw8cf227v62vjyrmccv8md5@13.126.65.118"
- have_validator_address: "N"
- have_keystore_file: N
- input_path_keystore: "/home/runner/babylon-node"
Expand Down
Binary file not shown.
16 changes: 8 additions & 8 deletions node-runner-cli/tests/fixtures/config-gateway-docker.yaml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
common_config:
docker_compose: /home/radixdlt/docker-compose.yml
genesis_bin_data_file: /home/radixdlt/ansharnet_genesis_data_file.bin
network_id: 13
network_name: ansharnet
genesis_bin_data_file: /home/radixdlt/zabanet_genesis_data_file.bin
network_id: 14
network_name: zabanet
nginx_settings:
enable_transaction_api: 'true'
gateway_behind_auth: 'true'
Expand All @@ -13,7 +13,7 @@ common_config:
repo: radixdlt/babylon-nginx
core_node:
composefileurl: ''
core_release: rcnet-v2-phase2-r4
core_release: rcnet-v3-r2
data_directory: /home/radixdlt/babylon-ledger
enable_transaction: 'true'
java_opts: --enable-preview -server -Xms8g -Xmx8g -XX:MaxDirectMemorySize=2048m
Expand All @@ -26,7 +26,7 @@ core_node:
keystore_password: radix
nodetype: fullnode
repo: radixdlt/babylon-node
trusted_node: radix://node_tdx_d_1qwq2nfe6vxqwe3mqmfm9l2xl97as7lkwndval63cymvc3qszn8nqx6g2s3m@3.109.161.178
trusted_node: radix://node_tdx_e_1q0gm3fwqh8ggl09g7l8ru96krzlxdyrc694mqw8cf227v62vjyrmccv8md5@13.126.65.118
validator_address: ''
gateway:
data_aggregator:
Expand All @@ -41,11 +41,11 @@ gateway:
enabled: 'true'
request_weighting: 1
trust_weighting: 1
release: rcnet-v2-phase2-r4
release: rcnet-v3-r2
repo: radixdlt/babylon-ng-data-aggregator
restart: unless-stopped
database_migration:
release: rcnet-v2-phase2-r4
release: rcnet-v3-r2
repo: radixdlt/babylon-ng-database-migrations
docker_compose: /home/radixdlt/gateway.docker-compose.yml
enabled: true
Expand All @@ -62,7 +62,7 @@ gateway:
trust_weighting: 1
enable_swagger: 'true'
max_page_size: '30'
release: rcnet-v2-phase2-r4
release: rcnet-v3-r2
repo: radixdlt/babylon-ng-gateway-api
restart: unless-stopped
postgres_db:
Expand Down
12 changes: 6 additions & 6 deletions node-runner-cli/tests/fixtures/gateway-docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: '3.8'
services:
gateway_api: # This is the base -- the _image and _built containers are defined below
image: radixdlt/babylon-ng-gateway-api:rcnet-v2-phase2-r4
image: radixdlt/babylon-ng-gateway-api:rcnet-v3-r2
ports:
- "127.0.0.1:5207:80" # This allows you to connect to the API at http://localhost:5308
- "127.0.0.1:1235:1235" # This allows you to connect to the metrics API at http://localhost:1235
Expand All @@ -15,10 +15,10 @@ services:
ConnectionStrings__NetworkGatewayReadOnly: "Host=host.docker.internal:5432;Database=radixdlt_ledger;Username=postgres;Password=postgres"
ConnectionStrings__NetworkGatewayReadWrite: "Host=host.docker.internal:5432;Database=radixdlt_ledger;Username=postgres;Password=postgres"
GatewayApi__Endpoints_MaxPageSize: "30"
GatewayApi__Endpoint__GatewayApiVersion: rcnet-v2-phase2-r4
GatewayApi__Endpoint__GatewayApiVersion: rcnet-v3-r2
# GatewayApi__MaxWaitForDbOnStartupMs: "90" # Wait for PostGres to boot up
GatewayApi__Network__DisableCoreApiHttpsCertificateChecks: "true"
GatewayApi__Network__NetworkName: "ansharnet"
GatewayApi__Network__NetworkName: "zabanet"
GatewayApi__Network__CoreApiNodes__0__Name: "CoreNode"
GatewayApi__Network__CoreApiNodes__0__CoreApiAddress: "https://host.docker.internal:443/core"
GatewayApi__Network__CoreApiNodes__0__CoreApiAuthorizationHeader: "Basic YWRtaW46cmFkaXg="
Expand All @@ -27,7 +27,7 @@ services:
data_aggregator:
depends_on:
- database_migrations
image: radixdlt/babylon-ng-data-aggregator:rcnet-v2-phase2-r4
image: radixdlt/babylon-ng-data-aggregator:rcnet-v3-r2
restart: unless-stopped
cpus: 2.0
extra_hosts:
Expand All @@ -42,14 +42,14 @@ services:
PrometheusMetricsPort: "1234"
DataAggregator__Network__MaxWaitForDbOnStartupMs: "1000"
DataAggregator__Network__DisableCoreApiHttpsCertificateChecks: "true"
DataAggregator__Network__NetworkName: "ansharnet"
DataAggregator__Network__NetworkName: "zabanet"
DataAggregator__Network__CoreApiNodes__0__Name: "CoreNode"
DataAggregator__Network__CoreApiNodes__0__CoreApiAddress: "https://host.docker.internal:443/core"
DataAggregator__Network__CoreApiNodes__0__CoreApiAuthorizationHeader: "Basic YWRtaW46cmFkaXg="
DataAggregator__Network__CoreApiNodes__0__TrustWeighting: "1"
DataAggregator__Network__CoreApiNodes__0__Enabled: "true"
database_migrations: # This is the base -- the _image and _built containers are defined below
image: radixdlt/babylon-ng-database-migrations:rcnet-v2-phase2-r4
image: radixdlt/babylon-ng-database-migrations:rcnet-v3-r2
environment:
ConnectionStrings__NetworkGatewayMigrations: Host=host.docker.internal:5432;Database=radixdlt_ledger;Username=postgres;Password=postgres
extra_hosts:
Expand Down
10 changes: 5 additions & 5 deletions node-runner-cli/tests/test_gateway_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def setUpClass(cls):
cls.fixture.gateway.data_aggregator.coreApiNode = cls.fixture.gateway.gateway_api.coreApiNode
# cls.fixture.gateway.data_aggregator.release = "testrelease"
# cls.fixture.gateway.data_aggregator.repo = "radixdlt/gateway-test-dummy"
cls.fixture.gateway.data_aggregator.NetworkName = "ansharnet"
cls.fixture.gateway.data_aggregator.NetworkName = "zabanet"

# cls.fixture.gateway.database_migration.release = "testrelease"
# cls.fixture.gateway.database_migration.repo = "radixdlt/gateway-test-dummy"
Expand Down Expand Up @@ -157,9 +157,9 @@ def test_setup_gateway_compose_file_fixture_test(self, mockout):
# Takes default values
questionary_keyboard_input = ["https://host.docker.internal:443/core", "admin", "radix", "true",
"CoreNode",
"rcnet-v2-phase2-r4",
"rcnet-v2-phase2-r4",
"rcnet-v2-phase2-r4",
"rcnet-v3-r2",
"rcnet-v3-r2",
"rcnet-v3-r2",
"local",
"radixdlt_ledger",
"postgres"]
Expand All @@ -173,7 +173,7 @@ def test_setup_gateway_compose_file_fixture_test(self, mockout):
self.assertEqual("postgres", config.gateway.postgres_db.password)

# Have to manually set this because we skipped systemd setup
config.common_config.network_name = "ansharnet"
config.common_config.network_name = "zabanet"
config.gateway.enabled = True

self.expect_ask_gateway_inputs_get_inserted_into_object(config, questionary_keyboard_input)
Expand Down
11 changes: 6 additions & 5 deletions node-runner-cli/utils/Network.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def get_network_id() -> int:
Helpers.section_headline(f"Network connection")
# TODO change this for rcnet launch
network_prompt = Helpers.input_guestion(
"Enter the network_id. The network id for the most recent network (ansharnet / rcnet-v2 phase 2) is 13:",
"Enter the network_id. The network id for the most recent network (Zabanet / rcnet-v3 ) is 14:",
QuestionKeys.select_network)
network_id = Network.validate_network_id(network_prompt)
return network_id
Expand All @@ -34,11 +34,11 @@ def validate_network_id(network_prompt: str) -> int:

@staticmethod
def path_to_genesis_binary(network_id: int) -> str:
if network_id not in [1, 2] and network_id == 13:
if os.path.exists("ansharnet_genesis_data_file.bin"):
run_shell_command('sudo rm ansharnet_genesis_data_file.bin', shell=True)
if network_id not in [1, 2] and network_id == 14:
if os.path.exists("zabanet_genesis_data_file.bin"):
run_shell_command('sudo rm zabanet_genesis_data_file.bin', shell=True)
genesis_bin_file = GenesisConfig.copy_genesis_file(
"ansharnet_genesis_data_file.bin")
"zabanet_genesis_data_file.bin")
else:
genesis_bin_file = None

Expand All @@ -53,6 +53,7 @@ def get_network_id_names() -> dict:
11: "nebunet",
12: "kisharnet",
13: "ansharnet",
14: "zabanet",
32: "gilganet",
33: "enkinet",
34: "hammunet",
Expand Down
4 changes: 2 additions & 2 deletions node-runner-cli/utils/Prompts.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,12 +201,12 @@ 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_e_1q0gm3fwqh8ggl09g7l8ru96krzlxdyrc694mqw8cf227v62vjyrmccv8md5@13.126.65.118"
value = Helpers.input_guestion(f"Fullnode requires another node to connect to network. "
# "\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://<node-peer-2-peer-address>@<ip>"
"\n OR press Enter to accept defaults for ansharnet (rcnet-v2 phase 2):",
"\n OR press Enter to accept defaults for Zabanet (rcnet-v3):",
QuestionKeys.input_seednode)
trustednode = Prompts.check_default(value, default_trusted_nodes)
Helpers.parse_trustednode(trustednode)
Expand Down