Skip to content
This repository has been archived by the owner on Jun 7, 2023. It is now read-only.

Commit

Permalink
Bump iota.c to v1.0.0 (#15)
Browse files Browse the repository at this point in the history
* Update components

* Updates for iota.c v1.0.0

* Update README and remove outdated url
  • Loading branch information
Sam Chen authored Jul 20, 2022
1 parent 5cd01a1 commit 21600f1
Show file tree
Hide file tree
Showing 9 changed files with 103 additions and 140 deletions.
5 changes: 1 addition & 4 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
[submodule "components/iota_c/iota_c"]
path = components/iota_c/iota_c
url = https://github.com/iotaledger/iota.c.git
branch = dev
[submodule "components/utf8proc/utf8proc"]
path = components/utf8proc/utf8proc
url = https://github.com/JuliaStrings/utf8proc.git
branch = develop
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ This SDK provides some example for testing and learn IOTA Client application, co

**Wallet**

- `wallet_get_balance <bech32 address>` - Get balance from a given bech32 address
- `wallet_address <start_index> <count> <is_change>` - Get ed25519 addresses of the wallet
- `wallet_send_token <sender index> <receiver index> <amount>` - Send tokens from sender address to receiver address

**System**
Expand Down Expand Up @@ -122,8 +122,8 @@ IOTA Wallet --->
WiFi --->
SNTP --->
Event Config --->
(https://api.lb-0.h.chrysalis-devnet.iota.cafe/) IOTA Node URL
(443) IOTA node port number
(192.168.11.111) IOTA Node URL
(14265) IOTA node port number
[ ] IOTA node use tls
(random) Mnemonic
[*] English Mnemonic Only
Expand Down
64 changes: 32 additions & 32 deletions components/iota_c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,32 @@ set(CORE_SRCS
"${IOTA_SRC_DIR}/core/models/inputs/utxo_input.c"
"${IOTA_SRC_DIR}/core/models/outputs/byte_cost_config.c"
"${IOTA_SRC_DIR}/core/models/outputs/features.c"
"${IOTA_SRC_DIR}/core/models/outputs/native_tokens.c"
"${IOTA_SRC_DIR}/core/models/outputs/output_alias.c"
"${IOTA_SRC_DIR}/core/models/outputs/output_basic.c"
"${IOTA_SRC_DIR}/core/models/outputs/output_foundry.c"
"${IOTA_SRC_DIR}/core/models/outputs/output_nft.c"
"${IOTA_SRC_DIR}/core/models/outputs/native_tokens.c"
"${IOTA_SRC_DIR}/core/models/outputs/outputs.c"
"${IOTA_SRC_DIR}/core/models/outputs/storage_deposit.c"
"${IOTA_SRC_DIR}/core/models/outputs/unlock_conditions.c"
"${IOTA_SRC_DIR}/core/models/payloads/transaction.c"
"${IOTA_SRC_DIR}/core/models/payloads/tagged_data.c"
"${IOTA_SRC_DIR}/core/models/payloads/milestone.c"
"${IOTA_SRC_DIR}/core/models/payloads/tagged_data.c"
"${IOTA_SRC_DIR}/core/models/payloads/transaction.c"
"${IOTA_SRC_DIR}/core/models/block.c"
"${IOTA_SRC_DIR}/core/models/signing.c"
"${IOTA_SRC_DIR}/core/models/unlocks.c"
"${IOTA_SRC_DIR}/core/utils/iota_str.c"
"${IOTA_SRC_DIR}/core/utils/bech32.c"
"${IOTA_SRC_DIR}/core/utils/byte_buffer.c"
"${IOTA_SRC_DIR}/core/utils/iota_str.c"
"${IOTA_SRC_DIR}/core/utils/slip10.c"
"${IOTA_SRC_DIR}/core/utils/bech32.c"
"${IOTA_SRC_DIR}/core/utils/uint256.c"
"${IOTA_SRC_DIR}/core/utils/macros.h")
"${IOTA_SRC_DIR}/core/utils/uint256.c")

set(CLIENT_SRCS
"${IOTA_SRC_DIR}/client/network/http_esp32.c"
"${IOTA_SRC_DIR}/client/network/mqtt/mqtt_esp32.c"
"${IOTA_SRC_DIR}/client/api/json_parser/common.c"
"${IOTA_SRC_DIR}/client/api/json_parser/json_utils.c"
"${IOTA_SRC_DIR}/client/api/json_parser/block.c"
"${IOTA_SRC_DIR}/client/api/json_parser/unlocks.c"
"${IOTA_SRC_DIR}/client/api/events/node_event.c"
"${IOTA_SRC_DIR}/client/api/events/sub_blocks_metadata.c"
"${IOTA_SRC_DIR}/client/api/events/sub_milestone_payload.c"
"${IOTA_SRC_DIR}/client/api/events/sub_outputs_payload.c"
"${IOTA_SRC_DIR}/client/api/events/sub_serialized_output.c"
"${IOTA_SRC_DIR}/client/api/json_parser/inputs/inputs.c"
"${IOTA_SRC_DIR}/client/api/json_parser/outputs/features.c"
"${IOTA_SRC_DIR}/client/api/json_parser/outputs/native_tokens.c"
Expand All @@ -45,29 +43,32 @@ set(CLIENT_SRCS
"${IOTA_SRC_DIR}/client/api/json_parser/outputs/outputs.c"
"${IOTA_SRC_DIR}/client/api/json_parser/outputs/unlock_conditions.c"
"${IOTA_SRC_DIR}/client/api/json_parser/payloads/payloads.c"
"${IOTA_SRC_DIR}/client/api/restful/get_node_info.c"
"${IOTA_SRC_DIR}/client/api/restful/response_error.c"
"${IOTA_SRC_DIR}/client/api/restful/get_tips.c"
"${IOTA_SRC_DIR}/client/api/restful/get_output.c"
"${IOTA_SRC_DIR}/client/api/restful/get_health.c"
"${IOTA_SRC_DIR}/client/api/restful/get_block_children.c"
"${IOTA_SRC_DIR}/client/api/json_parser/block.c"
"${IOTA_SRC_DIR}/client/api/json_parser/common.c"
"${IOTA_SRC_DIR}/client/api/json_parser/json_utils.c"
"${IOTA_SRC_DIR}/client/api/json_parser/unlocks.c"
"${IOTA_SRC_DIR}/client/api/restful/faucet_enqueue.c"
"${IOTA_SRC_DIR}/client/api/restful/get_block_metadata.c"
"${IOTA_SRC_DIR}/client/api/restful/get_block.c"
"${IOTA_SRC_DIR}/client/api/restful/get_health.c"
"${IOTA_SRC_DIR}/client/api/restful/get_milestone.c"
"${IOTA_SRC_DIR}/client/api/restful/send_block.c"
"${IOTA_SRC_DIR}/client/api/restful/send_tagged_data.c"
"${IOTA_SRC_DIR}/client/api/restful/faucet_enqueue.c"
"${IOTA_SRC_DIR}/client/api/restful/get_node_info.c"
"${IOTA_SRC_DIR}/client/api/restful/get_output.c"
"${IOTA_SRC_DIR}/client/api/restful/get_outputs_id.c"
"${IOTA_SRC_DIR}/client/api/restful/get_tips.c"
"${IOTA_SRC_DIR}/client/api/restful/get_transaction_included_block.c"
"${IOTA_SRC_DIR}/client/api/events/node_event.c"
"${IOTA_SRC_DIR}/client/api/events/sub_milestone_payload.c"
"${IOTA_SRC_DIR}/client/api/events/sub_blocks_metadata.c"
"${IOTA_SRC_DIR}/client/api/events/sub_outputs_payload.c"
"${IOTA_SRC_DIR}/client/api/events/sub_serialized_output.c")
"${IOTA_SRC_DIR}/client/api/restful/response_error.c"
"${IOTA_SRC_DIR}/client/api/restful/send_block.c"
"${IOTA_SRC_DIR}/client/api/restful/send_tagged_data.c"
"${IOTA_SRC_DIR}/client/network/http_esp32.c"
"${IOTA_SRC_DIR}/client/network/mqtt/mqtt_esp32.c")

set(WALLET_SRCS
"${IOTA_SRC_DIR}/wallet/wallet.c" "${IOTA_SRC_DIR}/wallet/output_basic.c"
"${IOTA_SRC_DIR}/wallet/bip39.c")
"${IOTA_SRC_DIR}/wallet/bip39.c"
"${IOTA_SRC_DIR}/wallet/output_alias.c"
"${IOTA_SRC_DIR}/wallet/output_basic.c"
"${IOTA_SRC_DIR}/wallet/output_foundry.c"
"${IOTA_SRC_DIR}/wallet/wallet.c")

