Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
08242d4
added CI for docker workflow
x3c41a Dec 10, 2025
805a5b2
simplified workflow, reused just commands
x3c41a Dec 10, 2025
464dd44
doubled timeout
x3c41a Dec 10, 2025
8db6577
use ubuntu-latest directly for Docker suppor
x3c41a Dec 10, 2025
3ac97ff
added docker check
x3c41a Dec 10, 2025
675b40b
simplify docker verification
x3c41a Dec 10, 2025
3aff147
trigger workflow on ci_cd branch pushes
x3c41a Dec 10, 2025
47cf3d6
add protobuf-compiler dependency
x3c41a Dec 10, 2025
b85e4e6
add libclang dependency
x3c41a Dec 10, 2025
0b777e4
add wasm32 target for runtime compilation
x3c41a Dec 10, 2025
f6a0e53
add rust-src component for wasm compilation
x3c41a Dec 10, 2025
64264d5
use host networking for IPFS Docker on Linux/CI
x3c41a Dec 10, 2025
ca12545
fix Docker networking and add zombienet debugging
x3c41a Dec 11, 2025
a5e204c
fix: use absolute paths for zombienet and bulletin binary
x3c41a Dec 11, 2025
310a547
renamed
x3c41a Dec 11, 2025
c03485f
removed docker verification step - not needed anymore
x3c41a Dec 11, 2025
8bd3e97
Merge branch 'just_docker' into ci_cd
x3c41a Dec 11, 2025
99cbf16
Update .github/workflows/integration-test.yml
x3c41a Dec 11, 2025
eafe553
Update .github/workflows/integration-test.yml
x3c41a Dec 11, 2025
39f13fa
added another test as step
x3c41a Dec 11, 2025
fe9dbdf
updated on push branches
x3c41a Dec 11, 2025
093055d
removed branhces from on pull_request
x3c41a Dec 11, 2025
bf10520
added ci_cd back, modified network_args (added ports)
x3c41a Dec 11, 2025
dd19e8f
removed flag in wget
x3c41a Dec 11, 2025
589bea6
added docker setup
x3c41a Dec 11, 2025
913d51a
added missing dependency
x3c41a Dec 11, 2025
9916426
commented out first test - debugging second
x3c41a Dec 12, 2025
500e522
fixed commit
x3c41a Dec 12, 2025
1a6af76
reverted import, increased node version to 22
x3c41a Dec 12, 2025
5a66383
uncommented first test
x3c41a Dec 12, 2025
2a28be5
reverted branches
x3c41a Dec 12, 2025
395be51
Update .github/workflows/integration-test.yml
x3c41a Dec 12, 2025
36e187c
removed local set-up
x3c41a Dec 12, 2025
6945ee7
Update examples/justfile
bkontur Dec 12, 2025
67a2a29
parametrized run-authorize-and-store
x3c41a Dec 12, 2025
c23ec0e
removed duplicate
x3c41a Dec 12, 2025
d2a6cd4
Update examples/justfile
x3c41a Dec 12, 2025
4fab99c
Removed older TODO
bkontur Dec 12, 2025
4586875
Extract node version
bkontur Dec 12, 2025
aac0a2a
Actually use CI_IMAGE and align with check.yml
bkontur Dec 12, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ jobs:

- name: Run authorize and store (PAPI, smoldot)
working-directory: examples
run: just run-authorize-and-store-smoldot-docker
run: just run-authorize-and-store-smoldot

- name: Run authorize and store (PAPI, RPC node)
working-directory: examples
run: just run-authorize-and-store-docker
run: just run-authorize-and-store
212 changes: 17 additions & 195 deletions examples/justfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,58 +28,6 @@ _ipfs-cmd:
exit 1
fi

# Initialize IPFS if not already initialized
ipfs-init:
#!/usr/bin/env bash
set -e
IPFS_CMD=$(just _ipfs-cmd)
echo "🔧 Using IPFS: $IPFS_CMD"

if [ ! -d ~/.ipfs ]; then
echo "📦 Initializing IPFS..."
$IPFS_CMD init
else
echo "✅ IPFS already initialized"
fi

# Start IPFS daemon in background
ipfs-start:
#!/usr/bin/env bash
set -e
mkdir -p {{ PID_DIR }}
IPFS_CMD=$(just _ipfs-cmd)

echo "🔧 Using IPFS: $IPFS_CMD"
echo "📡 Starting IPFS daemon..."
$IPFS_CMD daemon > /tmp/ipfs-daemon.log 2>&1 &
echo $! > {{ PID_DIR }}/ipfs.pid
echo " IPFS PID: $!"
echo " Log: /tmp/ipfs-daemon.log"
sleep 2

# Connect to IPFS nodes
ipfs-connect:
#!/usr/bin/env bash
set -e
IPFS_CMD=$(just _ipfs-cmd)

