28 lines
743 B
Bash
28 lines
743 B
Bash
#!/bin/bash
|
|
|
|
# Script to load the main wallet
|
|
# Usage: ./load_main_wallet.sh
|
|
|
|
RPC_USER="rinrpc"
|
|
RPC_PASSWORD="745ce784d5d537fc06105a1b935b7657903cfc71a5fb3b90"
|
|
RPC_HOST="localhost"
|
|
RPC_PORT="9556"
|
|
|
|
echo "Loading main wallet..."
|
|
|
|
LOAD_RESPONSE=$(curl -s -u "$RPC_USER:$RPC_PASSWORD" \
|
|
-H "Content-Type: application/json" \
|
|
-d '{"jsonrpc": "2.0", "id": "loadwallet", "method": "loadwallet", "params": ["main"]}' \
|
|
"http://$RPC_HOST:$RPC_PORT")
|
|
|
|
echo "Response: $LOAD_RESPONSE"
|
|
|
|
if echo "$LOAD_RESPONSE" | grep -q '"error":null'; then
|
|
echo "✓ Main wallet loaded successfully"
|
|
elif echo "$LOAD_RESPONSE" | grep -q "already loaded"; then
|
|
echo "✓ Main wallet is already loaded"
|
|
else
|
|
echo "Failed to load main wallet"
|
|
fi
|
|
|