// checkConnection is a helper function that checks node connectivity and
// verifies that the API token is correct. Ideally this is done on a regular
// basis and used to monitor the app.
checkConnection is a helper function that checks node connectivity and
verifies that the API token is correct. Ideally this is done on a regular
basis and used to monitor the app.
// checkConnection is a helper function that checks node connectivity and // verifies that the API token is correct . Ideally this is done on a regular // basis and used to monitor the app .
func (ab *AlgorandBuffer) checkConnection() error {
	err := ab.Health()
	if err != nil {
		return fmt.Errorf("failed on node health check. bad url? %s", err)
	}
	err = ab.VerifyToken()
	if err != nil {
		return fmt.Errorf("failed on verifying token. bad token or URL has trailing slash. %s", err)
	}
	return err
}
func ( ab * AlgorandBuffer ) checkConnection ( ) error { err := ab . Health ( ) if err != nil { return fmt . Errorf ( " " , err ) } err = ab . VerifyToken ( ) if err != nil { return fmt . Errorf ( " " , err ) } return err }
checkConnection is a helper function that checks node connectivity and
verifies that the API token is correct.
checkConnection is a helper function that checks node connectivity and verifies that the API token is correct .
// note: for some reason, even a malformed URL can pass the health call.