Skip to content

Commit

Permalink
Merge pull request #52 from switchboard-xyz/add_debug_var
Browse files Browse the repository at this point in the history
SB scripts 51: add DEBUGGING option
  • Loading branch information
eldios authored Oct 31, 2024
2 parents 76b7f91 + 078686a commit 62a3830
Showing 1 changed file with 33 additions and 13 deletions.
46 changes: 33 additions & 13 deletions .scripts/sb/oracle-prepare-request.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ cluster="${1:-devnet}"
priorityFee="${2:-10000}"

PAYER_FILE="/data/${cluster}_payer.json"
DEBUG="${DEBUG:-false}"

if [[ "${cluster}" != "devnet" &&
"${cluster}" != "mainnet" &&
Expand Down Expand Up @@ -75,23 +76,42 @@ echo " -> queueKey: ${queueKey}"

if [[ "${register_oracle}" == "y" || "${register_oracle}" == "Y" ]]; then
echo " "
( \
sb solana on-demand oracle create \
--queue "${queueKey}" \
--cluster "${cluster}" \
--priorityFee "${priorityFee}" \
--keypair "${PAYER_FILE}" \
) 2>/dev/null
if [[ "${DEBUG}" == "true" ]]; then
( \
sb solana on-demand oracle create \
--queue "${queueKey}" \
--cluster "${cluster}" \
--priorityFee "${priorityFee}" \
--keypair "${PAYER_FILE}" \
)
else
( \
sb solana on-demand oracle create \
--queue "${queueKey}" \
--cluster "${cluster}" \
--priorityFee "${priorityFee}" \
--keypair "${PAYER_FILE}" \
) 2>/dev/null
fi
fi

if [[ "${register_guardian}" == "y" || "${register_guardian}" == "Y" ]]; then
echo " "
( \
sb solana on-demand guardian create \
--cluster "${cluster}" \
--priorityFee "${priorityFee}" \
--keypair "${PAYER_FILE}" \
) 2>/dev/null
if [[ "${DEBUG}" == "true" ]]; then
( \
sb solana on-demand guardian create \
--cluster "${cluster}" \
--priorityFee "${priorityFee}" \
--keypair "${PAYER_FILE}" \
)
else
( \
sb solana on-demand guardian create \
--cluster "${cluster}" \
--priorityFee "${priorityFee}" \
--keypair "${PAYER_FILE}" \
) 2>/dev/null
fi
fi

echo " "
Expand Down

0 comments on commit 62a3830

Please sign in to comment.