echo "🔧 Using IPFS: $IPFS_CMD"
echo "🔗 Connecting IPFS nodes..."
$IPFS_CMD swarm connect /ip4/127.0.0.1/tcp/12347/ws/p2p/12D3KooWRkZhiRhsqmrQ28rt73K7V3aCBpqKrLGSXmZ99PTcTZby || true
$IPFS_CMD swarm connect /ip4/127.0.0.1/tcp/10001/ws/p2p/12D3KooWQCkBm1BYtkHpocxCwMgR8yjitEeHGx8spzcDLGt2gkBm || true

# Shutdown IPFS daemon
ipfs-shutdown:
#!/usr/bin/env bash
IPFS_CMD=$(just _ipfs-cmd)

echo "🔧 Using IPFS: $IPFS_CMD"
echo "🛑 Shutting down IPFS daemon..."
$IPFS_CMD shutdown 2>/dev/null || echo " ⚠ IPFS not running or already stopped"

# Clean up PID file if it exists
[ -f "{{ PID_DIR }}/ipfs.pid" ] && rm "{{ PID_DIR }}/ipfs.pid" && echo " ✓ Cleaned up PID file" || true

# Start start solo chain with zombienet in background
bulletin-solo-zombienet-start:
#!/usr/bin/env bash
Expand Down Expand Up @@ -117,132 +65,6 @@ bulletin-solo-zombienet-start:
echo " Waiting for chain to start (15 seconds)..."
sleep 15

# Start IPFS reconnect script in background
ipfs-reconnect-start:
#!/usr/bin/env bash
set -e

mkdir -p {{ PID_DIR }}

echo "🔄 Starting IPFS reconnect script..."
./scripts/ipfs-reconnect-solo.sh > /tmp/ipfs-reconnect.log 2>&1 &
RECONNECT_PID=$!
echo $RECONNECT_PID > {{ PID_DIR }}/ipfs-reconnect.pid
echo " Reconnect PID: $RECONNECT_PID"
echo " Log: /tmp/ipfs-reconnect.log"
sleep 2

# Generate PAPI descriptors
papi-generate:
#!/usr/bin/env bash
set -e

echo "🔧 Generating PAPI descriptors..."
npm run papi:generate

# Setup all services needed for testing (IPFS, zombienet, IPFS reconnect, PAPI)
# Parameters: api=[papi|pjs] - choose between Polkadot API (papi) or Polkadot JS (pjs)
setup-services api="papi":
#!/usr/bin/env bash
set -e

API_TYPE="{{ api }}"

echo "🔧 Tearing down services if they are running..."
just ipfs-shutdown

echo "🔧 Setting up services for $API_TYPE..."

# Initialize IPFS
just ipfs-init

# Start services
just ipfs-start
just bulletin-solo-zombienet-start
just ipfs-connect
just ipfs-reconnect-start

# Generate PAPI descriptors if needed
if [ "$API_TYPE" == "papi" ]; then
just papi-generate
fi

echo "✅ Services setup complete"

# Stop all running services (IPFS, zombienet, reconnect script)
teardown-services:
#!/usr/bin/env bash

echo "🧹 Stopping all services..."

