Skip to content

Commit d7a1ae0

Browse files
committed
extracted setup into a separate script
1 parent 5080e7e commit d7a1ae0

File tree

2 files changed

+80
-79
lines changed

2 files changed

+80
-79
lines changed

examples/justfile

Lines changed: 1 addition & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -12,85 +12,7 @@ default: (run-authorize-and-store "ws" "bulletin-westend-runtime")
1212
# Setup prerequisites for Westend runtime (polkadot and polkadot-parachain binaries)
1313
# This recipe clones polkadot-sdk, builds required binaries, and copies them to ~/local_bulletin_testing/bin
1414
setup-westend-prerequisites:
15-
#!/usr/bin/env bash
16-
set -e
17-
18-
BIN_DIR=~/local_bulletin_testing/bin
19-
POLKADOT_SDK_DIR=~/local_bulletin_testing/polkadot-sdk
20-
21-
# Common setup issue on macOS is that libclang.dylib is not found.
22-
if [[ "$OSTYPE" == "darwin"* ]]; then
23-
export DYLD_FALLBACK_LIBRARY_PATH="$(brew --prefix llvm)/lib"
24-
fi
25-
26-
echo "🔧 Setting up Westend runtime prerequisites..."
27-
echo " Target directory: $BIN_DIR"
28-
29-
# Create bin directory
30-
mkdir -p $BIN_DIR
31-
32-
# Clone polkadot-sdk if it doesn't exist
33-
if [ ! -d "$POLKADOT_SDK_DIR" ]; then
34-
echo " Cloning polkadot-sdk repository..."
35-
git clone https://github.com/paritytech/polkadot-sdk.git $POLKADOT_SDK_DIR
36-
else
37-
echo " polkadot-sdk already exists at $POLKADOT_SDK_DIR"
38-
fi
39-
40-
cd $POLKADOT_SDK_DIR
41-
42-
# Check out latest master
43-
echo " Fetching latest changes from polkadot-sdk..."
44-
git fetch origin
45-
echo " Checking out latest master..."
46-
git reset --hard origin/master
47-
48-
# Build polkadot binary
49-
echo " Building polkadot binary (this may take a while)..."
50-
cargo build -p polkadot -r
51-
52-
# Verify and copy polkadot binaries
53-
echo " Copying polkadot binaries..."
54-
ls -la target/release/polkadot
55-
cp target/release/polkadot $BIN_DIR/
56-
cp target/release/polkadot-prepare-worker $BIN_DIR/
57-
cp target/release/polkadot-execute-worker $BIN_DIR/
58-
59-
# Verify polkadot version (optional check, may fail on macOS due to security/signing)
60-
echo " Verifying polkadot version..."
61-
$BIN_DIR/polkadot --version || echo " ⚠ Version check failed (this is OK, binary will still work)"
62-
63-
# Build polkadot-parachain binary
64-
echo " Building polkadot-parachain binary (this may take a while)..."
65-
cargo build -p polkadot-parachain-bin -r
66-
67-
# Verify and copy polkadot-parachain binary
68-
echo " Copying polkadot-parachain binary..."
69-
ls -la target/release/polkadot-parachain
70-
cp target/release/polkadot-parachain $BIN_DIR/
71-
72-
# Verify polkadot-parachain version (optional check, may fail on macOS due to security/signing)
73-
echo " Verifying polkadot-parachain version..."
74-
$BIN_DIR/polkadot-parachain --version || echo " ⚠ Version check failed (this is OK, binary will still work)"
75-
76-
# Build and install chain-spec-builder
77-
echo " Building chain-spec-builder..."
78-
cargo build -p staging-chain-spec-builder -r
79-
80-
# Verify and copy chain-spec-builder binary
81-
echo " Copying chain-spec-builder binary..."
82-
ls -la target/release/chain-spec-builder
83-
cp target/release/chain-spec-builder $BIN_DIR/
84-
85-
# Verify chain-spec-builder (optional check, may fail on macOS due to security/signing)
86-
echo " Verifying chain-spec-builder version..."
87-
$BIN_DIR/chain-spec-builder --version || echo " ⚠ Version check failed (this is OK, binary will still work)"
88-
89-
# Add BIN_DIR to PATH for subsequent scripts
90-
export PATH="$BIN_DIR:$PATH"
91-
92-
echo "✅ Westend prerequisites setup complete!"
93-
echo " Binaries installed in: $BIN_DIR"
15+
../scripts/setup_westend_prerequisites.sh
9416

