diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index ddf1781f2..ee1dd274a 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -351,12 +351,12 @@ jobs: run: | echo "building with 8 threads" export FALLBACK_DOWNLOAD_PATH=https://pool.nowput.org/depends/ - make -C depends -j8 HOST=x86_64-apple-darwin20.6.0 + make -C depends -j8 HOST=x86_64-apple-darwin21.6.0 - name: Configure run: | ./autogen.sh - ./configure --prefix=`pwd`/depends/x86_64-apple-darwin20.6.0 + ./configure --prefix=`pwd`/depends/x86_64-apple-darwin21.6.0 - name: Build Binaries run: | diff --git a/src/qt/assetsdialog.cpp b/src/qt/assetsdialog.cpp index c076d7d96..2c02bc543 100644 --- a/src/qt/assetsdialog.cpp +++ b/src/qt/assetsdialog.cpp @@ -346,7 +346,8 @@ void AssetsDialog::displayImage(const std::string& cid) { ui->referenceDisplay->setToolTip(QString::fromStdString(cid)); ui->referenceDisplay->setOpenExternalLinks(false); } else { - std::string displayUrl = "" + cid + ""; + std::string ipfsGatewayUrl = gArgs.GetArg("-ipfsgateway", DEFAULT_IPFS_GATEWAY_URL); + std::string displayUrl = "" + cid + ""; ui->referenceDisplay->setText(QString::fromStdString(displayUrl)); ui->referenceDisplay->setToolTip(""); ui->referenceDisplay->setOpenExternalLinks(true); diff --git a/src/qt/uploaddownload.cpp b/src/qt/uploaddownload.cpp index fa6030f06..154a8b0d0 100644 --- a/src/qt/uploaddownload.cpp +++ b/src/qt/uploaddownload.cpp @@ -1,6 +1,6 @@ -// -// Created by tri on 8/8/24. -// +// Copyright (c) 2024 The Raptoreum developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #include @@ -93,13 +93,14 @@ void graceful_disconnect(beast::ssl_stream& stream) { void download(const std::string cid, std::string& response_data) { std::string getTarget = GET_URI + cid; + std::string ipfsServiceHost = gArgs.GetArg("-ipfsservice", DEFAULT_IPFS_SERVICE_URL); try { net::io_context ioc; ssl::context ctx = setup_ssl_context(); - beast::ssl_stream stream = create_and_connect_ssl_stream(ioc, IPFS_SERVICE_HOST, "443", ctx); + beast::ssl_stream stream = create_and_connect_ssl_stream(ioc, ipfsServiceHost, "443", ctx); http::request req{http::verb::get, getTarget, 11}; - req.set(http::field::host, IPFS_SERVICE_HOST); + req.set(http::field::host, ipfsServiceHost); req.set(http::field::user_agent, BOOST_BEAST_VERSION_STRING); response_data = write_response(stream, req); @@ -114,7 +115,8 @@ void upload(const std::string& file_path, std::string& response_data) { try { net::io_context ioc; ssl::context ctx = setup_ssl_context(); - beast::ssl_stream stream = create_and_connect_ssl_stream(ioc, IPFS_SERVICE_HOST, "443", ctx); + std::string ipfsServiceHost = gArgs.GetArg("-ipfsservice", DEFAULT_IPFS_SERVICE_URL); + beast::ssl_stream stream = create_and_connect_ssl_stream(ioc, ipfsServiceHost, "443", ctx); // Generate a boundary for the multipart form data std::string boundary = generate_boundary(); @@ -138,7 +140,7 @@ void upload(const std::string& file_path, std::string& response_data) { std::string body_str = body.str(); http::request req{http::verb::post, UPLOAD_URI, 11}; - req.set(http::field::host, IPFS_SERVICE_HOST); + req.set(http::field::host, ipfsServiceHost); req.set(http::field::user_agent, BOOST_BEAST_VERSION_STRING); req.set(http::field::content_type, "multipart/form-data; boundary=" + boundary); req.set(http::field::content_length, std::to_string(body_str.size())); diff --git a/src/qt/uploaddownload.h b/src/qt/uploaddownload.h index 399043eef..656bdf0ab 100644 --- a/src/qt/uploaddownload.h +++ b/src/qt/uploaddownload.h @@ -1,6 +1,6 @@ -// -// Created by tri on 8/8/24. -// +// Copyright (c) 2024 The Raptoreum developers +// Distributed under the MIT software license, see the accompanying +// file COPYING or http://www.opensource.org/licenses/mit-license.php. #ifndef RAPTOREUM_UPLOAD_DOWNLOAD_H #define RAPTOREUM_UPLOAD_DOWNLOAD_H @@ -14,8 +14,8 @@ static std::string GET_URI = "/get/"; static std::string UPLOAD_URI = "/upload"; -static std::string IPFS_SERVICE_HOST = gArgs.GetArg("-ipfsservice", "ipfsm.raptoreum.com"); -static std::string IPFS_GATEWAY_URL = gArgs.GetArg("-ipfsgateway", "https://ipfsweb.raptoreum.com/ipfs/"); +static std::string DEFAULT_IPFS_SERVICE_URL = "ipfsm.raptoreum.com"; +static std::string DEFAULT_IPFS_GATEWAY_URL = "https://ipfsweb.raptoreum.com/ipfs/"; void download(const std::string cid, std::string& response_data); void upload(const std::string& file_path, std::string& response_data); diff --git a/src/rpc/rpcassets.cpp b/src/rpc/rpcassets.cpp index 9741096d4..2dc6eff22 100644 --- a/src/rpc/rpcassets.cpp +++ b/src/rpc/rpcassets.cpp @@ -48,7 +48,7 @@ static std::string GetDistributionType(int t) { } return "invalid"; } - +#ifdef ENABLE_WALLET UniValue createasset(const JSONRPCRequest &request) { if (request.fHelp || !Updates().IsAssetsActive(::ChainActive().Tip()) || request.params.size() < 1 || @@ -732,7 +732,7 @@ UniValue sendasset(const JSONRPCRequest &request) { result.pushKV("txid", wtx->GetHash().GetHex()); return result; } - +#endif//ENABLE_WALLET UniValue getassetdetailsbyname(const JSONRPCRequest &request) { if (request.fHelp || !Updates().IsAssetsActive(::ChainActive().Tip()) || request.params.size() < 1 || @@ -1287,14 +1287,18 @@ UniValue listassetbalancesbyaddress(const JSONRPCRequest& request) static const CRPCCommand commands[] = { // category name actor (function) // --------------------- ------------------------ ----------------------- +#ifdef ENABLE_WALLET {"assets", "createasset", &createasset, {"asset"}}, {"assets", "updateasset", &updateasset, {"asset"}}, {"assets", "mintasset", &mintasset, {"assetId"}}, {"assets", "sendasset", &sendasset, {"assetId", "amount", "address", "change_address", "asset_change_address"}}, +#endif //ENABLE_WALLET {"assets", "getassetdetailsbyname", &getassetdetailsbyname, {"assetname"}}, {"assets", "getassetdetailsbyid", &getassetdetailsbyid, {"assetid"}}, +#ifdef ENABLE_WALLET {"assets", "listassetsbalance", &listassetsbalance, {}}, {"assets", "listunspentassets", &listunspentassets, {"minconf", "maxconf", "addresses", "include_unsafe", "query_options"}}, +#endif //ENABLE_WALLET {"assets", "listassets", &listassets, {"verbose", "count", "start"}}, {"assets", "listaddressesbyasset", &listaddressesbyasset, {"asset_name", "onlytotal", "count", "start"}}, {"assets", "listassetbalancesbyaddress", &listassetbalancesbyaddress, {"address", "onlytotal", "count", "start"} }, @@ -1304,4 +1308,4 @@ void RegisterAssetsRPCCommands(CRPCTable &tableRPC) { for (unsigned int vcidx = 0; vcidx < ARRAYLEN(commands); vcidx++) { tableRPC.appendCommand(commands[vcidx].name, &commands[vcidx]); } -} \ No newline at end of file +} diff --git a/src/rpc/rpcevo.cpp b/src/rpc/rpcevo.cpp index 4a39dc268..6f613f648 100644 --- a/src/rpc/rpcevo.cpp +++ b/src/rpc/rpcevo.cpp @@ -1554,8 +1554,9 @@ UniValue protx(const JSONRPCRequest &request) { } else if(command == "protxquick_setup") { return protx_quick_setup(new_request); } -#endif - else if (command == "protxlist") { + else +#endif //ENABLE_WALLET + if (command == "protxlist") { return protx_list(new_request); } else if (command == "protxinfo") { return protx_info(new_request);