From 74377c14856dbe2bf0b495740e5a3b5b3ddfd636 Mon Sep 17 00:00:00 2001 From: Shanith K K Date: Wed, 27 Mar 2024 11:17:33 +0530 Subject: [PATCH] fic: issue with building chain spec --- config.json | 20 +++---------- parachain/build-spec.star | 46 ++++++++++++++++++++++++------ parachain/static_files/images.star | 4 +-- 3 files changed, 43 insertions(+), 27 deletions(-) diff --git a/config.json b/config.json index 7ea7125..c6be26a 100644 --- a/config.json +++ b/config.json @@ -19,32 +19,20 @@ "parachains": [ { - "name":"frequency", + "name":"acala", "nodes": [ { "name": "alice", "node_type": "collator", - "prometheus": false, - "key":{ - "private_phrase":"dizzy rose offer wall social glory debris gift govern seminar almost bicycle" , - "public_key":"5G3vA9UC6J7hPN5Jqfiz4qFNqYAfahHxffbuQf6dcZZx3Yx6" - } + "prometheus": false }, { "name": "bob", "node_type": "full", - "prometheus": false, - "key": { - "private_phrase":"diamond crane pioneer aisle conduct media news cup price olive dust light" , - "public_key":"5GgwsM48CCT7oPUyFTTpE5L1t7Fjpe7D8SDNKxJxug15YEKy" - } + "prometheus": false } - ], - "sudo_key": { - "private_phrase":"dizzy rose offer wall social glory debris gift govern seminar almost bicycle" , - "public_key":"5G3vA9UC6J7hPN5Jqfiz4qFNqYAfahHxffbuQf6dcZZx3Yx6" - } + ] } ], diff --git a/parachain/build-spec.star b/parachain/build-spec.star index fbfdfdf..09d4a72 100644 --- a/parachain/build-spec.star +++ b/parachain/build-spec.star @@ -1,6 +1,39 @@ build_spec = import_module("../package_io/build-spec.star") constant = import_module("../package_io/constant.star") +# def create_parachain_build_spec_with_para_id(plan, image, binary, chain_name, chain_base, para_id, sudo_key, collators_keys): +# files = { +# "/app": "configs", +# } + +# plan.run_sh( +# run = "{0} build-spec --chain={1} --disable-default-bootnode > /tmp/{2}.json".format(binary, chain_base, chain_name), +# image = image, +# files = files, +# store = [StoreSpec(src = "/tmp/{0}.json".format(chain_name), name = chain_name + "plain")], +# ) + +# files = { +# "/app": "configs", +# "/build": chain_name + "plain", +# "/javascript": "javascript", +# } + + +# run_command = "cd /javascript && npm i && node edit_parachain_plain.js /build/{0}.json {1} \"{2}\" \'{3}\'".format(chain_name, para_id, sudo_key, collators_keys) +# plan.print(run_command) +# plan.run_sh( +# run = run_command, +# image = constant.NODE_IMAGE, +# files = files, +# store = [StoreSpec(src = "/build/{0}.json".format(chain_name), name = chain_name + "edit")], +# ) + + +# raw_service = create_raw_build_spec_genisis_state_genisis_wasm_for_parachain(plan, binary, image, chain_name, ) + +# return raw_service + def create_parachain_build_spec_with_para_id(plan, image, binary, chain_name, chain_base, para_id, sudo_key, collators_keys): files = { "/app": "configs", @@ -16,24 +49,19 @@ def create_parachain_build_spec_with_para_id(plan, image, binary, chain_name, ch files = { "/app": "configs", "/build": chain_name + "plain", - "/javascript": "javascript", } - - - run_command = "cd /javascript && npm i && node edit_parachain_plain.js /build/{0}.json {1} \"{2}\" \'{3}\'".format(chain_name, para_id, sudo_key, collators_keys) - plan.print(run_command) plan.run_sh( - run = run_command, - image = constant.NODE_IMAGE, + run = "sed -e 's/\"parachainId\": *[0-9]\\+/\"parachainId\": {0}/' -e 's/\"para_id\": [0-9]*,/\"para_id\": {0},/' -e 's/\"paraId\": [0-9]*,/\"paraId\": {0},/' -e 's/\"parachain_id\": [0-9]*,/\"parachain_id\": {0},/' /build/{1}.json > /tmp/{1}.json".format(para_id, chain_name), + image = constant.CURL_JQ_IMAGE, files = files, - store = [StoreSpec(src = "/build/{0}.json".format(chain_name), name = chain_name + "edit")], + store = [StoreSpec(src = "/tmp/{0}.json".format(chain_name), name = chain_name + "edit")], ) - raw_service = create_raw_build_spec_genisis_state_genisis_wasm_for_parachain(plan, binary, image, chain_name) return raw_service + def create_raw_build_spec_genisis_state_genisis_wasm_for_parachain(plan, binary, image, chain_name): files = { "/app": "configs", diff --git a/parachain/static_files/images.star b/parachain/static_files/images.star index 94c35ef..b13e554 100644 --- a/parachain/static_files/images.star +++ b/parachain/static_files/images.star @@ -26,7 +26,7 @@ parachain_images = { "base": ["dev", "iris", "clover"], }, "frequency": { - "image": "frequencychain/collator-node-local:latest", + "image": "frequencychain/collator-node-local:v1.10.0", "entrypoint": "/frequency/target/release/frequency", "base": ["frequency-rococo-local", "frequency-rococo", "frequency"], }, @@ -41,7 +41,7 @@ parachain_images = { "base": ["interlay-dev", "interlay-testnet-latest", "interlay-latest"], }, "kilt": { - "image": "kiltprotocol/kilt-node:latest", + "image": "kiltprotocol/kilt-node:1.12.1", "entrypoint": "/usr/local/bin/node-executable", "base": ["dev", "/node/dev-specs/kilt-parachain/peregrine-kilt.json", "spiritnet"], },