Skip to content

Commit

Permalink
CI: healthy params for teeracle testing
Browse files Browse the repository at this point in the history
  • Loading branch information
brenzi committed Jul 19, 2023
1 parent 258f489 commit ead3b93
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions cli/demo_teeracle_whitelist.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,12 @@ echo "Using client binary ${CLIENT_BIN}"
echo "Using node uri ${NODEURL}:${NPORT}"
echo "Using trusted-worker uri ${WORKER1URL}:${WORKER1PORT}"
echo "Using worker market data update interval ${INTERVAL}"
echo "Count the update events for ${DURATION}"
echo "Count the update events for ${DURATION} blocks"
echo ""

COIN_GECKO="https://api.coingecko.com/"
COIN_MARKET_CAP="https://pro-api.coinmarketcap.com/"
let "MIN_EXPECTED_NUM_OF_EVENTS=$DURATION/$INTERVAL-3"
let "MIN_EXPECTED_NUM_OF_EVENTS=$DURATION*6/$INTERVAL-3"
echo "Minimum expected number of events with a single oracle source: ${MIN_EXPECTED_NUM_OF_EVENTS}"

let "MIN_EXPECTED_NUM_OF_EVENTS_2 = 2*$MIN_EXPECTED_NUM_OF_EVENTS"
Expand All @@ -94,7 +94,7 @@ echo "Reading MRENCLAVE from worker list: ${MRENCLAVE}"
[[ -z $MRENCLAVE ]] && { echo "MRENCLAVE is empty. cannot continue" ; exit 1; }
echo ""

echo "Listen to ExchangeRateUpdated events for ${DURATION} seconds. There should be no trusted oracle source!"
echo "Listen to ExchangeRateUpdated events for ${DURATION} blocks. There should be no trusted oracle source!"
#${CLIENT} ${LISTEN_TO_EXCHANGE_RATE_EVENTS_CMD} ${DURATION}
#echo ""

Expand All @@ -107,25 +107,25 @@ ${CLIENT} ${ADD_TO_WHITELIST_CMD} //Alice ${COIN_GECKO} ${MRENCLAVE}
echo "MRENCLAVE in whitelist for ${COIN_GECKO}"
echo ""

echo "Listen to ExchangeRateUpdated events for ${DURATION} seconds, after a trusted oracle source has been added to the whitelist."
echo "Listen to ExchangeRateUpdated events for ${DURATION} blocks, after a trusted oracle source has been added to the whitelist."
#${CLIENT} ${LISTEN_TO_EXCHANGE_RATE_EVENTS_CMD} ${DURATION}
#echo ""

read EVENTS_COUNT <<< $($CLIENT ${LISTEN_TO_EXCHANGE_RATE_EVENTS_CMD} ${DURATION} | awk '/ EVENTS_COUNT: / { print $2; exit }')
echo "Got ${EVENTS_COUNT} exchange rate updates from the trusted oracle source in ${DURATION} second(s)"
echo "Got ${EVENTS_COUNT} exchange rate updates from the trusted oracle source in ${DURATION} blocks(s)"
echo ""

echo "Add ${COIN_MARKET_CAP} for ${MRENCLAVE} as trusted oracle source"
${CLIENT} ${ADD_TO_WHITELIST_CMD} //Alice ${COIN_MARKET_CAP} ${MRENCLAVE}
echo "MRENCLAVE in whitelist for ${COIN_MARKET_CAP}"
echo ""

echo "Listen to ExchangeRateUpdated events for ${DURATION} seconds, after a second trusted oracle source has been added to the whitelist."
echo "Listen to ExchangeRateUpdated events for ${DURATION} blocks, after a second trusted oracle source has been added to the whitelist."
#${CLIENT} ${LISTEN_TO_EXCHANGE_RATE_EVENTS_CMD} ${DURATION}
#echo ""

read EVENTS_COUNT_2 <<< $($CLIENT ${LISTEN_TO_EXCHANGE_RATE_EVENTS_CMD} ${DURATION} | awk '/ EVENTS_COUNT: / { print $2; exit }')
echo "Got ${EVENTS_COUNT_2} exchange rate updates from 2 trusted oracle sources in ${DURATION} second(s)"
echo "Got ${EVENTS_COUNT_2} exchange rate updates from 2 trusted oracle sources in ${DURATION} blocks(s)"
echo ""

echo "Results :"
Expand Down
2 changes: 1 addition & 1 deletion docker/demo-teeracle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ services:
"/usr/local/worker-cli/demo_teeracle_whitelist.sh
-u ws://integritee-node -p 9912
-V wss://integritee-teeracle-worker -P 2011
-d 21 -i ${TEERACLE_INTERVAL_SECONDS}
-d 7 -i ${TEERACLE_INTERVAL_SECONDS}
-C /usr/local/bin/integritee-cli 2>&1"
restart: "no"
networks:
Expand Down

0 comments on commit ead3b93

Please sign in to comment.