Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ jobs:
build-docker-image:
needs: changes
if: ${{ needs.changes.outputs.v2 == 'true' || needs.changes.outputs.common == 'true' || needs.changes.outputs.docker == 'true' }}
uses: logos-messaging/nwaku/.github/workflows/container-image.yml@master
uses: logos-messaging/logos-messaging-nim/.github/workflows/container-image.yml@master
secrets: inherit

nwaku-nwaku-interop-tests:
Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,10 @@ endif
##################
.PHONY: deps libbacktrace

FOUNDRY_VERSION := 1.5.0
PNPM_VERSION := 10.23.0


rustup:
ifeq (, $(shell which cargo))
# Install Rustup if it's not installed
Expand All @@ -128,7 +132,7 @@ ifeq (, $(shell which cargo))
endif

rln-deps: rustup
./scripts/install_rln_tests_dependencies.sh
./scripts/install_rln_tests_dependencies.sh $(FOUNDRY_VERSION) $(PNPM_VERSION)

deps: | deps-common nat-libs waku.nims

Expand Down
47 changes: 42 additions & 5 deletions scripts/install_anvil.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,51 @@

# Install Anvil

if ! command -v anvil &> /dev/null; then
REQUIRED_FOUNDRY_VERSION="$1"

if command -v anvil &> /dev/null; then
# Foundry is already installed; check the current version.
CURRENT_FOUNDRY_VERSION=$(anvil --version 2>/dev/null | awk '{print $2}')

if [ -n "$CURRENT_FOUNDRY_VERSION" ]; then
# Compare CURRENT_FOUNDRY_VERSION < REQUIRED_FOUNDRY_VERSION using sort -V
lower_version=$(printf '%s\n%s\n' "$CURRENT_FOUNDRY_VERSION" "$REQUIRED_FOUNDRY_VERSION" | sort -V | head -n1)

if [ "$lower_version" != "$REQUIRED_FOUNDRY_VERSION" ]; then
echo "Anvil is already installed with version $CURRENT_FOUNDRY_VERSION, which is older than the required $REQUIRED_FOUNDRY_VERSION. Please update Foundry manually if needed."
fi
fi
else
BASE_DIR="${XDG_CONFIG_HOME:-$HOME}"
FOUNDRY_DIR="${FOUNDRY_DIR:-"$BASE_DIR/.foundry"}"
FOUNDRY_BIN_DIR="$FOUNDRY_DIR/bin"

echo "Installing Foundry..."
curl -L https://foundry.paradigm.xyz | bash
# Extract the source path from the download result
echo "foundryup_path: $FOUNDRY_BIN_DIR"
# run foundryup
$FOUNDRY_BIN_DIR/foundryup

# Add Foundry to PATH for this script session
export PATH="$FOUNDRY_BIN_DIR:$PATH"

# Verify foundryup is available
if ! command -v foundryup >/dev/null 2>&1; then
echo "Error: foundryup installation failed or not found in $FOUNDRY_BIN_DIR"
exit 1
fi

# Run foundryup to install the required version
if [ -n "$REQUIRED_FOUNDRY_VERSION" ]; then
echo "Installing Foundry tools version $REQUIRED_FOUNDRY_VERSION..."
foundryup --install "$REQUIRED_FOUNDRY_VERSION"
else
echo "Installing latest Foundry tools..."
foundryup
fi

# Verify anvil was installed
if ! command -v anvil >/dev/null 2>&1; then
echo "Error: anvil installation failed"
exit 1
fi

echo "Anvil successfully installed: $(anvil --version)"
fi
35 changes: 32 additions & 3 deletions scripts/install_pnpm.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,37 @@
#!/usr/bin/env bash

# Install pnpm
if ! command -v pnpm &> /dev/null; then
echo "pnpm is not installed, installing it now..."
npm i pnpm --global

REQUIRED_PNPM_VERSION="$1"

if command -v pnpm &> /dev/null; then
# pnpm is already installed; check the current version.
CURRENT_PNPM_VERSION=$(pnpm --version 2>/dev/null)

if [ -n "$CURRENT_PNPM_VERSION" ]; then
# Compare CURRENT_PNPM_VERSION < REQUIRED_PNPM_VERSION using sort -V
lower_version=$(printf '%s\n%s\n' "$CURRENT_PNPM_VERSION" "$REQUIRED_PNPM_VERSION" | sort -V | head -n1)

if [ "$lower_version" != "$REQUIRED_PNPM_VERSION" ]; then
echo "pnpm is already installed with version $CURRENT_PNPM_VERSION, which is older than the required $REQUIRED_PNPM_VERSION. Please update pnpm manually if needed."
fi
fi
else
# Install pnpm using npm
if [ -n "$REQUIRED_PNPM_VERSION" ]; then
echo "Installing pnpm version $REQUIRED_PNPM_VERSION..."
npm install -g pnpm@$REQUIRED_PNPM_VERSION
else
echo "Installing latest pnpm..."
npm install -g pnpm
fi

# Verify pnpm was installed
if ! command -v pnpm >/dev/null 2>&1; then
echo "Error: pnpm installation failed"
exit 1
fi

echo "pnpm successfully installed: $(pnpm --version)"
fi

8 changes: 5 additions & 3 deletions scripts/install_rln_tests_dependencies.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
#!/usr/bin/env bash

# Install Anvil
./scripts/install_anvil.sh
FOUNDRY_VERSION="$1"
./scripts/install_anvil.sh "$FOUNDRY_VERSION"

#Install pnpm
./scripts/install_pnpm.sh
# Install pnpm
PNPM_VERSION="$2"
./scripts/install_pnpm.sh "$PNPM_VERSION"
Loading