Skip to content

Commit

Permalink
remove check before apply
Browse files Browse the repository at this point in the history
  • Loading branch information
thanhson1085 committed Nov 23, 2018
1 parent 531e188 commit 6d52cd7
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions apply.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,7 @@ echo $chainBlockNumber
echo $nodeBlockNumber

if [ "${chainBlockNumber}" == "${nodeBlockNumber}" ]; then
# store the whole response with the status at the and
HTTP_RESPONSE=$(curl --silent --write-out "HTTPSTATUS:%{http_code}" -X GET ${TOMOMASTER}/api/candidates/${COINBASE_ADDRESS}/isCandidate)

# extract the body
HTTP_BODY=$(echo $HTTP_RESPONSE | sed -e 's/HTTPSTATUS\:.*//g')


if [ "${HTTP_BODY}" != "1" ]; then
curl --header "Content-Type: application/json" \
--request POST \
"${TOMOMASTER}/api/candidates/apply?key=${OWNER_PRIVATE_KEY}&coinbase=${COINBASE_ADDRESS}&name=${NODE_NAME}"
fi
curl --header "Content-Type: application/json" \
--request POST \
"${TOMOMASTER}/api/candidates/apply?key=${OWNER_PRIVATE_KEY}&coinbase=${COINBASE_ADDRESS}&name=${NODE_NAME}"
fi

0 comments on commit 6d52cd7

Please sign in to comment.