Open qedgardo opened 4 days ago
@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.
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 theguardiand
service configuration, the service fails to start.Steps to reproduce:
--algorandAlgodToken
argument from theguardiand
service configuration.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.