From 747e7de61fc4647fb856ecc983d5b1e93b6487a1 Mon Sep 17 00:00:00 2001 From: abhiyana Date: Thu, 14 Dec 2023 13:14:49 +0530 Subject: [PATCH 1/5] fix: fix issue when the node type is anything which is not valid the node still runs --- main.star | 4 ++++ package_io/utils.star | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/main.star b/main.star index 8d6059c..776305e 100644 --- a/main.star +++ b/main.star @@ -4,6 +4,7 @@ package = import_module("./package_io/build-spec.star") promethues = import_module("./package_io/promethues.star") grafana = import_module("./package_io/grafana.star") explorer = import_module("./package_io/polkadot_js_app.star") +utils = import_module("./package_io/utils.star") def run(plan, args): """ @@ -31,6 +32,9 @@ def run_polkadot_setup(plan, args): Returns: dict: Service details containing information about relay chains, parachains, and Prometheus. """ + + utils.check_config_validity(plan, args) + plan.upload_files(src = "./parachain/static_files/configs", name = "configs") plan.upload_files(src = "./parachain/static_files/javascript", name = "javascript") diff --git a/package_io/utils.star b/package_io/utils.star index b2c96cd..2cc333f 100644 --- a/package_io/utils.star +++ b/package_io/utils.star @@ -52,3 +52,22 @@ def get_service_url(protocol ,ip_address, ports): url = "{0}://{1}:{2}".format(protocol, ip_address, ports) return url + +def check_config_validity(plan, args): + if len(args["relaychain"]) != 0: + for node in args["relaychain"]["nodes"]: + if len(node) != 0: + if node["node-type"] in ["validator", "full"]: + plan.print("config for relaynodes is valid") + else: + return fail("relaychain node-type can be only validator/full") + + if len(args["para"]) != 0: + for para in args["para"]: + if len(para["nodes"]) != 0: + for node in para["nodes"]: + if node["node-type"] in ["validator", "full", "collator"]: + plan.print("config for parachain is valid") + else: + return fail("parachain node-type can be only validator/full/collator") + From 99231bb57cac597f1ff2e0fbe9fa167b85df7fae Mon Sep 17 00:00:00 2001 From: abhiyana Date: Thu, 14 Dec 2023 14:32:40 +0530 Subject: [PATCH 2/5] fix: fix khala mainnet ws-port issue --- package_io/constant.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_io/constant.star b/package_io/constant.star index 748393b..5b68fdb 100644 --- a/package_io/constant.star +++ b/package_io/constant.star @@ -5,7 +5,7 @@ CURL_JQ_IMAGE = "badouralix/curl-jq" NODE_IMAGE = "hugobyte/parachain-node-modules" PARA_SLOT_REGISTER_SERVICE_NAME = "para-slot-registration" BINARY_COMMAND_CHAINS = ["manta", "khala", "phala", "clover", "calamari", "subzero", "robonomics"] -NO_WS_PORT = ["acala", "frequency", "moonbeam", "karura", "ajuna", "bajun", "centrifuge", "moonsama", "encointer", "moonriver", "altair", "mangata"] +NO_WS_PORT = ["acala", "frequency", "moonbeam", "karura", "ajuna", "bajun", "centrifuge", "moonsama", "encointer", "moonriver", "altair", "mangata", "khala"] DIFFERENT_IMAGES_FOR_MAINNET = { "centrifuge": "centrifugeio/centrifuge-chain:main-latest", From 381d19176469b8be64c2cc434a08ef6ec6e743a7 Mon Sep 17 00:00:00 2001 From: abhiyana Date: Thu, 14 Dec 2023 14:40:48 +0530 Subject: [PATCH 3/5] fix: fix issue of -ws-port for phala --- package_io/constant.star | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package_io/constant.star b/package_io/constant.star index 5b68fdb..bc76cd2 100644 --- a/package_io/constant.star +++ b/package_io/constant.star @@ -5,7 +5,7 @@ CURL_JQ_IMAGE = "badouralix/curl-jq" NODE_IMAGE = "hugobyte/parachain-node-modules" PARA_SLOT_REGISTER_SERVICE_NAME = "para-slot-registration" BINARY_COMMAND_CHAINS = ["manta", "khala", "phala", "clover", "calamari", "subzero", "robonomics"] -NO_WS_PORT = ["acala", "frequency", "moonbeam", "karura", "ajuna", "bajun", "centrifuge", "moonsama", "encointer", "moonriver", "altair", "mangata", "khala"] +NO_WS_PORT = ["acala", "frequency", "moonbeam", "karura", "ajuna", "bajun", "centrifuge", "moonsama", "encointer", "moonriver", "altair", "mangata", "khala", "phala"] DIFFERENT_IMAGES_FOR_MAINNET = { "centrifuge": "centrifugeio/centrifuge-chain:main-latest", From d84eb04050547eaad9594057202a509388255075 Mon Sep 17 00:00:00 2001 From: abhiyana Date: Thu, 14 Dec 2023 14:54:34 +0530 Subject: [PATCH 4/5] chore: change the node to node-type in service details --- parachain/parachain.star | 6 +++--- relaychain/relay-chain.star | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/parachain/parachain.star b/parachain/parachain.star index 6e3129b..ce34810 100644 --- a/parachain/parachain.star +++ b/parachain/parachain.star @@ -82,7 +82,7 @@ def start_local_parachain_node(plan, args, parachain_config, para_id): parachain_detail["prometheus_port"] = parachain_spawn_detail.ports["metrics"].number parachain_detail["ip_address"] = parachain_spawn_detail.ip_address parachain_detail["prometheus"] = node["prometheus"] - parachain_detail["node"] = node["node-type"] + parachain_detail["node-type"] = node["node-type"] parachain_final[parachain_spawn_detail.name] = parachain_detail return parachain_final @@ -202,7 +202,7 @@ def run_testnet_mainnet(plan, parachain, args): node_info["ip_address"] = node_details.ip_address node_info["prometheus_port"] = node_details.ports["metrics"].number node_info["prometheus"] = node["prometheus"] - node_info["node"] = node["node-type"] + node_info["node-type"] = node["node-type"] final_parachain_info[node_details.name] = node_info else: @@ -215,6 +215,6 @@ def run_testnet_mainnet(plan, parachain, args): node_info["ip_address"] = node_details.ip_address node_info["prometheus_port"] = node_details.ports["metrics"].number node_info["prometheus"] = node["prometheus"] - node_info["node"] = node["node-type"] + node_info["node-type"] = node["node-type"] final_parachain_info[node_details.name] = node_info return final_parachain_info diff --git a/relaychain/relay-chain.star b/relaychain/relay-chain.star index 0bb4891..7aad99c 100644 --- a/relaychain/relay-chain.star +++ b/relaychain/relay-chain.star @@ -45,6 +45,7 @@ def start_relay_chain(plan, args): relay_node_details["prometheus_port"] = service_details.ports["metrics"].number relay_node_details["prometheus"] = relay_node["prometheus"] relay_node_details["ip_address"] = service_details.ip_address + relay_detail["node-type"] = node["node-type"] final_details[service_details.name] = relay_node_details return final_details @@ -116,6 +117,7 @@ def start_relay_chains_local(plan, args): relay_detail["prometheus_port"] = service_details.ports["metrics"].number relay_detail["prometheus"] = node["prometheus"] relay_detail["ip_address"] = service_details.ip_address + relay_detail["node-type"] = node["node-type"] final_details[service_details.name] = relay_detail prometheus_port = prometheus_port + 1 From 01e0f8174a722541a28d5863b6963fec117c9221 Mon Sep 17 00:00:00 2001 From: abhiyana Date: Thu, 14 Dec 2023 18:01:52 +0530 Subject: [PATCH 5/5] fix: relaychain node not runing isue --- package_io/constant.star | 2 +- relaychain/relay-chain.star | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package_io/constant.star b/package_io/constant.star index bc76cd2..aa3a8f5 100644 --- a/package_io/constant.star +++ b/package_io/constant.star @@ -5,7 +5,7 @@ CURL_JQ_IMAGE = "badouralix/curl-jq" NODE_IMAGE = "hugobyte/parachain-node-modules" PARA_SLOT_REGISTER_SERVICE_NAME = "para-slot-registration" BINARY_COMMAND_CHAINS = ["manta", "khala", "phala", "clover", "calamari", "subzero", "robonomics"] -NO_WS_PORT = ["acala", "frequency", "moonbeam", "karura", "ajuna", "bajun", "centrifuge", "moonsama", "encointer", "moonriver", "altair", "mangata", "khala", "phala"] +NO_WS_PORT = ["acala", "frequency", "moonbeam", "karura", "ajuna", "bajun", "centrifuge", "moonsama", "encointer", "moonriver", "altair", "mangata", "khala", "phala", "turing"] DIFFERENT_IMAGES_FOR_MAINNET = { "centrifuge": "centrifugeio/centrifuge-chain:main-latest", diff --git a/relaychain/relay-chain.star b/relaychain/relay-chain.star index 7aad99c..7976a48 100644 --- a/relaychain/relay-chain.star +++ b/relaychain/relay-chain.star @@ -45,7 +45,7 @@ def start_relay_chain(plan, args): relay_node_details["prometheus_port"] = service_details.ports["metrics"].number relay_node_details["prometheus"] = relay_node["prometheus"] relay_node_details["ip_address"] = service_details.ip_address - relay_detail["node-type"] = node["node-type"] + relay_node_details["node-type"] = relay_node["node-type"] final_details[service_details.name] = relay_node_details return final_details