idf_component_register(
SRCS
Expand All @@ -76,12 +77,11 @@ idf_component_register(
${CLIENT_SRCS}
${WALLET_SRCS}
INCLUDE_DIRS
"iota_c/src"
${IOTA_SRC_DIR}
PRIV_REQUIRES
uthash
mqtt
libsodium
esp-tls
esp_http_client
json
utf8proc)
json)
2 changes: 1 addition & 1 deletion components/iota_c/iota_c
Submodule iota_c updated 105 files
11 changes: 0 additions & 11 deletions components/utf8proc/CMakeLists.txt

This file was deleted.

1 change: 0 additions & 1 deletion components/utf8proc/utf8proc
Submodule utf8proc deleted from 3203ba
8 changes: 4 additions & 4 deletions main/Kconfig.projbuild
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ menu "IOTA Wallet"

config EVENTS_HOST
string "Events Node URL"
default "mqtt.lb-0.h.chrysalis-devnet.iota.cafe"
default "192.168.11.111"
help
Iota events node url

Expand Down Expand Up @@ -82,14 +82,14 @@ menu "IOTA Wallet"

config IOTA_NODE_URL
string "IOTA Node URL"
default "https://api.lb-0.h.chrysalis-devnet.iota.cafe/"
default "192.168.11.111"
help
The URL of an IOTA node.

