Skip to content

Commit

Permalink
Fix issues with building the wasm
Browse files Browse the repository at this point in the history
  • Loading branch information
wilwade committed Aug 22, 2024
1 parent a7407e8 commit d94d4b3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -210,17 +210,19 @@ onboard-frequency-paseo-local)
onboard_dir="$base_dir/onboard"
mkdir -p $onboard_dir

# THE `-r` is important for it to be binary instead of hex
wasm_location="$onboard_dir/${parachain}-${para_id}.wasm"
if [ "$docker_onboard" == "true" ]; then
genesis=$(docker run -it {REPO_NAME}/frequency:${frequency_docker_image_tag} export-genesis-state --chain="frequency-paseo-local")
docker run -it {REPO_NAME}/frequency:${frequency_docker_image_tag} export-genesis-wasm --chain="frequency-paseo-local" > $wasm_location
docker run -it {REPO_NAME}/frequency:${frequency_docker_image_tag} export-genesis-wasm --chain="frequency-paseo-local" -r > $wasm_location
else
genesis=$(./target/debug/frequency export-genesis-state --chain="frequency-paseo-local")
./target/debug/frequency export-genesis-wasm --chain="frequency-paseo-local" > $wasm_location
./target/debug/frequency export-genesis-wasm --chain="frequency-paseo-local" -r > $wasm_location
fi

echo "WASM path:" "${wasm_location}"
subwasm compress "${wasm_location}" "${wasm_location}.compressed"
subwasm info "${wasm_location}.compressed"

cd scripts/js/onboard
npm i && npm run onboard "ws://0.0.0.0:9946" "//Alice" ${para_id} "${genesis}" "${wasm_location}.compressed"
Expand Down
4 changes: 2 additions & 2 deletions scripts/js/onboard/onboard.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ const run = async () => {

let wasm;
try {
wasm = readFileSync(wasmFile, "utf8");
wasm = readFileSync(wasmFile).toString("hex");
} catch (err) {
console.error(err);
throw err;
}

let paraGenesisArgs = {
genesis_head: header,
validation_code: wasm,
validation_code: "0x" + wasm,
parachain: true,
};

Expand Down

0 comments on commit d94d4b3

Please sign in to comment.