Allow algorandAlgodToken to be optional in guardiand for Algorand node integration
Opened this issue · 1 comments
Description and context
By default, Algorand public APIs require an algod_token to be consumed. However, it also allows the option to disable API authentication. When API auth is disabled, the guardiand
service cannot check the Algorand node's block. Currently, if the --algorandAlgodToken
argument is removed from the guardiand
service configuration, the service fails to start.
Steps to reproduce:
- Disable API authentication on the Algorand node.
- Remove the
--algorandAlgodToken
argument from theguardiand
service configuration. - Attempt to start the
guardiand
service.
Expected Behavior:
The guardiand
service should start and function correctly, regardless of whether the --algorandAlgodToken
is provided, when API authentication is disabled on Algorand node.
Actual Behavior:
The guardiand
service fails to start if the --algorandAlgodToken
argument is removed from the configuration or set to ""
.
Definition of done
Update the service configuration to allow --algorandAlgodToken
to be optional.
@qedgardo api token is required by the Client in go-algorand-sdk: https://github.com/algorand/go-algorand-sdk/blob/a55d63f27569304696d4e49971e3342e0b6bed21/client/v2/common/common.go#L157
The guardiand uses go-algorand-sdk, consequently, if you are getting HTTP 401: {"message":"Invalid API Token"} when passing empty string ("") for algorandAlgodToken, we will need to update go-algorand-sdk to only set the authentication header when api token is not empty.