config IOTA_NODE_PORT
int "port number"
range 0 65535
default 443
default 14265
help
The API port of the IOTA node.

Expand Down Expand Up @@ -123,4 +123,4 @@ menu "IOTA Wallet"
help
Build unit tests application

endmenu
endmenu
49 changes: 0 additions & 49 deletions main/cli_restful.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
#include "argtable3/argtable3.h"
#include "cli_restful.h"
#include "client/api/restful/get_block.h"
#include "client/api/restful/get_block_children.h"
#include "client/api/restful/get_block_metadata.h"
#include "client/api/restful/get_node_info.h"
#include "client/api/restful/get_output.h"
Expand Down Expand Up @@ -218,53 +217,6 @@ static void register_api_blk_meta() {
ESP_ERROR_CHECK(esp_console_cmd_register(&api_blk_meta_cmd));
}

/* 'api_blk_children' command */
static struct {
struct arg_str *blk_id;
struct arg_end *end;
} api_blk_children_args;

static int fn_api_blk_children(int argc, char **argv) {
int nerrors = arg_parse(argc, argv, (void **)&api_blk_children_args);
if (nerrors != 0) {
arg_print_errors(stderr, api_blk_children_args.end, argv[0]);
return -1;
}

res_block_children_t *res = res_block_children_new();
if (!res) {
printf("Allocate block children response failed\n");
return -1;
} else {
nerrors = get_block_children(&ctx, api_blk_children_args.blk_id->sval[0], res);
if (nerrors) {
printf("get_block_children error %d\n", nerrors);
} else {
if (res->is_error) {
printf("Err: %s\n", res->u.error->msg);
} else {
print_block_children(res, 0);
}
}
res_block_children_free(res);
}

return nerrors;
}

static void register_api_blk_children() {
api_blk_children_args.blk_id = arg_str1(NULL, NULL, "<ID>", "Block ID");
api_blk_children_args.end = arg_end(2);
const esp_console_cmd_t api_blk_children_cmd = {
.command = "api_blk_children",
.help = "Get children from a given block ID",
.hint = " <Block ID>",
.func = &fn_api_blk_children,
.argtable = &api_blk_children_args,
};
ESP_ERROR_CHECK(esp_console_cmd_register(&api_blk_children_cmd));
}

/* 'api_get_output' command */
static struct {
struct arg_str *output_id;
Expand Down Expand Up @@ -366,7 +318,6 @@ void register_restful_commands() {
register_api_tips();
register_api_get_blk();
register_api_blk_meta();
register_api_blk_children();
register_api_get_output();
register_api_send_tagged_data_str();
}
Expand Down
Loading

0 comments on commit 21600f1

Please sign in to comment.