Skip to content

Commit

Permalink
Use paritytech polkadot-sdk with optional personal fork override (#1290)
Browse files Browse the repository at this point in the history
* test on Snowfork branch

* fix checkout

* remove check

* use parity sdk by default

* suggestions

* config polkadot-sdk dir
  • Loading branch information
claravanstaden committed Sep 19, 2024
1 parent 6776272 commit a2e5297
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .envrc-example
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@ if ! has nix_direnv_version || ! nix_direnv_version 2.2.1; then
fi

use flake

export POLKADOT_SDK_REPO=https://github.com/paritytech/polkadot-sdk.git
19 changes: 12 additions & 7 deletions scripts/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@

set -eux

echo "Checkout polkadot-sdk Snowfork fork"
echo "Checkout polkadot-sdk"
pushd ..
if [ ! -d "polkadot-sdk" ]; then
git clone https://github.com/Snowfork/polkadot-sdk.git
cd snowbridge && ln -sf ../polkadot-sdk polkadot-sdk
if [[ -d ../polkadot-sdk ]] && (cd ../polkadot-sdk && git rev-parse --is-inside-work-tree) 2>&1 >/dev/nu
ls; then
echo "polkadot-sdk already exists"
else
repoURL="${POLKADOT_SDK_REPO:-https://github.com/paritytech/polkadot-sdk.git}"

git clone "$repoURL" polkadot-sdk

pushd polkadot-sdk
git pull origin master
popd
fi
pushd polkadot-sdk
git fetch && git checkout snowbridge
popd
popd

echo "Checkout lodestar Snowfork fork"
Expand Down
4 changes: 3 additions & 1 deletion web/packages/test/scripts/build-binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ set -eu
source scripts/set-env.sh

build_binaries() {
pushd $root_dir/polkadot-sdk
pushd $root_dir
pushd $polkadot_sdk_dir

local features=''
if [ "$eth_network" == "localhost" ]; then
Expand Down Expand Up @@ -33,6 +34,7 @@ build_binaries() {
cp target/release/polkadot-parachain $output_bin_dir/polkadot-parachain

popd
popd
}

changes_detected=0
Expand Down
1 change: 1 addition & 0 deletions web/packages/test/scripts/set-env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export output_bin_dir="$output_dir/bin"
ethereum_data_dir="$output_dir/ethereum"
zombienet_data_dir="$output_dir/zombienet"
export PATH="$output_bin_dir:$PATH"
export polkadot_sdk_dir="${POLKADOT_SDK_DIR:-../polkadot-sdk}"

eth_network="${ETH_NETWORK:-localhost}"
eth_endpoint_http="${ETH_RPC_ENDPOINT:-http://127.0.0.1:8545}/${INFURA_PROJECT_ID:-}"
Expand Down

0 comments on commit a2e5297

Please sign in to comment.