Skip to content

Commit

Permalink
Merge pull request #1169 from input-output-hk/damien/1152/call-aggreg…
Browse files Browse the repository at this point in the history
…ator-api-to-verify-signer-registration

Call Aggregator API to verify Signer registration
  • Loading branch information
dlachaume authored Aug 22, 2023
2 parents f03bad9 + bbd4cc7 commit 45768aa
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions docs/website/root/manual/getting-started/run-signer-node.md
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ chmod +x verify_signer_registration.sh

Finally, execute the script:
```bash
SIGNER_LOGS_PATH=**YOUR_SIGNER_LOGS_PATH** ./verify_signer_registration.sh
PARTY_ID=**YOUR_PARTY_ID** AGGREGATOR_ENDPOINT=**YOUR_AGGREGATOR_ENDPOINT** ./verify_signer_registration.sh
```

:::tip
Expand All @@ -660,7 +660,7 @@ If your signer is registered, you should see this message:

Otherwise, you should see this error message:
```bash
>> Oops, your signer node is not registered. Check your configuration.
>> Oops, your signer node is not registered. Party ID not found among the signers registered at epoch 430.
```

### Verify your signer contributes with individual signatures
Expand Down
11 changes: 7 additions & 4 deletions docs/website/static/scripts/verify_signer_registration.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,16 @@

set -e

if [ -z "$SIGNER_LOGS_PATH" ]; then
echo ">> ERROR: Required environment variable SIGNER_LOGS_PATH is not set."
if [ -z "$AGGREGATOR_ENDPOINT" ] || [ -z "$PARTY_ID" ]; then
echo ">> ERROR: Required environment variables AGGREGATOR_ENDPOINT and/or PARTY_ID are not set."
exit 1
fi

if grep -q "STATE MACHINE: new cycle: Registered" "$SIGNER_LOGS_PATH"; then
CURRENT_EPOCH=$(curl -s "$AGGREGATOR_ENDPOINT/epoch-settings" -H 'accept: application/json' | jq -r '.epoch')
SIGNERS_REGISTERED_RESPONSE=$(curl -s "$AGGREGATOR_ENDPOINT/signers/registered/$CURRENT_EPOCH" -H 'accept: application/json')

if echo "$SIGNERS_REGISTERED_RESPONSE" | grep -q "$PARTY_ID"; then
echo ">> Congrats, your signer node is registered!"
else
echo ">> Oops, your signer node is not registered. Check your configuration."
echo ">> Oops, your signer node is not registered. Party ID not found among the signers registered at epoch ${CURRENT_EPOCH}."
fi
Original file line number Diff line number Diff line change
Expand Up @@ -640,7 +640,7 @@ chmod +x verify_signer_registration.sh

Finally, execute the script:
```bash
SIGNER_LOGS_PATH=**YOUR_SIGNER_LOGS_PATH** ./verify_signer_registration.sh
PARTY_ID=**YOUR_PARTY_ID** AGGREGATOR_ENDPOINT=**YOUR_AGGREGATOR_ENDPOINT** ./verify_signer_registration.sh
```

:::tip
Expand All @@ -660,7 +660,7 @@ If your signer is registered, you should see this message:

Otherwise, you should see this error message:
```bash
>> Oops, your signer node is not registered. Check your configuration.
>> Oops, your signer node is not registered. Party ID not found among the signers registered at epoch 430.
```

### Verify your signer contributes with individual signatures
Expand Down

0 comments on commit 45768aa

Please sign in to comment.