The scaffold-garaga repository provides a starter kit for building a Starknet dApp with Garaga and Noir, including a sample Groth16 proof verification circuit. Below are the steps to run the demo inside your Docker container, ensuring all dependencies are met and the environment is configured correctly.
Ensure you’re in the Docker container where Garaga is installed:
bash
docker run -it -v $(pwd)/garaga_project:/app -w /app python:3.10-slim bash
The -v $(pwd)/garaga_project:/app mounts a local garaga_project directory to /app for file persistence.
Verify Garaga is installed:
bash
pip show garaga
garaga gen
If garaga gen runs without errors, Garaga is installed correctly.
The scaffold-garaga demo requires Node.js (for the frontend), Scarb (for Starknet smart contract compilation), and nargo (for Noir circuits). Install these in the container:
bash
apt-get update && apt-get install -y \\
curl \\
nodejs \\
npm
Install Scarb:Ensure Scarb version is compatible (e.g., 2.9.4 or later, as per related Starknet tools).
bash
curl --proto '=https' --tlsv1.2 -sSf <https://docs.swmansion.com/scarb/install.sh> | bash
export PATH="$HOME/.local/bin:$PATH"
scarb --version
Install Noir (nargo):
bash
curl -L <https://raw.githubusercontent.com/noir-lang/noirup/main/install> | bash
export PATH="$HOME/.nargo/bin:$PATH"
nargo --version
Inside the Docker container, clone the scaffold-garaga repository:
bash
git clone <https://github.com/keep-starknet-strange/scaffold-garaga.git>
cd scaffold-garaga
Python Dependencies: The demo likely uses Garaga and other Python packages. Install any additional dependencies:
bash
pip install -r requirements.txt
If requirements.txt is missing, ensure Garaga and its dependencies (e.g., fastecdsa, crypto-cpp-py) are installed:
bash
pip install garaga
Node.js Dependencies: The frontend (in packages/nextjs) requires Node.js dependencies. Install them:
bash
cd packages/nextjs
npm install
cd ../..
The scaffold-garaga README (inferred from similar Starknet projects like scaffold-stark-2) suggests setting up environment variables for Starknet RPC and wallet details:
Copy the .env.example file to .env:
bash
cp packages/snfoundry/.env.example packages/snfoundry/.env
Edit packages/snfoundry/.env:You can get testnet tokens from faucets like Starknet Faucet or BlastAPI (https://starknet-sepolia.public.blastapi.io).
bash
nano packages/snfoundry/.env
Add your Starknet Sepolia testnet RPC URL, account address, and private key. For example:
RPC_URL_SEPOLIA=https://starknet-sepolia.public.blastapi.io/rpc/v0_7
ACCOUNT_ADDRESS=<your-starknet-account-address>
PRIVATE_KEY=<your-private-key>
Verify the RPC version (should be 0.7.1):
bash
curl -X POST -H "Content-Type: application/json" -d '{"jsonrpc":"2.0", "method":"starknet_specVersion", "id":1}' <https://starknet-sepolia.public.blastapi.io/rpc/v0_7>