9517
# Install JavaScript dependencies
9618
npm-install:
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
BIN_DIR=~/local_bulletin_testing/bin
5+
POLKADOT_SDK_DIR=~/local_bulletin_testing/polkadot-sdk
6+
7+
# Common setup issue on macOS is that libclang.dylib is not found.
8+
if [[ "$OSTYPE" == "darwin"* ]]; then
9+
export DYLD_FALLBACK_LIBRARY_PATH="$(brew --prefix llvm)/lib"
10+
fi
11+
12+
echo "🔧 Setting up Westend runtime prerequisites..."
13+
echo " Target directory: $BIN_DIR"
14+
15+
# Create bin directory
16+
mkdir -p $BIN_DIR
17+
18+
# Clone polkadot-sdk if it doesn't exist
19+
if [ ! -d "$POLKADOT_SDK_DIR" ]; then
20+
echo " Cloning polkadot-sdk repository..."
21+
git clone https://github.com/paritytech/polkadot-sdk.git $POLKADOT_SDK_DIR
22+
else
23+
echo " polkadot-sdk already exists at $POLKADOT_SDK_DIR"
24+
fi
25+
26+
cd $POLKADOT_SDK_DIR
27+
28+
# Check out latest master
29+
echo " Fetching latest changes from polkadot-sdk..."
30+
git fetch origin
31+
echo " Checking out latest master..."
32+
git reset --hard origin/master
33+
34+
# Build polkadot binary
35+
echo " Building polkadot binary (this may take a while)..."
36+
cargo build -p polkadot -r
37+
38+
# Verify and copy polkadot binaries
39+
echo " Copying polkadot binaries..."
40+
ls -la target/release/polkadot
41+
cp target/release/polkadot $BIN_DIR/
42+
cp target/release/polkadot-prepare-worker $BIN_DIR/
43+
cp target/release/polkadot-execute-worker $BIN_DIR/
44+
45+
# Verify polkadot version (optional check, may fail on macOS due to security/signing)
46+
echo " Verifying polkadot version..."
47+
$BIN_DIR/polkadot --version || echo " ⚠ Version check failed (this is OK, binary will still work)"
48+
49+
# Build polkadot-parachain binary
50+
echo " Building polkadot-parachain binary (this may take a while)..."
51+
cargo build -p polkadot-parachain-bin -r
52+
53+
# Verify and copy polkadot-parachain binary
54+
echo " Copying polkadot-parachain binary..."
55+
ls -la target/release/polkadot-parachain
56+
cp target/release/polkadot-parachain $BIN_DIR/
57+
58+
# Verify polkadot-parachain version (optional check, may fail on macOS due to security/signing)
59+
echo " Verifying polkadot-parachain version..."
60+
$BIN_DIR/polkadot-parachain --version || echo " ⚠ Version check failed (this is OK, binary will still work)"
61+
62+
# Build and install chain-spec-builder
63+
echo " Building chain-spec-builder..."
64+
cargo build -p staging-chain-spec-builder -r
65+
66+
# Verify and copy chain-spec-builder binary
67+
echo " Copying chain-spec-builder binary..."
68+
ls -la target/release/chain-spec-builder
69+
cp target/release/chain-spec-builder $BIN_DIR/
70+
71+
# Verify chain-spec-builder (optional check, may fail on macOS due to security/signing)
72+
echo " Verifying chain-spec-builder version..."
73+
$BIN_DIR/chain-spec-builder --version || echo " ⚠ Version check failed (this is OK, binary will still work)"
74+
75+
# Add BIN_DIR to PATH for subsequent scripts
76+
export PATH="$BIN_DIR:$PATH"
77+
78+
echo "✅ Westend prerequisites setup complete!"
79+
echo " Binaries installed in: $BIN_DIR"

0 commit comments

Comments
 (0)