fix: download then extract #23
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Starknet Installer | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Install required packages | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y curl git python3 python3-venv python3-dev build-essential libgmp-dev pkg-config libssl-dev zstd | |
- name: Install latest Protoc version | |
run: | | |
PROTOC_VERSION=23.3 # Specify the version you need here | |
PROTOC_ZIP=protoc-$PROTOC_VERSION-linux-x86_64.zip | |
curl -OL https://github.com/protocolbuffers/protobuf/releases/download/v$PROTOC_VERSION/$PROTOC_ZIP | |
sudo unzip -o $PROTOC_ZIP -d /usr/local bin/protoc | |
sudo unzip -o $PROTOC_ZIP -d /usr/local 'include/*' | |
rm -f $PROTOC_ZIP | |
- name: Cache Db | |
id: cache-db | |
uses: actions/cache@v3 | |
with: | |
path: | | |
sepolia-testnet.sqlite.zst | |
- name: Download and extract database file | |
if: ${{ steps.cache-db.outputs.cache-hit != 'true' }} | |
run: | | |
mkdir -p $HOME/pathfinder-data | |
curl -L ${{ secrets.PATHFINDER_ARCHIVE_URL }} -o sepolia-testnet.sqlite.zst | |
- name: Extract | |
run: zstd -T0 -d sepolia-testnet.sqlite.zst -o $HOME/pathfinder-data/testnet-sepolia.sqlite | |
- name: Pull Pathfinder Docker image | |
run: | | |
docker pull odesenfans/pathfinder:latest | |
- name: Run Pathfinder container in the background | |
run: | | |
docker run \ | |
--name pathfinder \ | |
--detach \ | |
-p 127.0.0.1:9545:9545 \ | |
--user "$(id -u):$(id -g)" \ | |
-e RUST_LOG=info \ | |
-e PATHFINDER_SYNC_ENABLED=false \ | |
-v $HOME/pathfinder-data:/usr/share/pathfinder/data \ | |
odesenfans/pathfinder:latest \ | |
--storage.state-tries=archive | |
- name: Wait for Pathfinder to be ready | |
run: | | |
start_time=$(date +%s) | |
timeout=10 | |
until curl -s http://127.0.0.1:9545; do | |
current_time=$(date +%s) | |
elapsed_time=$((current_time - start_time)) | |
if [ $elapsed_time -ge $timeout ]; then | |
echo "Pathfinder failed to start within $timeout seconds." | |
docker logs pathfinder | |
exit 1 | |
fi | |
echo "Waiting for Pathfinder to start..." | |
sleep 1 | |
done | |
docker logs pathfinder | |
echo "Pathfinder is up!" | |
- name: Install Rust | |
run: | | |
curl https://sh.rustup.rs -sSf | sh -s -- -y | |
source $HOME/.cargo/env | |
rustup update stable | |
- name: Clone Rust repository | |
run: | | |
git clone https://github.com/keep-starknet-strange/snos.git | |
cd snos | |
- name: Create and activate Python virtual environment | |
run: | | |
cd snos | |
python3 -m venv venv | |
source venv/bin/activate | |
- name: Setup the tests | |
run: | | |
cd snos | |
source venv/bin/activate | |
pip install cairo-lang==0.13.1 "sympy<1.13.0" | |
bash scripts/setup-tests.sh | |
- name: Run cargo command | |
run: | | |
docker logs pathfinder | |
cd snos/crates/bin/prove_block | |
cargo run -p prove_block -- --block-number 38117 --rpc-provider http://127.0.0.1:9545 |