# Stop services by reading PIDs from files
if [ -d {{ PID_DIR }} ]; then
for pidfile in {{ PID_DIR }}/*.pid; do
if [ -f "$pidfile" ]; then
PID=$(cat "$pidfile")
SERVICE=$(basename "$pidfile" .pid)
if kill $PID 2>/dev/null; then
echo " ✓ Stopped $SERVICE (PID: $PID)"
else
echo " ⚠ $SERVICE (PID: $PID) not running or already stopped"
fi
rm "$pidfile"
fi
done
rmdir {{ PID_DIR }} 2>/dev/null || true
else
echo " No running services found"
fi

echo "✅ Services stopped"

# Test the complete workflow (builds, starts services, runs example, shuts down services)
# Parameters: api=[papi|pjs] - choose between Polkadot API (papi) or Polkadot JS (pjs)
run-authorize-and-store api="papi": build npm-install
#!/usr/bin/env bash
set -e

API_TYPE="{{ api }}"

if [[ "$API_TYPE" != "papi" && "$API_TYPE" != "pjs" ]]; then
echo "❌ Error: api parameter must be 'papi' or 'pjs'"
exit 1
fi

echo "🚀 Starting $API_TYPE workflow test..."
echo ""

# Setup all services
just setup-services $API_TYPE

# Run the example
if [ "$API_TYPE" == "papi" ]; then
EXAMPLE_FILE="authorize_and_store_papi.js"
else
EXAMPLE_FILE="authorize_and_store.js"
fi
node $EXAMPLE_FILE
EXAMPLE_EXIT=$?

echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
if [ $EXAMPLE_EXIT -eq 0 ]; then
echo "✅ Example completed successfully!"
else
echo "❌ Example failed with exit code $EXAMPLE_EXIT"
fi

echo ""
echo "📝 Logs available at:"
echo " /tmp/ipfs-daemon.log"
echo " /tmp/zombienet.log"
echo " /tmp/ipfs-reconnect.log"

# Clean up background processes
just teardown-services

exit $EXAMPLE_EXIT

# Run smoldot example with local Kubo
run-authorize-and-store-smoldot: build npm-install
#!/usr/bin/env bash
Expand Down Expand Up @@ -272,7 +94,7 @@ _check-docker:
fi

# Start IPFS Docker container
ipfs-docker-start: _check-docker
ipfs-start: _check-docker
#!/usr/bin/env bash
set -e
mkdir -p {{ PID_DIR }}
Expand Down Expand Up @@ -301,7 +123,7 @@ ipfs-docker-start: _check-docker
echo "ipfs-node" > {{ PID_DIR }}/ipfs-docker.container

# Connect to IPFS nodes using Docker
ipfs-docker-connect:
ipfs-connect:
#!/usr/bin/env bash
set -e

Expand All @@ -323,7 +145,7 @@ ipfs-docker-connect:
docker exec ipfs-node ipfs swarm connect /$PROTOCOL/$DOCKER_HOST/tcp/12347/ws/p2p/12D3KooWRkZhiRhsqmrQ28rt73K7V3aCBpqKrLGSXmZ99PTcTZby || true

# Shutdown IPFS Docker container
ipfs-docker-shutdown:
ipfs-shutdown:
#!/usr/bin/env bash

echo "🛑 Shutting down IPFS Docker container..."
Expand All @@ -334,7 +156,7 @@ ipfs-docker-shutdown:
[ -f "{{ PID_DIR }}/ipfs-docker.container" ] && rm "{{ PID_DIR }}/ipfs-docker.container" && echo " ✓ Cleaned up container file" || true

# Start IPFS reconnect script in background (Docker mode)
ipfs-reconnect-docker-start:
ipfs-reconnect-start:
#!/usr/bin/env bash
set -e

Expand All @@ -349,17 +171,17 @@ ipfs-reconnect-docker-start:
sleep 2

# Setup all services using Docker for IPFS
setup-services-docker:
setup-services:
#!/usr/bin/env bash
set -e

echo "🔧 Tearing down Docker services if they are running..."
just ipfs-docker-shutdown
just ipfs-shutdown

echo "🐳 Setting up services with Docker IPFS..."

# Start services with Docker
just ipfs-docker-start
just ipfs-start
just bulletin-solo-zombienet-start

# Wait a bit longer and verify zombienet is running
Expand All @@ -370,14 +192,14 @@ setup-services-docker:
echo " Checking zombienet log:"
tail -20 /tmp/zombienet.log || echo " ⚠ Could not read zombienet log"

just ipfs-docker-connect
just ipfs-reconnect-docker-start
just ipfs-connect
just ipfs-reconnect-start
just papi-generate

echo "✅ Services setup complete (Docker mode)"

# Stop all Docker services
teardown-services-docker:
teardown-services:
#!/usr/bin/env bash

echo "🧹 Stopping all Docker services..."
Expand All @@ -399,7 +221,7 @@ teardown-services-docker:
fi

# Stop Docker container
just ipfs-docker-shutdown
just ipfs-shutdown

# Clean up PID directory
if [ -d {{ PID_DIR }} ]; then
Expand All @@ -409,14 +231,14 @@ teardown-services-docker:
echo "✅ Docker services stopped"

# Run RPC node example with Docker IPFS
run-authorize-and-store-docker: build npm-install
run-authorize-and-store: build npm-install
#!/usr/bin/env bash
set -e

echo "🚀 Starting RPC node workflow test with Docker..."
echo ""

just setup-services-docker
just setup-services
node authorize_and_store_papi.js
EXAMPLE_EXIT=$?

Expand All @@ -428,18 +250,18 @@ run-authorize-and-store-docker: build npm-install
echo "❌ Example failed with exit code $EXAMPLE_EXIT"
fi

just teardown-services-docker
just teardown-services
exit $EXAMPLE_EXIT

# Run smoldot example with Docker IPFS
run-authorize-and-store-smoldot-docker: build npm-install
run-authorize-and-store-smoldot: build npm-install
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is duplicate now? We have the same on the line 65?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, I refactored justfile a bit, PTAL

#!/usr/bin/env bash
set -e

echo "🚀 Starting smoldot workflow test with Docker..."
echo ""

just setup-services-docker
just setup-services
node authorize_and_store_papi_smoldot.js
EXAMPLE_EXIT=$?

Expand All @@ -451,5 +273,5 @@ run-authorize-and-store-smoldot-docker: build npm-install
echo "❌ Example failed with exit code $EXAMPLE_EXIT"
fi

just teardown-services-docker
just teardown-services
exit $EXAMPLE_EXIT
Loading