From dba369c70242c36a3b6f18dda88a1eda4d5b985e Mon Sep 17 00:00:00 2001 From: abhiyana Date: Tue, 21 Nov 2023 17:23:45 +0530 Subject: [PATCH 01/10] feat: implement the kurtosis package for deployment of chopstick network --- chopsticks/chopsticks.star | 58 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 chopsticks/chopsticks.star diff --git a/chopsticks/chopsticks.star b/chopsticks/chopsticks.star new file mode 100644 index 0000000..b51da9e --- /dev/null +++ b/chopsticks/chopsticks.star @@ -0,0 +1,58 @@ +""" +This package contains code for spawning the chopstick network. +""" + +def run_chopsticks_parachain(plan, para_chain): + """ + Set up a service for the chopstick network for given parachain. + + Args: + plan: The Kurtosis plan. + para_chain (str): The parachain to configure for the chopstick network. + """ + + service_config = ServiceConfig( + image="node:latest", + ports={ + "TCP": PortSpec(number=8000) + }, + public_ports={ + "TCP": PortSpec(number=8000) + }, + entrypoint=["/bin/sh", "-c", "yarn add @acala-network/chopsticks@latest && npx @acala-network/chopsticks --config=%s --port=8000" % (para_chain)] + ) + + plan.add_service(name="chopstick-", config=service_config) + + +def run_chopsticks_xcm(plan, relay_chain, para_chains): + """ + Set up a service for the chopstick network with cross-chain messaging (xcm) support with give relachain and parachains. + + Args: + plan: The Kurtosis plan. + relay_chain (str): The relay chain for cross-chain messaging. + para_chains (list): List of parachains to include in the network. + """ + + exec_cmd = "npx @acala-network/chopsticks xcm" + exec_cmd = exec_cmd + " -r " + relay_chain + + for para in para_chains: + exec_cmd = exec_cmd + " -p " + para + + ports = {} + public_ports = {} + + for i in range(0, len(para_chains) + 1): + ports["TCP" + str(i)] = PortSpec(number=8000 + i) + public_ports["TCP" + str(i)] = PortSpec(number=8000 + i) + + service_config = ServiceConfig( + image="node:latest", + ports=ports, + public_ports=public_ports, + entrypoint=["/bin/sh", "-c", "yarn add @acala-network/chopsticks@latest && %s" % (exec_cmd)] + ) + + plan.add_service(name="chopstick-", config=service_config) From fe886cd90e8a76a28c39834538e302f1586a717e Mon Sep 17 00:00:00 2001 From: Shanith K K Date: Tue, 21 Nov 2023 17:42:25 +0530 Subject: [PATCH 02/10] chore: fix issues in ws port issues --- local.json | 17 ++---------- main.star | 9 ++++--- package_io/constant.star | 2 +- parachain/parachain.star | 27 +++++++++++++------ parachain/register-para-id.star | 3 +++ parachain/static_files/configs/prometheus.yml | 2 +- parachain/static_files/images.star | 12 ++++----- 7 files changed, 38 insertions(+), 34 deletions(-) diff --git a/local.json b/local.json index 0a55f73..f4d5a44 100644 --- a/local.json +++ b/local.json @@ -1,23 +1,10 @@ { - "chain-type": "mainnet", + "chain-type": "testnet", "relaychain": { - "name": "kusama", - "nodes": [ - { - "name": "alice", - "node-type": "validator", - "port": 9944 - }, - { - "name": "bob", - "node-type": "full", - "port": 9945 - } - ] }, "para": { - "acala": { + "subsocial": { "nodes": [ { "name": "alice", diff --git a/main.star b/main.star index 75cc843..bd4f135 100644 --- a/main.star +++ b/main.star @@ -12,7 +12,10 @@ def run(plan, args): parchain_details = parachain.start_nodes(plan, args, relay_chain_details["relay_service_alice"].ip_address) service_details["parachains"] = parchain_details + ip = "{0}:{1}".format(relay_chain_details["relay_service_alice"].ip_address, relay_chain_details["relay_service_alice"].ports["prometheus"].number) + prometheus = package.prometheus(plan, args, ip) + service_details["prometheus"] = prometheus else: if len(args["relaychain"]) != 0: relay_node_detals = relay_chain.start_test_main_net_relay_nodes(plan, args) @@ -21,8 +24,8 @@ def run(plan, args): parachain_info = parachain.run_testnet_mainnet(plan, args, paras) service_details["parachains"] = parachain_info - ip = "{0}:{1}".format(relay_chain_details["relay_service_alice"].ip_address, relay_chain_details["relay_service_alice"].ports["prometheus"].number) - prometheus = package.prometheus(plan, args, ip) - service_details["prometheus"] = prometheus + + + return service_details diff --git a/package_io/constant.star b/package_io/constant.star index e57a69a..25d15e9 100644 --- a/package_io/constant.star +++ b/package_io/constant.star @@ -5,7 +5,7 @@ CURL_JQ_IMAGE = "badouralix/curl-jq" NODE_IMAGE = "node:21.1" PARA_SLOT_REGISTER_SERVICE_NAME = "para-slot-registration" BINARY_COMMAND_CHAINS = ["manta", "khala", "phala"] -NO_WS_PORT = ["acala", "frequency", "moonbeam", "karura"] +NO_WS_PORT = ["acala", "frequency", "moonbeam", "karura", "ajuna", "bajun", "centrifuge", "moonsama", "encointer"] DIFFERENT_IMAGES_FOR_MAINNET = { "centrifuge": "centrifugeio/centrifuge-chain:main-latest", diff --git a/parachain/parachain.star b/parachain/parachain.star index fa9a200..eff1bef 100644 --- a/parachain/parachain.star +++ b/parachain/parachain.star @@ -25,7 +25,8 @@ def spawn_parachain(plan, chain_name, image, command, build_file): return parachain_node -def start_local_parachain_node(plan, args, parachain, para_id): +def start_local_parachain_node(plan, args, parachain_name, para_id): + parachain = parachain_name.lower() parachain_details = parachain_list.parachain_images[parachain] image = parachain_details["image"] binary = parachain_details["entrypoint"] @@ -33,13 +34,21 @@ def start_local_parachain_node(plan, args, parachain, para_id): chain_name = parachain raw_service = build_spec.create_parachain_build_spec_with_para_id(plan, image, binary, chain_name, chain_base, para_id) - exec_comexec_commandmand = [ - "bin/bash", - "-c", - "{0} --chain=/build/{1}-raw.json --ws-external --rpc-external --rpc-cors=all --name={1} --collator --rpc-methods=unsafe --force-authoring --execution=wasm --alice -- --chain=/app/raw-polkadot.json --execution=wasm".format(binary, chain_name), - ] + if parachain in constant.NO_WS_PORT: + exec_comexec_commandmand = [ + "bin/bash", + "-c", + "{0} --chain=/build/{1}-raw.json --rpc-external --rpc-cors=all --name={1} --collator --rpc-methods=unsafe --force-authoring --execution=wasm --alice -- --chain=/app/raw-polkadot.json --execution=wasm".format(binary, chain_name), + ] + else: + exec_comexec_commandmand = [ + "bin/bash", + "-c", + "{0} --chain=/build/{1}-raw.json --ws-external --rpc-external --rpc-cors=all --name={1} --collator --rpc-methods=unsafe --force-authoring --execution=wasm --alice -- --chain=/app/raw-polkadot.json --execution=wasm".format(binary, chain_name), + ] + parachain_details = {} - for node in args["para"][parachain]["nodes"]: + for node in args["para"][parachain_name]["nodes"]: parachain_detail = spawn_parachain(plan, "{}-{}".format(chain_name, node["name"]), image, exec_comexec_commandmand, build_file = raw_service.name) parachain_details[node["name"]] = parachain_detail @@ -53,13 +62,15 @@ def start_nodes(plan, args, relay_chain_ip): parachain_details[parachain] = {} para_id = register_para_slot.register_para_id(plan, relay_chain_ip) parachain_details[parachain] = start_local_parachain_node(plan, args, parachain, para_id) - register_para_slot.onboard_genesis_state_and_wasm(plan, para_id, parachain, relay_chain_ip) + register_para_slot.onboard_genesis_state_and_wasm(plan, para_id, parachain.lower(), relay_chain_ip) return parachain_details def run_testnet_mainnet(plan, args, parachain): if args["chain-type"] == "testnet": main_chain = "rococo" + if parachain == "ajuna": + parachain = "bajun" parachain_details = parachain_list.parachain_images[parachain] image = parachain_details["image"] base = parachain_details["base"][1] diff --git a/parachain/register-para-id.star b/parachain/register-para-id.star index 2c8e8aa..b62e47a 100644 --- a/parachain/register-para-id.star +++ b/parachain/register-para-id.star @@ -8,6 +8,7 @@ def register_para_id(plan, alice_ip): plan.exec(service_name = test.name, recipe = ExecRecipe(command = ["/bin/sh", "-c", "cd /build && node register ws://{0}:9944 //Alice ".format(alice_ip)])) para_id = plan.exec(service_name = test.name, recipe = ExecRecipe(command = ["/bin/sh", "-c", "cat /tmp/para.json | tr -d '\n\r'"])) + plan.remove_service(test.name) return para_id["output"] def onboard_genesis_state_and_wasm(plan, para_id, chain_name, alice_ip): @@ -26,3 +27,5 @@ def onboard_genesis_state_and_wasm(plan, para_id, chain_name, alice_ip): plan.exec(service_name = service.name, recipe = ExecRecipe(command = ["/bin/sh", "-c", "cd /javascript && npm i "])) plan.exec(service_name = service.name, recipe = ExecRecipe(command = ["/bin/sh", "-c", "cd /javascript && node onboard ws://{0}:9944 //Alice {1} /build/{2}-genesis-state /build/{2}-genesis-wasm".format(alice_ip, para_id, chain_name)])) + + plan.remove_service(service.name) diff --git a/parachain/static_files/configs/prometheus.yml b/parachain/static_files/configs/prometheus.yml index e4616c1..3e172f3 100644 --- a/parachain/static_files/configs/prometheus.yml +++ b/parachain/static_files/configs/prometheus.yml @@ -11,4 +11,4 @@ scrape_configs: - job_name: "substrate_node" scrape_interval: 5s static_configs: - - targets: ["172.16.0.3:9615"] \ No newline at end of file + - targets: ["172.16.0.3:9615"] diff --git a/parachain/static_files/images.star b/parachain/static_files/images.star index 6cd1736..d53f55a 100644 --- a/parachain/static_files/images.star +++ b/parachain/static_files/images.star @@ -23,7 +23,7 @@ parachain_images = { "clover": { "image": "cloverio/clover-para:v0.1.24", "entrypoint": "/opt/clover/bin/clover", - "base": ["dev", "testnet", "mainnet"], + "base": ["dev", "/opt/specs/clover-preview-iris.json", "mainnet"], }, "frequency": { "image": "frequencychain/collator-node-local:latest", @@ -63,7 +63,7 @@ parachain_images = { "moonbeam": { "image": "moonbeamfoundation/moonbeam:sha-32933811", "entrypoint": "/moonbeam/moonbeam", - "base": ["dev", "alphanet", "moonbeam"], + "base": ["moonbeam-dev", "alphanet", "moonbeam"], }, "moonsama": { "image": "moonsama/moonsama-node:latest", @@ -98,7 +98,7 @@ parachain_images = { "subsocial": { "image": "dappforce/subsocial-parachain:latest", "entrypoint": "/usr/local/bin/subsocial-collator", - "base": ["local-rococo", "--chain=/app/soonsocial.json", ""], + "base": ["local-rococo", "/app/soonsocial.json", ""], }, "zeitgeist": { "image": "zeitgeistpm/zeitgeist-node-parachain", @@ -130,7 +130,7 @@ parachain_images = { "entrypoint": "/usr/local/bin/acala", "base": ["dev", "mandala-latest", "karura"], }, - "khala network": { + "khala": { "image": "phalanetwork/khala-node:latest", "entrypoint": "/usr/local/bin/khala-node", "base": ["khala-dev-2004", "rhala", "khala"], @@ -138,7 +138,7 @@ parachain_images = { "kintsugi-btc": { "image": "interlayhq/interbtc:latest", "entrypoint": "tini -- /usr/local/bin/interbtc-parachain", - "base": ["dev", "kintsugi-testnet-latest", "kintsugi"], + "base": ["kintsugi-dev", "kintsugi-testnet-latest", "kintsugi"], }, "litmus": { "image": "litentry/litentry-parachain:latest", @@ -153,7 +153,7 @@ parachain_images = { "moonriver": { "image": "moonbeamfoundation/moonbeam:sha-519bd694", "entrypoint": "/moonbeam/moonbeam", - "base": ["dev", "alphanet", "moonriver"], + "base": ["moonriver-dev", "alphanet", "moonriver"], }, "robonomics": { "image": "robonomics/robonomics:latest", From 394a6862cbe399e4c51916c3a8d3e65b357e7d31 Mon Sep 17 00:00:00 2001 From: abhiyana Date: Wed, 22 Nov 2023 16:02:43 +0530 Subject: [PATCH 03/10] fix: fix for moonriver, kilt --- local.json | 17 ++++++++++++++-- package_io/constant.star | 2 +- parachain/static_files/images.star | 6 +++--- parachain/testnet-setup/centrifuge.star | 27 +++++++++++++++++++++++++ 4 files changed, 46 insertions(+), 6 deletions(-) create mode 100644 parachain/testnet-setup/centrifuge.star diff --git a/local.json b/local.json index f4d5a44..d0657b0 100644 --- a/local.json +++ b/local.json @@ -1,10 +1,23 @@ { "chain-type": "testnet", "relaychain": { + "name": "rococo", + "nodes": [ + { + "name": "alice", + "node-type": "validator", + "port": 9944 + }, + { + "name": "bob", + "node-type": "full", + "port": 9945 + } + ] }, "para": { - "subsocial": { + "clover": { "nodes": [ { "name": "alice", @@ -17,4 +30,4 @@ ] } } -} +} \ No newline at end of file diff --git a/package_io/constant.star b/package_io/constant.star index 25d15e9..b21d093 100644 --- a/package_io/constant.star +++ b/package_io/constant.star @@ -5,7 +5,7 @@ CURL_JQ_IMAGE = "badouralix/curl-jq" NODE_IMAGE = "node:21.1" PARA_SLOT_REGISTER_SERVICE_NAME = "para-slot-registration" BINARY_COMMAND_CHAINS = ["manta", "khala", "phala"] -NO_WS_PORT = ["acala", "frequency", "moonbeam", "karura", "ajuna", "bajun", "centrifuge", "moonsama", "encointer"] +NO_WS_PORT = ["acala", "frequency", "moonbeam", "karura", "ajuna", "bajun", "centrifuge", "moonsama", "encointer", "moonriver"] DIFFERENT_IMAGES_FOR_MAINNET = { "centrifuge": "centrifugeio/centrifuge-chain:main-latest", diff --git a/parachain/static_files/images.star b/parachain/static_files/images.star index d53f55a..05e6679 100644 --- a/parachain/static_files/images.star +++ b/parachain/static_files/images.star @@ -40,7 +40,7 @@ parachain_images = { "entrypoint": "/usr/local/bin/interbtc-parachain", "base": ["dev", "interlay-testnet-latest", "interlay-latest"], }, - "kilt-spiritnet": { + "kilt": { "image": "kiltprotocol/kilt-node:latest", "entrypoint": "/usr/local/bin/node-executable", "base": ["dev", "/node/dev-specs/kilt-parachain/peregrine-kilt.json", "spiritnet"], @@ -85,7 +85,7 @@ parachain_images = { "entrypoint": "/usr/local/bin/pendulum-collator", "base": ["litentry-dev", "foucoco", "pendulum"], }, - "phala-network": { + "phala": { "image": "litentry/litentry-parachain:latest", "entrypoint": "/usr/local/bin/litentry-collator", "base": ["dev", "rhala", "phala"], @@ -105,7 +105,7 @@ parachain_images = { "entrypoint": "/usr/local/bin/zeitgeist", "base": ["dev", "battery_station", "zeitgeist"], }, - "encointer-network": { + "encointer": { "image": "encointer/parachain:1.5.1", "entrypoint": "/usr/local/bin/encointer-collator", "base": ["encointer-rococo-local", "encointer-rococo", "mainnet"], diff --git a/parachain/testnet-setup/centrifuge.star b/parachain/testnet-setup/centrifuge.star new file mode 100644 index 0000000..f598ad3 --- /dev/null +++ b/parachain/testnet-setup/centrifuge.star @@ -0,0 +1,27 @@ +def run_centrifuge(plan): + exec_command = [ + "--chain=catalyst", + "--rpc-port=9944", + "--rpc-external", + "--rpc-cors=all", + "--rpc-methods=unsafe", + "--execution=wasm", + "--tmp", + "--", + "--chain=rococo" + ] + altair_service_config = ServiceConfig( + image = "centrifugeio/centrifuge-chain:main-latest", + files = { + "/app": "configs", + }, + ports = { + "ws": PortSpec(9944, transport_protocol = "TCP"), + }, + public_ports = { + "ws": PortSpec(9432, transport_protocol = "TCP"), + }, + cmd = exec_command, + entrypoint = ["/usr/local/bin/centrifuge-chain"] + ) + plan.add_service(name = "centrifuge-node", config = altair_service_config) From 248352e7814a4121b30f37ceae13db9f3c76f8e0 Mon Sep 17 00:00:00 2001 From: abhiyana Date: Wed, 22 Nov 2023 18:00:53 +0530 Subject: [PATCH 04/10] fix: fix clover testnet running issue --- package_io/constant.star | 5 +++-- parachain/parachain.star | 3 +++ parachain/static_files/images.star | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package_io/constant.star b/package_io/constant.star index b21d093..4f5ff58 100644 --- a/package_io/constant.star +++ b/package_io/constant.star @@ -4,7 +4,7 @@ EDIT_BUILD_SPEC = "edit-build-spec" CURL_JQ_IMAGE = "badouralix/curl-jq" NODE_IMAGE = "node:21.1" PARA_SLOT_REGISTER_SERVICE_NAME = "para-slot-registration" -BINARY_COMMAND_CHAINS = ["manta", "khala", "phala"] +BINARY_COMMAND_CHAINS = ["manta", "khala", "phala", "clover"] NO_WS_PORT = ["acala", "frequency", "moonbeam", "karura", "ajuna", "bajun", "centrifuge", "moonsama", "encointer", "moonriver"] DIFFERENT_IMAGES_FOR_MAINNET = { @@ -15,7 +15,8 @@ DIFFERENT_IMAGES_FOR_MAINNET = { DIFFERENT_IMAGES_FOR_TESTNET = { "frequency": "frequencychain/parachain-node-rococo", "centrifuge": "centrifugeio/centrifuge-chain:main-latest", - "karura": "acala/mandala-node:latest" + "karura": "acala/mandala-node:latest", + "clover": "cloverio/clover-iris:0.1.15" } CHAIN_COMMAND = ["manta", "moonsama", "interlay", "kintsugi-btc"] diff --git a/parachain/parachain.star b/parachain/parachain.star index eff1bef..d345799 100644 --- a/parachain/parachain.star +++ b/parachain/parachain.star @@ -117,6 +117,9 @@ def run_testnet_mainnet(plan, args, parachain): command = command + ["--name={0}".format(node["name"])] if node["node-type"] == "collator": command = command + ["--collator"] + + if node["node-type"] == "validator": + command = command + ["--validator"] if parachain in constant.CHAIN_COMMAND: command = command + ["--", "--chain={0}".format(main_chain)] diff --git a/parachain/static_files/images.star b/parachain/static_files/images.star index 05e6679..2bed9f4 100644 --- a/parachain/static_files/images.star +++ b/parachain/static_files/images.star @@ -23,7 +23,7 @@ parachain_images = { "clover": { "image": "cloverio/clover-para:v0.1.24", "entrypoint": "/opt/clover/bin/clover", - "base": ["dev", "/opt/specs/clover-preview-iris.json", "mainnet"], + "base": ["dev", "iris", "clover"], }, "frequency": { "image": "frequencychain/collator-node-local:latest", From 11d020a98a059b74fd681fbd84b45674e03d162f Mon Sep 17 00:00:00 2001 From: abhiyana Date: Wed, 22 Nov 2023 18:02:04 +0530 Subject: [PATCH 05/10] refactor: change node type for clover in local.json --- local.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/local.json b/local.json index d0657b0..d3b6d83 100644 --- a/local.json +++ b/local.json @@ -21,7 +21,7 @@ "nodes": [ { "name": "alice", - "node-type": "collator" + "node-type": "validator" }, { "name": "bob", From 6afe17727dafeaaa657e1e26a358aa0980a5dc9d Mon Sep 17 00:00:00 2001 From: abhiyana Date: Thu, 23 Nov 2023 15:13:24 +0530 Subject: [PATCH 06/10] fix: fix the issue bin/sh --- local.json | 4 ++-- parachain/build-spec.star | 22 +++++++++++----------- parachain/parachain.star | 4 ++-- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/local.json b/local.json index d3b6d83..398a9a6 100644 --- a/local.json +++ b/local.json @@ -1,5 +1,5 @@ { - "chain-type": "testnet", + "chain-type": "local", "relaychain": { "name": "rococo", "nodes": [ @@ -17,7 +17,7 @@ }, "para": { - "clover": { + "litentry": { "nodes": [ { "name": "alice", diff --git a/parachain/build-spec.star b/parachain/build-spec.star index 43f1882..54b14d6 100644 --- a/parachain/build-spec.star +++ b/parachain/build-spec.star @@ -3,13 +3,13 @@ constant = import_module("../package_io/constant.star") def create_parachain_build_spec_with_para_id(plan, image, binary, chain_name, chain_base, para_id): command = ExecRecipe(command = [ - "bin/sh", + "/bin/sh", "-c", "{0} build-spec --chain={1} --disable-default-bootnode > /tmp/{2}.json".format(binary, chain_base, chain_name), ]) build_spec.create_edit_and_build_spec(plan, constant.PLAIN_BUILD_SPEC, image, chain_name, command, build_file = None) command = ExecRecipe(command = [ - "bin/sh", + "/bin/sh", "-c", "sed -e 's/\"parachainId\": *[0-9]\\+/\"parachainId\": {0}/' -e 's/\"para_id\": [0-9]*,/\"para_id\": {0},/' -e 's/\"paraId\": [0-9]*,/\"paraId\": {0},/' /build/{1}.json > /tmp/{1}.json".format(para_id, chain_name), ]) @@ -22,32 +22,32 @@ def create_raw_build_spec_genisis_state_genisis_wasm(plan, binary, image, chain_ raw_service = build_spec.create_service_for_build_spec(plan, constant.RAW_BUILD_SPEC, image, build_file) command = ExecRecipe(command = [ - "bin/sh", + "/bin/sh", "-c", "{0} build-spec --chain=/build/{1}.json --raw --disable-default-bootnode > /tmp/{1}-raw.json".format(binary, chain_name), ]) plan.exec(service_name = constant.RAW_BUILD_SPEC, recipe = command) command = ExecRecipe(command = [ - "bin/sh", + "/bin/sh", "-c", "{0} export-genesis-wasm --chain=/tmp/{1}-raw.json > /tmp/{1}-genesis-wasm".format(binary, chain_name), ]) plan.exec(service_name = constant.RAW_BUILD_SPEC, recipe = command) command = ExecRecipe(command = [ - "bin/sh", + "/bin/sh", "-c", "{0} export-genesis-state --chain=/tmp/{1}-raw.json > /tmp/{1}-genesis-state".format(binary, chain_name), ]) plan.exec(service_name = constant.RAW_BUILD_SPEC, recipe = command) - command = ExecRecipe(command = [ - "bin/sh", - "-c", - "cp /build/{0}.json /tmp/{0}.json".format(chain_name), - ]) - plan.exec(service_name = constant.RAW_BUILD_SPEC, recipe = command) + # command = ExecRecipe(command = [ + # "/bin/sh", + # "-c", + # "cp /build/{0}.json /tmp/{0}.json".format(chain_name), + # ]) + # plan.exec(service_name = constant.RAW_BUILD_SPEC, recipe = command) plan.store_service_files(service_name = constant.RAW_BUILD_SPEC, src = "/tmp/*", name = constant.RAW_BUILD_SPEC) plan.stop_service(constant.RAW_BUILD_SPEC) diff --git a/parachain/parachain.star b/parachain/parachain.star index d345799..2cb0e00 100644 --- a/parachain/parachain.star +++ b/parachain/parachain.star @@ -36,13 +36,13 @@ def start_local_parachain_node(plan, args, parachain_name, para_id): if parachain in constant.NO_WS_PORT: exec_comexec_commandmand = [ - "bin/bash", + "/bin/bash", "-c", "{0} --chain=/build/{1}-raw.json --rpc-external --rpc-cors=all --name={1} --collator --rpc-methods=unsafe --force-authoring --execution=wasm --alice -- --chain=/app/raw-polkadot.json --execution=wasm".format(binary, chain_name), ] else: exec_comexec_commandmand = [ - "bin/bash", + "/bin/bash", "-c", "{0} --chain=/build/{1}-raw.json --ws-external --rpc-external --rpc-cors=all --name={1} --collator --rpc-methods=unsafe --force-authoring --execution=wasm --alice -- --chain=/app/raw-polkadot.json --execution=wasm".format(binary, chain_name), ] From dd5a8b424c276734e0e9f1333f00fbf11ab75fa0 Mon Sep 17 00:00:00 2001 From: abhiyana Date: Mon, 27 Nov 2023 12:22:01 +0530 Subject: [PATCH 07/10] feat: implement kurtosis package for running polkadot -js App --- local.json | 2 +- polkadot-js-app/polkadot_js_app.star | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 polkadot-js-app/polkadot_js_app.star diff --git a/local.json b/local.json index 398a9a6..da65047 100644 --- a/local.json +++ b/local.json @@ -17,7 +17,7 @@ }, "para": { - "litentry": { + "turing": { "nodes": [ { "name": "alice", diff --git a/polkadot-js-app/polkadot_js_app.star b/polkadot-js-app/polkadot_js_app.star new file mode 100644 index 0000000..265c26f --- /dev/null +++ b/polkadot-js-app/polkadot_js_app.star @@ -0,0 +1,25 @@ +""" +This file contain code for running the polkadot-js App +""" +def run_pokadot_js_app(plan, ws_url): + """ + This function will run the service for polkadot Js App + Args: + plan (object): kurtosis plan object1 + ws_url (str): connect to a Polkadot node of given web socket URL + """ + service_config = ServiceConfig( + image = "jacogr/polkadot-js-apps:latest", + + ports = { + "TCP" : PortSpec(80) + }, + public_ports = { + "TCP" : PortSpec(80) + }, + env_vars = { + "WS_URL": ws_url, + } + ) + plan.add_service(name="polkadot-js", config=service_config) + \ No newline at end of file From c17bd41e2dc2f801377e7617f79c91b8da40c735 Mon Sep 17 00:00:00 2001 From: abhiyana Date: Mon, 27 Nov 2023 14:52:01 +0530 Subject: [PATCH 08/10] merge: merge to main --- main.star | 3 --- parachain/static_files/images.star | 2 +- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/main.star b/main.star index f11502b..89395da 100644 --- a/main.star +++ b/main.star @@ -15,9 +15,6 @@ def run(plan, args): service_details["relaychains"] = relay_chain_details parachain_details = parachain.start_nodes(plan, args, relay_chain_details[0]["service_details"].ip_address) service_details["parachains"] = parachain_details - - prometheus = package.prometheus(plan, args, ip) - service_details["prometheus"] = prometheus else: if len(args["relaychain"]) != 0: relay_node_detals = relay_chain.start_test_main_net_relay_nodes(plan, args) diff --git a/parachain/static_files/images.star b/parachain/static_files/images.star index a32df5f..2bed9f4 100644 --- a/parachain/static_files/images.star +++ b/parachain/static_files/images.star @@ -116,7 +116,7 @@ parachain_images = { "base": ["altair-local", "catalyst", "centrifuge"], }, "bajun": { - "image": "ajuna/parachain-bajun:0.1.28", + "image": "ajuna/parachain-bajun:latest", "entrypoint": "/usr/local/bin/ajuna", "base": ["local", "/bajun/rococo/bajun-raw.json", "/bajun/bajun-raw.json"], }, From b0b69fa9458cecbe7f7635d1c4e7e80edebb0af8 Mon Sep 17 00:00:00 2001 From: abhiyana Date: Mon, 27 Nov 2023 14:55:30 +0530 Subject: [PATCH 09/10] refactor: add the prometheus key in local.json --- local.json | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/local.json b/local.json index da65047..58695d1 100644 --- a/local.json +++ b/local.json @@ -6,12 +6,15 @@ { "name": "alice", "node-type": "validator", - "port": 9944 + "port": 9944, + "prometheus": false }, { "name": "bob", "node-type": "full", - "port": 9945 + "port": 9945, + "prometheus": false + } ] }, @@ -21,11 +24,14 @@ "nodes": [ { "name": "alice", - "node-type": "validator" + "node-type": "validator", + "prometheus": false + }, { "name": "bob", - "node-type": "full" + "node-type": "full", + "prometheus": false } ] } From ebca41588b89758d9be6baea81eee22462267fe8 Mon Sep 17 00:00:00 2001 From: abhiyana Date: Mon, 27 Nov 2023 17:30:52 +0530 Subject: [PATCH 10/10] fix: change the base for interlay local --- local.json | 2 +- parachain/parachain.star | 4 ++-- parachain/static_files/images.star | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/local.json b/local.json index 58695d1..e32c51b 100644 --- a/local.json +++ b/local.json @@ -20,7 +20,7 @@ }, "para": { - "turing": { + "khala": { "nodes": [ { "name": "alice", diff --git a/parachain/parachain.star b/parachain/parachain.star index fb8df04..ed520df 100644 --- a/parachain/parachain.star +++ b/parachain/parachain.star @@ -37,13 +37,13 @@ def start_local_parachain_node(plan, args, parachain_name, para_id): if parachain in constant.NO_WS_PORT: exec_comexec_commandmand = [ - "bin/bash", + "/bin/bash", "-c", "{0} --chain=/build/{1}-raw.json --rpc-port=9944 --rpc-external --rpc-cors=all --prometheus-external --name={1} --collator --rpc-methods=unsafe --force-authoring --execution=wasm -- --chain=/app/raw-polkadot.json --execution=wasm".format(binary, chain_name), ] else: exec_comexec_commandmand = [ - "bin/bash", + "/bin/bash", "-c", "{0} --chain=/build/{1}-raw.json --ws-port=9944 --rpc-port=9933 --ws-external --rpc-external --prometheus-external --rpc-cors=all --name={1} --collator --rpc-methods=unsafe --force-authoring --execution=wasm -- --chain=/app/raw-polkadot.json --execution=wasm".format(binary, chain_name), ] diff --git a/parachain/static_files/images.star b/parachain/static_files/images.star index 2bed9f4..f0af891 100644 --- a/parachain/static_files/images.star +++ b/parachain/static_files/images.star @@ -38,7 +38,7 @@ parachain_images = { "interlay": { "image": "interlayhq/interbtc:latest", "entrypoint": "/usr/local/bin/interbtc-parachain", - "base": ["dev", "interlay-testnet-latest", "interlay-latest"], + "base": ["interlay-dev", "interlay-testnet-latest", "interlay-latest"], }, "kilt": { "image": "kiltprotocol/kilt-node:latest",