Skip to content

Commit

Permalink
fic: issue with building chain spec
Browse files Browse the repository at this point in the history
  • Loading branch information
shanithkk committed Mar 27, 2024
1 parent 76a0492 commit 74377c1
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 27 deletions.
20 changes: 4 additions & 16 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
]
}
],

Expand Down
46 changes: 37 additions & 9 deletions parachain/build-spec.star
Original file line number Diff line number Diff line change
@@ -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",
Expand All @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions parachain/static_files/images.star
Original file line number Diff line number Diff line change
Expand Up @@ -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"],
},
Expand All @@ -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"],
},
Expand Down

0 comments on commit 74377c1

Please sign in to comment.