Skip to content

Commit

Permalink
extend generate-random-id utility... (#1462)
Browse files Browse the repository at this point in the history
* improve windows builds

* install nasm for openssl compilation on win

* install nasm for openssl compilation on win for github

* add create-state, proxy-liteserver, rldp-http-proxy, http-proxy, adnl-proxy, dht-server, libtonlibjson.so and libemulator.so to docker image

* build new artifacts inside Docker

* add files smartcont/auto/* to docker image

* build arm64 in docker branch build

* improve secp256k1 build

* extend generate-random-id with -f parameter (to read addr list from a file)
  • Loading branch information
neodix42 authored Jan 7, 2025
1 parent ce58805 commit 46d4e12
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions utils/generate-random-id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,19 @@ int main(int argc, char *argv[]) {
TRY_RESULT_PREFIX_ASSIGN(addr_list, ton::adnl::AdnlAddressList::create(addr_list_tl), "bad addr list: ");
return td::Status::OK();
});
p.add_checked_option('f', "path to file with addr-list", "addr list to sign", [&](td::Slice key) {
if (addr_list) {
return td::Status::Error("duplicate '-f' option");
}

td::BufferSlice bs(key);
TRY_RESULT_PREFIX(data, td::read_file(key.str()), "failed to read addr-list: ");
TRY_RESULT_PREFIX(as_json_value, td::json_decode(data.as_slice()), "bad addr list JSON: ");
ton::tl_object_ptr<ton::ton_api::adnl_addressList> addr_list_tl;
TRY_STATUS_PREFIX(td::from_json(addr_list_tl, std::move(as_json_value)), "bad addr list TL: ");
TRY_RESULT_PREFIX_ASSIGN(addr_list, ton::adnl::AdnlAddressList::create(addr_list_tl), "bad addr list: ");
return td::Status::OK();
});
p.add_checked_option('i', "network-id", "dht network id (default: -1)", [&](td::Slice key) {
if (network_id_opt) {
return td::Status::Error("duplicate '-i' option");
Expand Down

0 comments on commit 46d4e12

Please sign in to comment.