Skip to content

Commit

Permalink
changes
Browse files Browse the repository at this point in the history
  • Loading branch information
enddynayn committed Aug 27, 2024
1 parent 66a7de3 commit 057788f
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 16 deletions.
8 changes: 5 additions & 3 deletions runtime/common/src/constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ pub type MaxSchemaGrants = ConstU32<30>;
/// up by `pallet_aura` to implement `fn slot_duration()`.
///
/// Change this to adjust the block time.
#[cfg(not(any(feature = "frequency-testnet", feature = "frequency-local")))]
pub const MILLISECS_PER_BLOCK: u64 = 12000;

#[cfg(any(feature = "frequency-testnet", feature = "frequency-local"))]
Expand Down Expand Up @@ -74,9 +75,10 @@ pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(WEIGHT_REF_TIME_PER_
.set_proof_size(cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64);

#[cfg(any(feature = "frequency-testnet", feature = "frequency-local"))]
pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(WEIGHT_REF_TIME_PER_SECOND, 0)
.saturating_mul(2)
.set_proof_size(cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64);
pub const MAXIMUM_BLOCK_WEIGHT: Weight = Weight::from_parts(
WEIGHT_REF_TIME_PER_SECOND.saturating_mul(2),
cumulus_primitives_core::relay_chain::MAX_POV_SIZE as u64,
);

pub type ZERO = ConstU32<0>;
pub type TWO = ConstU32<2>;
Expand Down
4 changes: 2 additions & 2 deletions runtime/frequency/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1020,9 +1020,9 @@ impl pallet_aura::Config for Runtime {
type AuthorityId = AuraId;
type DisabledValidators = ();
type MaxAuthorities = AuraMaxAuthorities;
#[cfg(any(not(feature = "frequency"), feature = "frequency-lint-check"))]
#[cfg(any(feature = "frequency-testnet", feature = "frequency-local"))]
type AllowMultipleBlocksPerSlot = ConstBool<true>;
#[cfg(feature = "frequency")]
#[cfg(not(any(feature = "frequency-testnet", feature = "frequency-local")))]
type AllowMultipleBlocksPerSlot = ConstBool<false>;
type SlotDuration = ConstU64<SLOT_DURATION>;
}
Expand Down
24 changes: 14 additions & 10 deletions scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ stop-frequency-docker)

start-frequency)
printf "\nBuilding frequency with runtime '$parachain' and id '$para_id'...\n"
cargo build --features frequency-local
cargo build --release --features frequency-local

parachain_dir=$base_dir/parachain/${para_id}
mkdir -p $parachain_dir;
Expand All @@ -60,7 +60,7 @@ start-frequency)
rm -rf $parachain_dir
fi

"${Frequency_BINARY_PATH:-./target/debug/frequency}" key generate-node-key --base-path=$parachain_dir/data
"${Frequency_BINARY_PATH:-./target/release/frequency}" key generate-node-key --base-path=$parachain_dir/data

./scripts/run_collator.sh \
--chain="frequency-paseo-local" --alice \
Expand Down Expand Up @@ -209,23 +209,27 @@ onboard-frequency-paseo-local)

onboard_dir="$base_dir/onboard"
mkdir -p $onboard_dir
release_wasm_location="target/release/wbuild/frequency-runtime/frequency_runtime.compact.compressed.wasm"
cp "$release_wasm_location" "$onboard_dir/"

wasm_location="$onboard_dir/frequency_runtime.compact.compressed.wasm"

# THE `-r` is important for it to be binary instead of hex
wasm_location="$onboard_dir/${parachain}-${para_id}.wasm"
# 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" -r > $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" -r > $wasm_location
genesis=$(./target/release/frequency export-genesis-state --chain="frequency-paseo-local")
# ./target/release/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"
# 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"
npm i && npm run onboard "ws://0.0.0.0:9946" "//Alice" ${para_id} "${genesis}" "${wasm_location}"
;;

offboard-frequency-paseo-local)
Expand Down
2 changes: 1 addition & 1 deletion scripts/run_collator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

set -e -o pipefail

ctpc="${Frequency_BINARY_PATH:-./target/debug/frequency}"
ctpc="${Frequency_BINARY_PATH:-./target/release/frequency}"

if [ ! -x "$ctpc" ]; then
echo "FATAL: $ctpc does not exist or is not executable"
Expand Down

0 comments on commit 057788f

Please sign in to comment.