This document explains how to set up and use Algorand testing tools for the Cardless ID project.
# Test connection to Algorand Testnet
npm run test:algorand:testnet
# Test wallet operations
npm run test:algorand:wallet
# Test credential operations
npm run test:algorand:credential# Set up local Algorand node
npm run setup:localnet
# Start local node
goal node start -d ~/algorand-localnet/node/data
# Test local connection
npm run test:algorand:localnet# Start Algorand node with Docker
npm run docker:localnet
# Test Docker setup
npm run test:algorand:localnet
# Stop Docker setup
npm run docker:localnet:stopcardless-remix/
├── app/
│ ├── utils/
│ │ └── algorand.ts # Algorand utilities
│ └── routes/
│ └── api/
│ └── algorand/ # API routes for testing
├── scripts/
│ ├── test-algorand.js # Main testing script
│ └── localnet-setup.js # LocalNet setup
├── docker/
│ └── algorand-localnet.yml # Docker configuration
└── tests/
├── algorand.test.js # Test files
└── fixtures/ # Test data
# Test all components
npm run test:algorand
# Test specific components
npm run test:algorand:testnet # Testnet connection
npm run test:algorand:localnet # Local node connection
npm run test:algorand:wallet # Wallet operations
npm run test:algorand:credential # Credential operations# Run specific test with custom parameters
node scripts/test-algorand.js testnet --verbose
node scripts/test-algorand.js wallet --address YOUR_ADDRESS# .env.local
VITE_APP_WALLET_ADDRESS=YOUR_WALLET_ADDRESS
VITE_ALGORAND_NETWORK=testnet # or localnet- Testnet:
https://testnet-api.algonode.cloud - Mainnet:
https://mainnet-api.algonode.cloud - LocalNet:
http://localhost:4001
# Install Docker and Docker Compose
# Make sure ports 4001, 4002, 8980 are available# Start Algorand node
npm run docker:localnet
# Check status
docker ps
# View logs
docker logs algorand-localnet# Stop and remove containers
npm run docker:localnet:stop# Start your app
npm run dev
# In another terminal, test Algorand
npm run test:algorand:testnet
npm run test:algorand:wallet# Test credential creation
npm run test:algorand:credential
# Test with your app
# Go to /app/create-credential
# Fill out form and submit
# Check console for Algorand operations# Set up local node
npm run setup:localnet
# Start local node
goal node start -d ~/algorand-localnet/node/data
# Test local connection
npm run test:algorand:localnet
# Create test accounts
goal account new
goal account new1. Connection Failed
# Check if Algorand node is running
curl http://localhost:4001/v2/status
# Check network connectivity
ping testnet-api.algonode.cloud2. Wallet Issues
# Check wallet address
echo $VITE_APP_WALLET_ADDRESS
# Get test ALGO from faucet
# Visit: https://testnet.algoexplorer.io/dispenser3. Docker Issues
# Check Docker status
docker ps
# Check logs
docker logs algorand-localnet
# Restart containers
npm run docker:localnet:stop
npm run docker:localnet# Enable verbose logging
DEBUG=algorand* npm run test:algorand
# Check specific components
node scripts/test-algorand.js testnet --verbose