Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Commit 3cf2d2a

Browse files
authored
Merge pull request #676 from HowJMay/hornet
feat: Allow HORNET/SSL connection
2 parents 0fd5f0a + 6a2ee2d commit 3cf2d2a

File tree

25 files changed

+219
-163
lines changed

25 files changed

+219
-163
lines changed

README.md

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use scenarios such as MAM and [TangleID](https://tangleid.github.io/).
1919

2020
At the moment, it is not feasible to host fully-functioned full nodes on Raspberry Pi class
2121
Arm devices, but Raspberry Pi 3 is known to be capable to execute `Tangle-accelerator`
22-
without problems. Since it is written in C/C++ with [entangled](https://github.com/iotaledger/entangled),
22+
without problems. Since it is written in C/C++ with [iota.c](https://github.com/iotaledger/iota.c),
2323
both footprint and startup time are behaved pretty well.
2424

2525
## Architecture
@@ -90,27 +90,30 @@ Tangle-accelerator is built and launched through Bazel, it also requires Redis t
9090

9191
## Build from Source
9292

93-
Before running tangle-accelerator, please edit binding address/port of accelerator instance, IRI, and redis server in `accelerator/config.h` unless they are all localhost and/or you don't want to provide external connection. With dependency of [entangled](https://github.com/iotaledger/entangled), IRI address doesn't support https at the moment. Here are some configurations and command you might need to change and use:
93+
Before running tangle-accelerator, please edit binding address/port of accelerator instance, IOTA full node, and redis server in `accelerator/config.h` unless they are all localhost and/or you don't want to provide external connection. With dependency of [iota.c](https://github.com/iotaledger/iota.c), IOTA full node address doesn't support https at the moment. Here are some configurations and command you might need to change and use:
9494

95-
* `TA_HOST`: binding address of accelerator instance
96-
* `TA_PORT`: port of accelerator instance
97-
* `IRI_HOST`: binding address of IRI
98-
* `IRI_PORT`: port of IRI
99-
* `HTTP_THREADS`: Determine thread pool size to process HTTP connections.
100-
* `quiet`: Turn off logging message
95+
* `ta_host`: Binding address of accelerator instance.
96+
* `ta_port`: Port of accelerator instance.
97+
* `node_host`: Binding address of IOTA full node which includes IRI and Hornet or other community implementation.
98+
* `node_port`: Port of IOTA full node.
99+
* `http_threads`: Determine thread pool size to process HTTP connections.
100+
* `quiet`: Turn off logging message.
101101

102102
```
103103
$ make && bazel run //accelerator
104104
```
105+
105106
### Building Options
107+
106108
Tangle-accelerator supports several different build time options.
107109

108110
* Docker images
109111
* MQTT connectivity
110112
* External database
111113
* Debug Mode
112114

113-
Debug mode enables tangle-accelerator to display extra `debug` logs.
115+
Debug mode enables tangle-accelerator to display extra `debug` logs.
116+
114117
```
115118
bazel run --define build_type=debug //accelerator
116119
```
@@ -160,13 +163,13 @@ clang-format can be installed by command:
160163
## Usage
161164
`Tangle-accelerator` currently supports two categories of APIs
162165
* Direct API: check [wiki page](https://github.com/DLTcollab/tangle-accelerator/wiki) for details.
163-
* Proxy API to IRI core functionalities
166+
* Proxy API to IOTA core functionalities
164167

165-
### IRI Proxy API
166-
`tangle-accelerator` allows the use of IRI core APIs. The calling process does not have to be aware of the destination machine running IRI. With the exactly same format of IRI API, `tangle-accelerator` would help users forward the request to IRI and forward the response back to users.
167-
We support two way to forward Proxy APIs to IRI:
168-
1. Bypass Proxy APIs directly to IRI.
169-
2. Process the Proxy APIs, then transmit them to IRI.
168+
### Full Node Proxy API
169+
`tangle-accelerator` allows the use of IOTA core APIs. The calling process does not have to be aware of the destination machine running IOTA full node. With the exactly same format of IOTA core APIs, `tangle-accelerator` would help users forward the request to IOTA full node and forward the response back to users.
170+
We support two way to forward Proxy APIs to IOTA full node:
171+
1. Bypass Proxy APIs directly to IOTA full node.
172+
2. Process the Proxy APIs, then transmit them to IOTA full node.
170173

171174
The user can choose which way they want with CLI argument `--proxy_passthrough`.
172175
All the Proxy APIs are supported with the first way.

WORKSPACE

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ git_repository(
1515

1616
git_repository(
1717
name = "iota.c",
18-
commit = "fd9d67989dc5161117b39a9a3351afcfb118bcad",
18+
commit = "3f1c255bd6e7ccc19bd527a83fa4593d342cad32",
1919
remote = "https://github.com/iotaledger/iota.c.git",
2020
)
2121

2222
git_repository(
2323
name = "org_iota_common",
24-
commit = "c644b7715662dc7b73191ae964f4ede06ee6c975",
24+
commit = "cf649803757abf48432d4fa60e9f27ac119bae5f",
2525
remote = "https://github.com/iotaledger/iota_common.git",
2626
)
2727

accelerator/cli_info.h

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@ extern "C" {
2222
*/
2323

2424
typedef enum ta_cli_arg_value_e {
25-
/** TA */
25+
/** tangle-accelerator */
2626
TA_HOST_CLI = 127,
2727
TA_PORT_CLI,
2828

29-
/** IRI */
30-
IRI_HOST_CLI,
31-
IRI_PORT_CLI,
32-
IRI_ADDRESS_CLI,
29+
/** IOTA full node */
30+
NODE_HOST_CLI,
31+
NODE_PORT_CLI,
32+
NODE_ADDRESS_CLI,
3333

3434
/** MQTT */
3535
MQTT_HOST_CLI,
@@ -58,6 +58,8 @@ typedef enum ta_cli_arg_value_e {
5858

5959
/** LOGGER */
6060
QUIET,
61+
62+
CA_PEM,
6163
} ta_cli_arg_value_t;
6264

6365
static struct ta_cli_argument_s {
@@ -73,22 +75,23 @@ static struct ta_cli_argument_s {
7375
{"ta_port", required_argument, NULL, TA_PORT_CLI, "TA listening port"},
7476
{"http_threads", required_argument, NULL, HTTP_THREADS_CLI,
7577
"Determine thread pool size to process HTTP connections."},
76-
{"iri_host", required_argument, NULL, IRI_HOST_CLI, "IRI listening host"},
77-
{"iri_port", required_argument, NULL, IRI_PORT_CLI, "IRI listening port"},
78+
{"node_host", required_argument, NULL, NODE_HOST_CLI, "IOTA full node listening host"},
79+
{"node_port", required_argument, NULL, NODE_PORT_CLI, "IOTA full node listening port"},
80+
{"CA_PEM", required_argument, NULL, CA_PEM, "The path to CA PEM file"},
7881
{"mqtt_host", required_argument, NULL, MQTT_HOST_CLI, "MQTT listening host"},
7982
{"mqtt_root", required_argument, NULL, MQTT_ROOT_CLI, "MQTT listening topic root"},
80-
{"iri_address", required_argument, NULL, IRI_ADDRESS_CLI, " List of IRI listening URL"},
83+
{"node_address", required_argument, NULL, NODE_ADDRESS_CLI, " List of IOTA full node listening URL"},
8184
{"redis_host", required_argument, NULL, REDIS_HOST_CLI, "Redis server listening host"},
8285
{"redis_port", required_argument, NULL, REDIS_PORT_CLI, "Redis server listening port"},
8386
{"db_host", required_argument, NULL, DB_HOST_CLI, "DB server listening host"},
84-
{"milestone_depth", optional_argument, NULL, MILESTONE_DEPTH_CLI, "IRI milestone depth"},
87+
{"milestone_depth", optional_argument, NULL, MILESTONE_DEPTH_CLI, "IOTA full node milestone depth"},
8588
{"mwm", optional_argument, NULL, MWM_CLI, "minimum weight magnitude"},
8689
{"seed", optional_argument, NULL, SEED_CLI, "IOTA seed"},
8790
{"cache", required_argument, NULL, CACHE, "Enable/Disable cache server. It defaults to off"},
8891
{"config", required_argument, NULL, CONF_CLI, "Read configuration file"},
89-
{"proxy_passthrough", no_argument, NULL, PROXY_API, "Pass proxy API directly to IRI without processing"},
92+
{"proxy_passthrough", no_argument, NULL, PROXY_API, "Pass proxy API directly to IOTA full node without processing"},
9093
{"health_track_period", no_argument, NULL, HEALTH_TRACK_PERIOD,
91-
"The period for checking IRI host connection status"},
94+
"The period for checking IOTA full node host connection status"},
9295
{"no-gtta", no_argument, NULL, NO_GTTA, "Disable getTransactionToConfirm (gTTA) when sending transaction"},
9396
{"buffer_list", required_argument, NULL, BUFFER_LIST, "Set the value of `buffer_list_name`"},
9497
{"done_list", required_argument, NULL, DONE_LIST, "Set the value of `done_list_name`"},

accelerator/config.c

Lines changed: 53 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,28 @@
1313
#include "yaml.h"
1414

1515
#define CONFIG_LOGGER "config"
16+
#define CA_PEM_LEN 1208
17+
#define DEFAULT_CA_PEM \
18+
"-----BEGIN CERTIFICATE-----\r\n" \
19+
"MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsF\r\n" \
20+
"ADA5MQswCQYDVQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6\r\n" \
21+
"b24gUm9vdCBDQSAxMB4XDTE1MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTEL\r\n" \
22+
"MAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZMBcGA1UEAxMQQW1hem9uIFJv\r\n" \
23+
"b3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALJ4gHHKeNXj\r\n" \
24+
"ca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgHFzZM\r\n" \
25+
"9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qw\r\n" \
26+
"IFAGbHrQgLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6\r\n" \
27+
"VOujw5H5SNz/0egwLX0tdHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L\r\n" \
28+
"93FcXmn/6pUCyziKrlA4b9v7LWIbxcceVOF34GfID5yHI9Y/QCB/IIDEgEw+OyQm\r\n" \
29+
"jgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC\r\n" \
30+
"AYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3DQEBCwUA\r\n" \
31+
"A4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDI\r\n" \
32+
"U5PMCCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUs\r\n" \
33+
"N+gDS63pYaACbvXy8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vv\r\n" \
34+
"o/ufQJVtMVT8QtPHRh8jrdkPSHCa2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU\r\n" \
35+
"5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2xJNDd2ZhwLnoQdeXeGADbkpy\r\n" \
36+
"rqXRfboQnoZsG4q5WTP468SQvvG5\r\n" \
37+
"-----END CERTIFICATE-----\r\n"
1638

1739
static logger_id_t logger_id;
1840

@@ -46,6 +68,7 @@ status_t cli_core_set(ta_core_t* const core, int key, char* const value) {
4668
iota_config_t* const iota_conf = &core->iota_conf;
4769
ta_cache_t* const cache = &core->cache;
4870
iota_client_service_t* const iota_service = &core->iota_service;
71+
FILE* file = NULL;
4972
char* conf_file = core->conf_file;
5073
#ifdef DB_ENABLE
5174
db_client_service_t* const db_service = &core->db_service;
@@ -83,17 +106,17 @@ status_t cli_core_set(ta_core_t* const core, int key, char* const value) {
83106
}
84107
break;
85108

86-
// IRI configuration
87-
case IRI_HOST_CLI:
109+
// IOTA full node configuration
110+
case NODE_HOST_CLI:
88111
idx = 0;
89-
for (char* p = strtok(value, ","); p && idx < MAX_IRI_LIST_ELEMENTS; p = strtok(NULL, ","), idx++) {
112+
for (char* p = strtok(value, ","); p && idx < MAX_NODE_LIST_ELEMENTS; p = strtok(NULL, ","), idx++) {
90113
ta_conf->iota_host_list[idx] = p;
91114
}
92115
strncpy(iota_service->http.host, ta_conf->iota_host_list[0], HOST_MAX_LEN);
93116
break;
94-
case IRI_PORT_CLI:
117+
case NODE_PORT_CLI:
95118
idx = 0;
96-
for (char* p = strtok(value, ","); p && idx < MAX_IRI_LIST_ELEMENTS; p = strtok(NULL, ","), idx++) {
119+
for (char* p = strtok(value, ","); p && idx < MAX_NODE_LIST_ELEMENTS; p = strtok(NULL, ","), idx++) {
97120
strtol_temp = strtol(p, &strtol_p, 10);
98121
if (strtol_p != p && errno != ERANGE && strtol_temp >= 0 && strtol_temp <= USHRT_MAX) {
99122
ta_conf->iota_port_list[idx] = (uint16_t)strtol_temp;
@@ -103,6 +126,19 @@ status_t cli_core_set(ta_core_t* const core, int key, char* const value) {
103126
}
104127
iota_service->http.port = ta_conf->iota_port_list[0];
105128
break;
129+
130+
case CA_PEM:
131+
if ((file = fopen(value, "r")) == NULL) {
132+
/* The specified configuration file does not exist */
133+
ta_log_error("%s\n", ta_error_to_string(SC_CONF_FOPEN_ERROR));
134+
return SC_CONF_FOPEN_ERROR;
135+
}
136+
char* temp_ca_pem = (char*)malloc(sizeof(char) * (CA_PEM_LEN + 1));
137+
fread(temp_ca_pem, CA_PEM_LEN, 1, file);
138+
iota_service->http.ca_pem = temp_ca_pem;
139+
fclose(file);
140+
break;
141+
106142
case HEALTH_TRACK_PERIOD:
107143
strtol_temp = strtol(value, NULL, 10);
108144
if (strtol_p != value && errno != ERANGE && strtol_temp >= INT_MIN && strtol_temp <= INT_MAX) {
@@ -215,14 +251,15 @@ status_t cli_core_set(ta_core_t* const core, int key, char* const value) {
215251
return SC_OK;
216252
}
217253

218-
status_t ta_set_iota_client_service(iota_client_service_t* service, char const* host, uint16_t port) {
254+
status_t ta_set_iota_client_service(iota_client_service_t* service, char const* host, uint16_t port,
255+
char const* const ca_pem) {
219256
strncpy(service->http.path, "/", CONTENT_TYPE_MAX_LEN);
220257
strncpy(service->http.content_type, "application/json", CONTENT_TYPE_MAX_LEN);
221258
strncpy(service->http.accept, "application/json", CONTENT_TYPE_MAX_LEN);
222259
strncpy(service->http.host, host, HOST_MAX_LEN);
223260
service->http.port = port;
224261
service->http.api_version = 1;
225-
service->http.ca_pem = NULL;
262+
service->http.ca_pem = ca_pem ? ca_pem : DEFAULT_CA_PEM;
226263
service->serializer_type = SR_JSON;
227264
init_json_serializer(&service->serializer);
228265

@@ -248,8 +285,8 @@ status_t ta_core_default_init(ta_core_t* const core) {
248285
ta_conf->host = TA_HOST;
249286
ta_conf->port = TA_PORT;
250287
memset(ta_conf->iota_host_list, 0, sizeof(ta_conf->iota_host_list));
251-
for (int i = 0; i < MAX_IRI_LIST_ELEMENTS; i++) {
252-
ta_conf->iota_port_list[i] = IRI_PORT;
288+
for (int i = 0; i < MAX_NODE_LIST_ELEMENTS; i++) {
289+
ta_conf->iota_port_list[i] = NODE_PORT;
253290
}
254291
ta_conf->http_tpool_size = DEFAULT_HTTP_TPOOL_SIZE;
255292
ta_conf->proxy_passthrough = false;
@@ -267,20 +304,21 @@ status_t ta_core_default_init(ta_core_t* const core) {
267304
cache->done_list_name = DONE_LIST_NAME;
268305
cache->capacity = CACHE_MAX_CAPACITY;
269306

270-
ta_log_info("Initializing IRI configuration\n");
307+
ta_log_info("Initializing IOTA full node configuration\n");
271308
iota_conf->milestone_depth = MILESTONE_DEPTH;
272309
iota_conf->mwm = MWM;
273310
iota_conf->seed = SEED;
274311
char mam_file_path[] = MAM_FILE_PREFIX;
275312
mkstemp(mam_file_path);
276313
iota_conf->mam_file_path = strdup(mam_file_path);
277314

278-
ta_log_info("Initializing IRI connection\n");
315+
ta_log_info("Initializing IOTA full node connection\n");
279316
strncpy(iota_service->http.path, "/", CONTENT_TYPE_MAX_LEN);
280317
strncpy(iota_service->http.content_type, "application/json", CONTENT_TYPE_MAX_LEN);
281318
strncpy(iota_service->http.accept, "application/json", CONTENT_TYPE_MAX_LEN);
282-
strncpy(iota_service->http.host, IRI_HOST, HOST_MAX_LEN);
283-
iota_service->http.port = IRI_PORT;
319+
strncpy(iota_service->http.host, NODE_HOST, HOST_MAX_LEN);
320+
iota_service->http.ca_pem = DEFAULT_CA_PEM;
321+
iota_service->http.port = NODE_PORT;
284322
iota_service->http.api_version = 1;
285323
iota_service->serializer_type = SR_JSON;
286324
#ifdef DB_ENABLE
@@ -440,7 +478,7 @@ status_t ta_core_set(ta_core_t* core) {
440478
db_client_service_t* const db_service = &core->db_service;
441479
#endif
442480
if (iota_client_service_init(iota_service)) {
443-
ta_log_error("Initializing IRI connection failed!\n");
481+
ta_log_error("Initializing IOTA full node connection failed!\n");
444482
ret = SC_OOM;
445483
goto exit;
446484
}
@@ -466,7 +504,7 @@ status_t ta_core_set(ta_core_t* core) {
466504
}
467505

468506
void ta_core_destroy(ta_core_t* const core) {
469-
ta_log_info("Destroying IRI connection\n");
507+
ta_log_info("Destroying IOTA full node connection\n");
470508
#ifdef DB_ENABLE
471509
ta_log_info("Destroying DB connection\n");
472510
db_client_service_free(&core->db_service);

accelerator/config.h

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ extern "C" {
4949
#define DEFAULT_HTTP_TPOOL_SIZE 4 /**< Thread number of MHD thread pool */
5050
#define MAX_HTTP_TPOOL_SIZE \
5151
(get_nprocs_conf() - get_nthds_per_phys_proc()) /** < Preserve at least one physical processor */
52-
#define IRI_HOST "localhost"
53-
#define IRI_PORT 14265
54-
#define MAX_IRI_LIST_ELEMENTS 5
52+
#define NODE_HOST "localhost"
53+
#define NODE_PORT 443
54+
#define MAX_NODE_LIST_ELEMENTS 5
5555
#define DB_HOST "localhost"
5656
#define MILESTONE_DEPTH 3
5757
#define MWM 14
@@ -73,12 +73,12 @@ extern "C" {
7373

7474
/** struct type of accelerator configuration */
7575
typedef struct ta_config_s {
76-
char* version; /**< Binding version of tangle-accelerator */
77-
char* host; /**< Binding address of tangle-accelerator */
78-
int port; /**< Binding port of tangle-accelerator */
79-
char* iota_host_list[MAX_IRI_LIST_ELEMENTS]; /**< List of binding hosts of IOTA services */
80-
uint16_t iota_port_list[MAX_IRI_LIST_ELEMENTS]; /**< List of binding ports of IOTA services */
81-
int health_track_period; /**< The period for checking IRI host connection status */
76+
char* version; /**< Binding version of tangle-accelerator */
77+
char* host; /**< Binding address of tangle-accelerator */
78+
int port; /**< Binding port of tangle-accelerator */
79+
char* iota_host_list[MAX_NODE_LIST_ELEMENTS]; /**< List of binding hosts of IOTA services */
80+
uint16_t iota_port_list[MAX_NODE_LIST_ELEMENTS]; /**< List of binding ports of IOTA services */
81+
int health_track_period; /**< The period for checking full node connection status */
8282
#ifdef MQTT_ENABLE
8383
char* mqtt_host; /**< Address of MQTT broker host */
8484
char* mqtt_topic_root; /**< The topic root of MQTT topic */
@@ -196,12 +196,14 @@ void ta_core_destroy(ta_core_t* const core);
196196
* @param service[in] IOTA client service
197197
* @param host[in] host of connecting service
198198
* @param port[in] port of connecting service
199+
* @param ca_pem[in] CA PEM path
199200
*
200201
* @return
201202
* - SC_OK on success
202203
* - non-zero on error
203204
*/
204-
status_t ta_set_iota_client_service(iota_client_service_t* service, char const* host, uint16_t port);
205+
status_t ta_set_iota_client_service(iota_client_service_t* service, char const* host, uint16_t port,
206+
char const* const ca_pem);
205207

206208
#ifdef __cplusplus
207209
}

accelerator/core/apis.c

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,8 @@ status_t api_send_transfer(const ta_core_t* const core, const iota_client_servic
281281
}
282282

283283
// return transaction object
284-
if (hash243_queue_push(&txn_obj_req->hashes, hash243_queue_peek(res->hash))) {
284+
if (hash243_queue_count(res->hash) == 0 || hash243_queue_push(&txn_obj_req->hashes, hash243_queue_peek(res->hash))) {
285+
ret = SC_CCLIENT_FAILED_RESPONSE;
285286
ta_log_error("%s\n", "hash243_queue_push failed");
286287
goto done;
287288
}
@@ -342,30 +343,30 @@ status_t api_send_trytes(const ta_config_t* const info, const iota_config_t* con
342343
return ret;
343344
}
344345

345-
status_t api_get_iri_status(const iota_client_service_t* const service, char** json_result) {
346+
status_t api_get_node_status(const iota_client_service_t* const service, char** json_result) {
346347
status_t ret = SC_OK;
347348

348-
ret = ta_get_iri_status(service);
349+
ret = ta_get_node_status(service);
349350
switch (ret) {
350351
/*
351352
* The values of each status_t are listed as the following. Not listed status code are unexpected errors which
352353
* would cause TA return error.
353354
*
354-
* SC_CCLIENT_FAILED_RESPONSE: Can't connect to IRI host
355-
* SC_CORE_IRI_UNSYNC: IRI host is not at the latest milestone
356-
* SC_OK: IRI host works fine.
355+
* SC_CCLIENT_FAILED_RESPONSE: Can't connect to IOTA full node
356+
* SC_CORE_NODE_UNSYNC: IOTA full node is not at the latest milestone
357+
* SC_OK: IOTA full node works fine.
357358
**/
358359
case SC_CCLIENT_FAILED_RESPONSE:
359-
case SC_CORE_IRI_UNSYNC:
360+
case SC_CORE_NODE_UNSYNC:
360361
case SC_OK:
361-
ret = get_iri_status_res_serialize(ret, json_result);
362+
ret = get_node_status_res_serialize(ret, json_result);
362363
if (ret) {
363364
ta_log_error("failed to serialize. status code: %d\n", ret);
364365
}
365366
break;
366367

367368
default:
368-
ta_log_error("check IRI connection failed. status code: %d\n", ret);
369+
ta_log_error("check IOTA full node connection failed. status code: %d\n", ret);
369370
break;
370371
}
371372

0 commit comments

Comments
 (0)