From f98579ecb48773554ebb80e3a44baa971fe9de6c Mon Sep 17 00:00:00 2001 From: SHANiTH K K <59169878+shanithkk@users.noreply.github.com> Date: Mon, 8 Jan 2024 17:36:51 +0530 Subject: [PATCH] feat: add archival node fro relay chain (#171) * chore: Add archive node for relay chain * fix: bifrost port issue --- package_io/utils.star | 2 +- parachain/node_setup.star | 2 +- parachain/parachain.star | 2 +- relaychain/relay-chain.star | 14 +++++++++++++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/package_io/utils.star b/package_io/utils.star index 13a94d8..c3d5bf6 100644 --- a/package_io/utils.star +++ b/package_io/utils.star @@ -57,7 +57,7 @@ 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"]: + if node["node-type"] in ["validator", "full", "archive"]: plan.print("config for relaynodes is valid") else: return fail("relaychain node-type can be only validator/full") diff --git a/parachain/node_setup.star b/parachain/node_setup.star index 69eb0b2..06c952e 100644 --- a/parachain/node_setup.star +++ b/parachain/node_setup.star @@ -19,7 +19,7 @@ def run_testnet_node_with_command(plan, image, chain_name, execute_command): service_config = ServiceConfig( image = image, ports = { - "ws": PortSpec(9944, transport_protocol = "TCP"), + "ws": PortSpec(9947, transport_protocol = "TCP"), "metrics": PortSpec(9615, transport_protocol = "TCP", application_protocol = "http"), "lib": PortSpec(30333), }, diff --git a/parachain/parachain.star b/parachain/parachain.star index e1997c7..8bec0e9 100644 --- a/parachain/parachain.star +++ b/parachain/parachain.star @@ -145,7 +145,7 @@ def run_testnet_mainnet(plan, parachain, args): common_command = [ "--chain={0}".format(base), "--port=30333", - "--rpc-port=9944", + "--rpc-port=9947", "--prometheus-external", "--rpc-cors=all", "--rpc-external", diff --git a/relaychain/relay-chain.star b/relaychain/relay-chain.star index 95c6aed..09d6102 100644 --- a/relaychain/relay-chain.star +++ b/relaychain/relay-chain.star @@ -17,7 +17,19 @@ def start_relay_chain(plan, args): final_details = {} for relay_node in args["relaychain"]["nodes"]: - exec_command = ["bin/sh", "-c", "polkadot --rpc-external --rpc-cors=all --rpc-methods=unsafe --chain {0} --name={1} --execution=wasm --prometheus-external".format(chain, relay_node["name"])] + + + command = "polkadot --rpc-external --rpc-cors=all --rpc-methods=unsafe --chain {0} --name={1} --execution=wasm --prometheus-external".format(chain, relay_node["name"]) + + if relay_node["node-type"] == "validator": + command = command + " --validator --insecure-validator-i-know-what-i-do" + elif relay_node["node-type"] == "archive": + command = command + " --pruning=archive" + + plan.print(command) + + exec_command = ["bin/sh", "-c", command] + service_details = plan.add_service( name = "{0}-{1}-{2}".format(name, chain, relay_node["name"]), config = ServiceConfig(