Skip to content

Commit

Permalink
updated tonlib
Browse files Browse the repository at this point in the history
- updated tonlib
- updated validator
- updated documentation
- first version of http over rldp proxy
  • Loading branch information
ton committed Feb 6, 2020
1 parent 53ec968 commit 77842f9
Show file tree
Hide file tree
Showing 128 changed files with 10,520 additions and 2,250 deletions.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ if (LATEX_FOUND)
add_latex_document(doc/tvm.tex TARGET_NAME ton_vm_description)
add_latex_document(doc/tblkch.tex TARGET_NAME ton_blockchain_description)
add_latex_document(doc/fiftbase.tex TARGET_NAME fift_basic_description)
add_latex_document(doc/catchain.tex TARGET_NAME catchain_consensus_description)
endif()
#END internal

Expand Down Expand Up @@ -374,6 +375,8 @@ add_subdirectory(validator-engine)
add_subdirectory(validator-engine-console)
add_subdirectory(dht-server)
add_subdirectory(utils)
add_subdirectory(http)
add_subdirectory(rldp-http-proxy)
endif()
#END internal

Expand Down Expand Up @@ -473,6 +476,9 @@ target_link_libraries(test-ton-collator overlay tdutils tdactor adnl tl_api dht
#add_executable(test-ext-client test/test-ext-client.cpp)
#target_link_libraries(test-ext-client tdutils tdactor adnl tl_api tl-lite-utils)

add_executable(test-http test/test-http.cpp)
target_link_libraries(test-http PRIVATE tonhttp)

get_directory_property(HAS_PARENT PARENT_DIRECTORY)
if (HAS_PARENT)
set(ALL_TEST_SOURCE
Expand Down
16 changes: 8 additions & 8 deletions GPLv2
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*
/*
This file is part of TON Blockchain source code.

TON Blockchain is free software; you can redistribute it and/or
Expand All @@ -14,13 +14,13 @@
You should have received a copy of the GNU General Public License
along with TON Blockchain. If not, see <http://www.gnu.org/licenses/>.

In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
You must obey the GNU General Public License in all respects for all
of the code used other than OpenSSL. If you modify file(s) with this
exception, you may extend this exception to your version of the file(s),
but you are not obligated to do so. If you do not wish to do so, delete this
exception statement from your version. If you delete this exception statement
In addition, as a special exception, the copyright holders give permission
to link the code of portions of this program with the OpenSSL library.
You must obey the GNU General Public License in all respects for all
of the code used other than OpenSSL. If you modify file(s) with this
exception, you may extend this exception to your version of the file(s),
but you are not obligated to do so. If you do not wish to do so, delete this
exception statement from your version. If you delete this exception statement
from all source files in the program, then also delete it here.

Copyright 2017-2020 Telegram Systems LLP
Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-address-list.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "adnl-address-list.hpp"
#include "adnl-peer-table.h"
Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-address-list.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-channel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "adnl-channel.hpp"
#include "adnl-peer.h"
Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-channel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-local-id.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "td/utils/crypto.h"
#include "td/utils/Random.h"
Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-local-id.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-network-manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "adnl-network-manager.hpp"
#include "adnl-peer-table.h"
Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-peer-table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "adnl-peer-table.hpp"
#include "adnl-peer.h"
Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-peer-table.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-peer-table.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
2 changes: 1 addition & 1 deletion adnl/adnl-peer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
You should have received a copy of the GNU Lesser General Public License
along with TON Blockchain Library. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "adnl-peer.h"
#include "adnl-peer.hpp"
Expand Down
2 changes: 1 addition & 1 deletion blockchain-explorer/blockchain-explorer-http.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
exception statement from your version. If you delete this exception statement
from all source files in the program, then also delete it here.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
64 changes: 38 additions & 26 deletions blockchain-explorer/blockchain-explorer-query.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
from all source files in the program, then also delete it here.
along with TON Blockchain. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "blockchain-explorer-query.hpp"
#include "blockchain-explorer-http.hpp"
Expand All @@ -47,7 +47,7 @@
#include "vm/boc.h"
#include "vm/cellops.h"
#include "vm/cells/MerkleProof.h"
#include "vm/continuation.h"
#include "vm/vm.h"
#include "vm/cp0.h"

namespace {
Expand Down Expand Up @@ -198,8 +198,9 @@ void HttpQueryCommon::abort_query(td::Status error) {
HttpAnswer A{"error", prefix_};
A.abort(std::move(error));
auto page = A.finish();
promise_.set_value(
MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY));
auto R = MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY);
MHD_add_response_header(R, "Content-Type", "text/html");
promise_.set_value(std::move(R));
}
stop();
}
Expand Down Expand Up @@ -291,8 +292,9 @@ void HttpQueryBlockView::finish_query() {
A << HttpAnswer::RawData<block::gen::Block>{root};
return A.finish();
}();
promise_.set_value(
MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY));
auto R = MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY);
MHD_add_response_header(R, "Content-Type", "text/html");
promise_.set_value(std::move(R));
}
stop();
}
Expand Down Expand Up @@ -488,8 +490,9 @@ void HttpQueryBlockInfo::finish_query() {

return A.finish();
}();
promise_.set_value(
MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY));
auto R = MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY);
MHD_add_response_header(R, "Content-Type", "text/html");
promise_.set_value(std::move(R));
}
stop();
}
Expand Down Expand Up @@ -709,8 +712,9 @@ void HttpQueryBlockSearch::finish_query() {

return A.finish();
}();
promise_.set_value(
MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY));
auto R = MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY);
MHD_add_response_header(R, "Content-Type", "text/html");
promise_.set_value(std::move(R));
}
stop();
}
Expand Down Expand Up @@ -795,8 +799,9 @@ void HttpQueryViewAccount::finish_query() {
A << HttpAnswer::AccountCell{addr_, res_block_id_, root, Q_roots};
return A.finish();
}();
promise_.set_value(
MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY));
auto R = MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY);
MHD_add_response_header(R, "Content-Type", "text/html");
promise_.set_value(std::move(R));
}
stop();
}
Expand Down Expand Up @@ -893,8 +898,9 @@ void HttpQueryViewTransaction::finish_query() {
}
return A.finish();
}();
promise_.set_value(
MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY));
auto R = MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY);
MHD_add_response_header(R, "Content-Type", "text/html");
promise_.set_value(std::move(R));
}
stop();
}
Expand Down Expand Up @@ -974,8 +980,9 @@ void HttpQueryViewTransaction2::finish_query() {
A << HttpAnswer::TransactionCell{addr_, block_id_, list};
return A.finish();
}();
promise_.set_value(
MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY));
auto R = MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY);
MHD_add_response_header(R, "Content-Type", "text/html");
promise_.set_value(std::move(R));
}
stop();
}
Expand Down Expand Up @@ -1178,8 +1185,9 @@ void HttpQueryConfig::finish_query() {
}
return A.finish();
}();
promise_.set_value(
MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY));
auto R = MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY);
MHD_add_response_header(R, "Content-Type", "text/html");
promise_.set_value(std::move(R));
}
stop();
}
Expand Down Expand Up @@ -1209,8 +1217,9 @@ void HttpQuerySendForm::finish_query() {
<< "</div></form></div>";
return A.finish();
}();
promise_.set_value(
MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY));
auto R = MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY);
MHD_add_response_header(R, "Content-Type", "text/html");
promise_.set_value(std::move(R));
}
stop();
}
Expand Down Expand Up @@ -1270,8 +1279,9 @@ void HttpQuerySend::finish_query() {
}
return A.finish();
}();
promise_.set_value(
MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY));
auto R = MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY);
MHD_add_response_header(R, "Content-Type", "text/html");
promise_.set_value(std::move(R));
}
stop();
}
Expand Down Expand Up @@ -1434,8 +1444,9 @@ void HttpQueryRunMethod::finish_query() {

return A.finish();
}();
promise_.set_value(
MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY));
auto R = MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY);
MHD_add_response_header(R, "Content-Type", "text/html");
promise_.set_value(std::move(R));
}
stop();
}
Expand Down Expand Up @@ -1511,8 +1522,9 @@ void HttpQueryStatus::finish_query() {
A << "</table></div>";
return A.finish();
}();
promise_.set_value(
MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY));
auto R = MHD_create_response_from_buffer(page.length(), const_cast<char *>(page.c_str()), MHD_RESPMEM_MUST_COPY);
MHD_add_response_header(R, "Content-Type", "text/html");
promise_.set_value(std::move(R));
}
stop();
}
3 changes: 1 addition & 2 deletions blockchain-explorer/blockchain-explorer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from all source files in the program, then also delete it here.
along with TON Blockchain. If not, see <http://www.gnu.org/licenses/>.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#include "adnl/adnl-ext-client.h"
#include "adnl/utils.hpp"
Expand Down Expand Up @@ -52,7 +52,6 @@
#include "vm/boc.h"
#include "vm/cellops.h"
#include "vm/cells/MerkleProof.h"
#include "vm/continuation.h"
#include "vm/cp0.h"

#include "auto/tl/lite_api.h"
Expand Down
2 changes: 1 addition & 1 deletion blockchain-explorer/blockchain-explorer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
exception statement from your version. If you delete this exception statement
from all source files in the program, then also delete it here.
Copyright 2017-2019 Telegram Systems LLP
Copyright 2017-2020 Telegram Systems LLP
*/
#pragma once

Expand Down
Loading

0 comments on commit 77842f9

Please sign in to comment.