Skip to content

Commit ba8c9fc

Browse files
feat: update transaction script to use Solana testnet
1 parent 572dc28 commit ba8c9fc

File tree

1 file changed

+10
-28
lines changed

1 file changed

+10
-28
lines changed

scripts/run_tornado_transaction.sh

Lines changed: 10 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -28,36 +28,22 @@ MERKLE_TREE=""
2828
WALLET_PATH="$HOME/.config/solana/id.json"
2929
DENOMINATION=1 # 1 SOL
3030
MERKLE_TREE_HEIGHT=20
31-
RPC_URL="http://localhost:8899"
32-
33-
# Step 1: Start a local validator (if not already running)
34-
echo -e "${YELLOW}Step 1: Starting local validator...${NC}"
35-
# Check if validator is already running
36-
if ! solana config get | grep -q "http://localhost:8899"; then
37-
# Start validator in the background
38-
solana-test-validator --quiet --reset &
39-
VALIDATOR_PID=$!
40-
echo "Local validator started with PID: $VALIDATOR_PID"
41-
42-
# Wait for validator to start
43-
echo "Waiting for validator to start..."
44-
sleep 10
45-
46-
# Configure Solana CLI to use local validator
47-
solana config set --url $RPC_URL
48-
else
49-
echo "Local validator already running"
50-
fi
31+
RPC_URL="https://api.testnet.solana.com"
32+
33+
# Step 1: Configure Solana CLI to use testnet
34+
echo -e "${YELLOW}Step 1: Configuring Solana CLI to use testnet...${NC}"
35+
solana config set --url $RPC_URL
36+
echo "Connected to Solana testnet"
5137

5238
# Create a new wallet if it doesn't exist
5339
if [ ! -f "$WALLET_PATH" ]; then
5440
echo "Creating new wallet..."
5541
solana-keygen new --no-bip39-passphrase -o "$WALLET_PATH"
5642
fi
5743

58-
# Airdrop SOL to the wallet
59-
echo "Airdropping 10 SOL to wallet..."
60-
solana airdrop 10 $(solana address) || true
44+
# Airdrop SOL to the wallet (testnet has a lower limit)
45+
echo "Airdropping 1 SOL to wallet..."
46+
solana airdrop 1 $(solana address) || true
6147
sleep 2
6248

6349
# Step 2: Install dependencies for the client
@@ -236,10 +222,6 @@ echo "Recipient balance: $RECIPIENT_BALANCE SOL"
236222

237223
# Cleanup
238224
echo -e "${YELLOW}Cleaning up...${NC}"
239-
# Kill the validator if we started it
240-
if [ ! -z "$VALIDATOR_PID" ]; then
241-
kill $VALIDATOR_PID
242-
echo "Local validator stopped"
243-
fi
225+
echo "No cleanup needed for testnet"
244226

245227
echo -e "${GREEN}Script completed!${NC}"

0 commit comments

Comments
 (0)