Providers
Instantiate the Vertices library and configure the provider.
Create
/// Initialize Vertices SDK
/// \param config Pass the configuration such as providers and user-defined event handler
/// \return
ret_code_t
vertices_new(vertex_t *config);Parameters
configpointer to config.
typedef struct
{
provider_info_t *provider;
ret_code_t (*vertices_evt_handler)(vtc_evt_t *evt);
} vertex_t;
typedef struct
{
char *url;
short port;
char *header;
const char *cert_pem;
} provider_info_t;Here is an example of configuration for a node (algod) running locally on my machine. Comments give a configuration with Algoexplorer's API.
Return codes
VTC_SUCCESSon successVTC_ERROR_INTERNALif HTTP client cannot be initialized
Health
Return codes
VTC_SUCCESSwhen API can be reachedVTC_HTTP_ERRORwhen an error occurs
Version
Parameters
Pointer to provider_version_t structure that will be filled by the function.
Return codes
VTC_SUCCESSwhenversionhas been filled with node infoVTC_ERROR_OFFLINEwhen node cannot be reached to get info. Version could still be filled with information from a previous call.