code moved from scripts repo;
dump works
This commit is contained in:
52
test_dump.sh
Normal file
52
test_dump.sh
Normal file
@@ -0,0 +1,52 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Testing dump wallet script..."
|
||||
|
||||
# Test 1: Check if daemon is running
|
||||
if pgrep -f "rincoind" > /dev/null; then
|
||||
echo "✓ RinCoin daemon is running"
|
||||
else
|
||||
echo "✗ RinCoin daemon is NOT running"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Test 2: Check if we can list wallets
|
||||
echo "Testing wallet list..."
|
||||
LIST_RESPONSE=$(curl -s -u "rinrpc:745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"jsonrpc": "2.0", "id": "listwallets", "method": "listwallets", "params": []}' \
|
||||
"http://localhost:9556")
|
||||
|
||||
echo "List wallets response: $LIST_RESPONSE"
|
||||
|
||||
if echo "$LIST_RESPONSE" | grep -q '"main"'; then
|
||||
echo "✓ Main wallet is loaded"
|
||||
else
|
||||
echo "✗ Main wallet is NOT loaded"
|
||||
fi
|
||||
|
||||
# Test 3: Try to dump to a simple path
|
||||
BACKUP_DIR="/mnt/data/docker_vol/rincoin/rincoin-node/data"
|
||||
TIMESTAMP=$(date +%Y%m%d_%H%M%S)
|
||||
BACKUP_FILE="${BACKUP_DIR}/test_dump_${TIMESTAMP}.txt"
|
||||
|
||||
echo "Testing dump to: $BACKUP_FILE"
|
||||
|
||||
DUMP_RESPONSE=$(curl -s -u "rinrpc:745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{"jsonrpc": "2.0", "id": "dumpwallet", "method": "dumpwallet", "params": ["'$BACKUP_FILE'"]}' \
|
||||
"http://localhost:9556/wallet/main")
|
||||
|
||||
echo "Dump response: $DUMP_RESPONSE"
|
||||
|
||||
if echo "$DUMP_RESPONSE" | grep -q '"error"'; then
|
||||
echo "✗ Dump failed with error"
|
||||
else
|
||||
echo "✓ Dump succeeded"
|
||||
if [[ -f "$BACKUP_FILE" ]]; then
|
||||
echo "✓ File exists: $BACKUP_FILE"
|
||||
echo "File size: $(wc -l < "$BACKUP_FILE") lines"
|
||||
else
|
||||
echo "✗ File does not exist"
|
||||
fi
|
||||
fi
|
||||
Reference in New Issue
Block a user