Skip to content

Commit

Permalink
fix: fix bug in javascript for onboarding
Browse files Browse the repository at this point in the history
  • Loading branch information
shanithkk committed Nov 16, 2023
1 parent fc1cc2c commit 0407eff
Show file tree
Hide file tree
Showing 9 changed files with 2,087 additions and 169 deletions.
4 changes: 2 additions & 2 deletions local.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"chain-type": "mainnet",
"chain-type": "local",
"relaychain": {
"name": "polkadot",
"nodes": [
Expand All @@ -17,7 +17,7 @@
},

"para": {
"kilt-spiritnet": {
"bifrost": {
"nodes": [
{
"name": "alice",
Expand Down
341 changes: 341 additions & 0 deletions parachain/bifrost-raw.json

Large diffs are not rendered by default.

1,400 changes: 1,400 additions & 0 deletions parachain/bifrost.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion parachain/parachain.star
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def start_local_parachain_node(plan, parachain, 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-rococo-local.json --execution=wasm".format(binary, chain_name),
"{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),
]

spawn_parachain(plan, chain_name, image, exec_comexec_commandmand, build_file = raw_service.name)
Expand Down
168 changes: 168 additions & 0 deletions parachain/static_files/configs/raw-polkadot.json

Large diffs are not rendered by default.

324 changes: 162 additions & 162 deletions parachain/static_files/configs/raw-rococo-local.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion parachain/static_files/configs/rococo-local.json
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,4 @@
"childrenDefault": {}
}
}
}
}
11 changes: 10 additions & 1 deletion parachain/static_files/javascript/onboard.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,21 @@ const run = async () => {
throw err;
}

let head_state;
try {
head_state = fs.readFileSync(header, "utf8");
} catch (err) {
console.error(err);
throw err;
}

let paraGenesisArgs = {
genesis_head: header,
genesis_head: head_state,
validation_code: wasm,
parachain: true,
};

console.log(paraGenesisArgs);
let genesis = api.createType("ParaGenesisArgs", paraGenesisArgs);

const nonce = Number((await api.query.system.account(alice.address)).nonce);
Expand Down
4 changes: 2 additions & 2 deletions relaychain/relay-chain.star
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,11 @@ def start_relay_chains_local(plan, args):
return relay_detail

def start_relay_chain_local(plan, name, port):
exec_command = ["bin/sh", "-c", "polkadot --base-path=/data --chain=/app/raw-rococo-local.json --validator --ws-external --rpc-external --rpc-cors=all --name=alice --{0} --rpc-methods=unsafe --execution=wasm".format(name)]
exec_command = ["bin/sh", "-c", "polkadot --base-path=/data --chain=/app/raw-polkadot.json --validator --rpc-external --rpc-cors=all --name=alice --{0} --rpc-methods=unsafe --execution=wasm".format(name)]
service_details = plan.add_service(
name = "polkadot-{0}".format(name),
config = ServiceConfig(
image = "parity/polkadot:v0.9.31",
image = "parity/polkadot:latest",
files = {
"/app": "configs",
},
Expand Down

0 comments on commit 0407eff

Please sign in to comment.