Compare commits
21 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3c4eeb49fd | |||
| 257781f2e2 | |||
| fb85deabbe | |||
| 6bc30dc6e1 | |||
| 93395771d3 | |||
| d6c249ca17 | |||
| 07259e029a | |||
| b1348b6c80 | |||
| a977f988d5 | |||
| 847ffe3959 | |||
| ed2e0f1a1b | |||
| 240cbd100e | |||
| f7c1baa453 | |||
| 644084a32f | |||
| baab8d3788 | |||
| ce1ef36613 | |||
| 3d08803709 | |||
| a4a0c03517 | |||
| fb21c917ac | |||
| 0d9670ee29 | |||
| ca47bed7b9 |
@@ -13,7 +13,7 @@ on:
|
||||
jobs:
|
||||
build-alpine-static:
|
||||
|
||||
timeout-minutes: 240
|
||||
timeout-minutes: 90
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
@@ -71,7 +71,7 @@ jobs:
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM="3.5" -DCMAKE_C_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DSTATIC_BINARY=ON -DARCH_ID=${{ matrix.config.arch }}
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_POLICY_VERSION_MINIMUM="3.5" -DCMAKE_C_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections' -DWITH_GRPC=OFF -DSTATIC_BINARY=ON -DARCH_ID=${{ matrix.config.arch }}
|
||||
make -j$(nproc) p2pool
|
||||
|
||||
- name: Run RandomX tests
|
||||
@@ -433,8 +433,8 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {c: "gcc", cxx: "g++", flags: "-ffunction-sections -Wno-error=maybe-uninitialized -Wno-error=attributes"}
|
||||
- {c: "clang", cxx: "clang++", flags: "-fuse-ld=lld -Wno-unused-command-line-argument -Wno-nan-infinity-disabled"}
|
||||
- {c: "gcc", cxx: "g++", flags: "-ffunction-sections -Wno-error=maybe-uninitialized -Wno-error=attributes -Wno-unknown-attributes"}
|
||||
- {c: "clang", cxx: "clang++", flags: "-fuse-ld=lld -Wno-unused-command-line-argument -Wno-nan-infinity-disabled -Wno-unknown-attributes"}
|
||||
|
||||
defaults:
|
||||
run:
|
||||
@@ -452,6 +452,10 @@ jobs:
|
||||
update: true
|
||||
install: mingw-w64-x86_64-toolchain mingw-w64-x86_64-clang mingw-w64-x86_64-lld mingw-w64-x86_64-cmake make git
|
||||
|
||||
- name: Apply patch
|
||||
run: |
|
||||
git apply --verbose --ignore-whitespace --directory=external/src/grpc/third_party/protobuf patches/protobuf/protobuf.patch
|
||||
|
||||
- name: Build libcurl
|
||||
run: |
|
||||
cd external/src/curl
|
||||
|
||||
@@ -12,16 +12,16 @@ on:
|
||||
|
||||
jobs:
|
||||
clang-tidy:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Install clang
|
||||
run: |
|
||||
wget https://apt.llvm.org/llvm.sh
|
||||
chmod +x llvm.sh
|
||||
sudo ./llvm.sh 21
|
||||
sudo apt-get install -y clang-tidy-21
|
||||
clang-tidy-21 --verify-config
|
||||
sudo ./llvm.sh 20
|
||||
sudo apt-get install -y clang-tidy-20
|
||||
clang-tidy-20 --verify-config
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -32,9 +32,9 @@ jobs:
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_C_COMPILER=clang-21 -DCMAKE_CXX_COMPILER=clang++-21 -DDEV_CLANG_TIDY=ON -DSTATIC_LIBS=ON -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_C_COMPILER=clang-20 -DCMAKE_CXX_COMPILER=clang++-20 -DDEV_CLANG_TIDY=ON -DSTATIC_LIBS=ON -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
|
||||
- name: Run clang-tidy
|
||||
run: |
|
||||
cd src
|
||||
clang-tidy-21 *.cpp -p ../build -checks=-clang-diagnostic-undefined-internal,-clang-analyzer-optin.performance.Padding,-clang-diagnostic-nan-infinity-disabled -warnings-as-errors=* -header-filter=^[^\.]
|
||||
clang-tidy-20 *.cpp -p ../build -checks=-clang-diagnostic-undefined-internal,-clang-analyzer-optin.performance.Padding,-clang-diagnostic-nan-infinity-disabled -warnings-as-errors=* -header-filter=^[^\.]
|
||||
|
||||
@@ -26,7 +26,7 @@ jobs:
|
||||
run: |
|
||||
wget https://apt.llvm.org/llvm.sh
|
||||
chmod +x llvm.sh
|
||||
sudo ./llvm.sh 21 all
|
||||
sudo ./llvm.sh 20 all
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
cd tests
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DDEV_DEBUG=ON -DWITH_COVERAGE=ON -DCMAKE_C_COMPILER=clang-21 -DCMAKE_CXX_COMPILER=clang++-21 -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
cmake .. -DCMAKE_BUILD_TYPE=Release -DDEV_DEBUG=ON -DWITH_COVERAGE=ON -DCMAKE_C_COMPILER=clang-20 -DCMAKE_CXX_COMPILER=clang++-20 -DCMAKE_POLICY_VERSION_MINIMUM="3.5"
|
||||
make -j$(nproc) p2pool_tests
|
||||
|
||||
- name: Run tests
|
||||
@@ -50,12 +50,12 @@ jobs:
|
||||
- name: Merge profile data
|
||||
run: |
|
||||
cd tests/build
|
||||
llvm-profdata-21 merge -sparse ./p2pool_tests.profraw -o ./p2pool_tests.profdata
|
||||
llvm-profdata-20 merge -sparse ./p2pool_tests.profraw -o ./p2pool_tests.profdata
|
||||
|
||||
- name: Export profile data
|
||||
run: |
|
||||
cd tests/build
|
||||
llvm-cov-21 export ./p2pool_tests -format=lcov -instr-profile=./p2pool_tests.profdata > coverage.info
|
||||
llvm-cov-20 export ./p2pool_tests -format=lcov -instr-profile=./p2pool_tests.profdata > coverage.info
|
||||
|
||||
- name: Run genhtml
|
||||
run: |
|
||||
|
||||
@@ -32,6 +32,7 @@ jobs:
|
||||
- name: Build cppcheck
|
||||
run: |
|
||||
cd cppcheck-main
|
||||
git checkout 1d9ea2ffcca587f99c68f0b6a4c37d5b3e046c28
|
||||
make -j$(nproc) cppcheck
|
||||
|
||||
- name: cmake p2pool
|
||||
@@ -62,7 +63,7 @@ jobs:
|
||||
|
||||
cppcheck-windows:
|
||||
|
||||
timeout-minutes: 60
|
||||
timeout-minutes: 120
|
||||
runs-on: windows-latest
|
||||
|
||||
steps:
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
FROM ubuntu:20.04
|
||||
FROM debian:12-slim
|
||||
|
||||
RUN set -e && \
|
||||
apt-get update -q -y --no-install-recommends && \
|
||||
@@ -25,7 +25,7 @@ RUN git submodule update --init --recursive && \
|
||||
|
||||
# ---
|
||||
|
||||
FROM ubuntu:20.04
|
||||
FROM debian:12-slim
|
||||
COPY --from=0 /usr/src/p2pool/build/p2pool /
|
||||
|
||||
RUN set -e && \
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
set(protobuf_INSTALL OFF CACHE BOOL "Install protobuf binaries and files")
|
||||
set(protobuf_BUILD_TESTS OFF CACHE BOOL "Build protobuf tests")
|
||||
set(protobuf_BUILD_PROTOC_BINARIES OFF CACHE BOOL "Build libprotoc and protoc compiler")
|
||||
set(protobuf_BUILD_LIBUPB OFF CACHE BOOL "Build libupb")
|
||||
set(protobuf_BUILD_SHARED_LIBS OFF CACHE BOOL "Build protobuf Shared Libraries")
|
||||
set(protobuf_DISABLE_RTTI ON CACHE BOOL "Remove runtime type information in the binaries")
|
||||
set(protobuf_WITH_ZLIB OFF CACHE BOOL "Build with zlib support")
|
||||
|
||||
set(utf8_range_ENABLE_TESTS OFF CACHE BOOL "Build test suite")
|
||||
set(utf8_range_ENABLE_INSTALL OFF CACHE BOOL "Configure installation")
|
||||
@@ -32,6 +34,9 @@ endif()
|
||||
|
||||
add_definitions(-DPROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII=0)
|
||||
|
||||
add_definitions(-DGRPC_NO_RLS)
|
||||
add_definitions(-DGRPC_NO_XDS)
|
||||
|
||||
add_subdirectory(external/src/grpc)
|
||||
|
||||
include_directories(external/src/grpc/third_party/abseil-cpp)
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Multistage docker build, requires docker 17.05
|
||||
|
||||
# builder stage
|
||||
FROM ubuntu:20.04 as builder
|
||||
FROM ubuntu:22.04 as builder
|
||||
ARG MONERO_GIT_TAG="latest"
|
||||
|
||||
RUN set -e && \
|
||||
@@ -32,7 +32,7 @@ RUN git clone --recursive https://github.com/monero-project/monero && \
|
||||
# ---
|
||||
|
||||
# runtime stage
|
||||
FROM ubuntu:20.04
|
||||
FROM ubuntu:22.04
|
||||
|
||||
COPY --from=0 /src/monero/build/*/release/bin /usr/local/bin/
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM ubuntu:20.04
|
||||
FROM ubuntu:22.04
|
||||
|
||||
RUN set -e && \
|
||||
apt-get update -q -y --no-install-recommends && \
|
||||
@@ -20,7 +20,7 @@ RUN git clone https://github.com/xmrig/xmrig.git && \
|
||||
|
||||
# ---
|
||||
|
||||
FROM ubuntu:20.04
|
||||
FROM ubuntu:22.04
|
||||
|
||||
COPY --from=0 /usr/src/xmrig/build/xmrig /
|
||||
|
||||
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
To update the files:
|
||||
|
||||
- Build gRPC in `../../../grpc/.build` folder: `cmake .. && make -j$(nproc)`
|
||||
- Run `../../../grpc/.build/third_party/protobuf/protoc --cpp_out=. --plugin=protoc-gen-grpc=../../../grpc/.build/grpc_cpp_plugin --grpc_out=. --proto_path=../../../grpc/third_party/protobuf/src --proto_path=. *.proto`
|
||||
+132
-18
@@ -19,6 +19,7 @@
|
||||
#include <grpcpp/server_context.h>
|
||||
#include <grpcpp/impl/service_type.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
|
||||
@@ -56,10 +57,13 @@ static const char* BaseNode_method_names[] = {
|
||||
"/tari.rpc.BaseNode/ListConnectedPeers",
|
||||
"/tari.rpc.BaseNode/GetMempoolStats",
|
||||
"/tari.rpc.BaseNode/GetActiveValidatorNodes",
|
||||
"/tari.rpc.BaseNode/GetValidatorNodeChanges",
|
||||
"/tari.rpc.BaseNode/GetShardKey",
|
||||
"/tari.rpc.BaseNode/GetTemplateRegistrations",
|
||||
"/tari.rpc.BaseNode/GetSideChainUtxos",
|
||||
"/tari.rpc.BaseNode/GetNetworkState",
|
||||
"/tari.rpc.BaseNode/SearchPaymentReferences",
|
||||
"/tari.rpc.BaseNode/SearchPaymentReferencesViaOutputHash",
|
||||
};
|
||||
|
||||
std::unique_ptr< BaseNode::Stub> BaseNode::NewStub(const std::shared_ptr< ::grpc::ChannelInterface>& channel, const ::grpc::StubOptions& options) {
|
||||
@@ -102,10 +106,13 @@ BaseNode::Stub::Stub(const std::shared_ptr< ::grpc::ChannelInterface>& channel,
|
||||
, rpcmethod_ListConnectedPeers_(BaseNode_method_names[30], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_GetMempoolStats_(BaseNode_method_names[31], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_GetActiveValidatorNodes_(BaseNode_method_names[32], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel)
|
||||
, rpcmethod_GetShardKey_(BaseNode_method_names[33], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_GetTemplateRegistrations_(BaseNode_method_names[34], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel)
|
||||
, rpcmethod_GetSideChainUtxos_(BaseNode_method_names[35], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel)
|
||||
, rpcmethod_GetNetworkState_(BaseNode_method_names[36], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_GetValidatorNodeChanges_(BaseNode_method_names[33], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_GetShardKey_(BaseNode_method_names[34], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_GetTemplateRegistrations_(BaseNode_method_names[35], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel)
|
||||
, rpcmethod_GetSideChainUtxos_(BaseNode_method_names[36], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel)
|
||||
, rpcmethod_GetNetworkState_(BaseNode_method_names[37], options.suffix_for_stats(),::grpc::internal::RpcMethod::NORMAL_RPC, channel)
|
||||
, rpcmethod_SearchPaymentReferences_(BaseNode_method_names[38], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel)
|
||||
, rpcmethod_SearchPaymentReferencesViaOutputHash_(BaseNode_method_names[39], options.suffix_for_stats(),::grpc::internal::RpcMethod::SERVER_STREAMING, channel)
|
||||
{}
|
||||
|
||||
::grpc::ClientReader< ::tari::rpc::BlockHeaderResponse>* BaseNode::Stub::ListHeadersRaw(::grpc::ClientContext* context, const ::tari::rpc::ListHeadersRequest& request) {
|
||||
@@ -255,23 +262,23 @@ void BaseNode::Stub::async::GetBlockFees(::grpc::ClientContext* context, const :
|
||||
return result;
|
||||
}
|
||||
|
||||
::grpc::Status BaseNode::Stub::GetVersion(::grpc::ClientContext* context, const ::tari::rpc::Empty& request, ::tari::rpc::StringValue* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall< ::tari::rpc::Empty, ::tari::rpc::StringValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetVersion_, context, request, response);
|
||||
::grpc::Status BaseNode::Stub::GetVersion(::grpc::ClientContext* context, const ::tari::rpc::Empty& request, ::tari::rpc::BaseNodeGetVersionResponse* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall< ::tari::rpc::Empty, ::tari::rpc::BaseNodeGetVersionResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetVersion_, context, request, response);
|
||||
}
|
||||
|
||||
void BaseNode::Stub::async::GetVersion(::grpc::ClientContext* context, const ::tari::rpc::Empty* request, ::tari::rpc::StringValue* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc::internal::CallbackUnaryCall< ::tari::rpc::Empty, ::tari::rpc::StringValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetVersion_, context, request, response, std::move(f));
|
||||
void BaseNode::Stub::async::GetVersion(::grpc::ClientContext* context, const ::tari::rpc::Empty* request, ::tari::rpc::BaseNodeGetVersionResponse* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc::internal::CallbackUnaryCall< ::tari::rpc::Empty, ::tari::rpc::BaseNodeGetVersionResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetVersion_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void BaseNode::Stub::async::GetVersion(::grpc::ClientContext* context, const ::tari::rpc::Empty* request, ::tari::rpc::StringValue* response, ::grpc::ClientUnaryReactor* reactor) {
|
||||
void BaseNode::Stub::async::GetVersion(::grpc::ClientContext* context, const ::tari::rpc::Empty* request, ::tari::rpc::BaseNodeGetVersionResponse* response, ::grpc::ClientUnaryReactor* reactor) {
|
||||
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetVersion_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::tari::rpc::StringValue>* BaseNode::Stub::PrepareAsyncGetVersionRaw(::grpc::ClientContext* context, const ::tari::rpc::Empty& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::tari::rpc::StringValue, ::tari::rpc::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_GetVersion_, context, request);
|
||||
::grpc::ClientAsyncResponseReader< ::tari::rpc::BaseNodeGetVersionResponse>* BaseNode::Stub::PrepareAsyncGetVersionRaw(::grpc::ClientContext* context, const ::tari::rpc::Empty& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::tari::rpc::BaseNodeGetVersionResponse, ::tari::rpc::Empty, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_GetVersion_, context, request);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::tari::rpc::StringValue>* BaseNode::Stub::AsyncGetVersionRaw(::grpc::ClientContext* context, const ::tari::rpc::Empty& request, ::grpc::CompletionQueue* cq) {
|
||||
::grpc::ClientAsyncResponseReader< ::tari::rpc::BaseNodeGetVersionResponse>* BaseNode::Stub::AsyncGetVersionRaw(::grpc::ClientContext* context, const ::tari::rpc::Empty& request, ::grpc::CompletionQueue* cq) {
|
||||
auto* result =
|
||||
this->PrepareAsyncGetVersionRaw(context, request, cq);
|
||||
result->StartCall();
|
||||
@@ -797,6 +804,29 @@ void BaseNode::Stub::async::GetActiveValidatorNodes(::grpc::ClientContext* conte
|
||||
return ::grpc::internal::ClientAsyncReaderFactory< ::tari::rpc::GetActiveValidatorNodesResponse>::Create(channel_.get(), cq, rpcmethod_GetActiveValidatorNodes_, context, request, false, nullptr);
|
||||
}
|
||||
|
||||
::grpc::Status BaseNode::Stub::GetValidatorNodeChanges(::grpc::ClientContext* context, const ::tari::rpc::GetValidatorNodeChangesRequest& request, ::tari::rpc::GetValidatorNodeChangesResponse* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall< ::tari::rpc::GetValidatorNodeChangesRequest, ::tari::rpc::GetValidatorNodeChangesResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetValidatorNodeChanges_, context, request, response);
|
||||
}
|
||||
|
||||
void BaseNode::Stub::async::GetValidatorNodeChanges(::grpc::ClientContext* context, const ::tari::rpc::GetValidatorNodeChangesRequest* request, ::tari::rpc::GetValidatorNodeChangesResponse* response, std::function<void(::grpc::Status)> f) {
|
||||
::grpc::internal::CallbackUnaryCall< ::tari::rpc::GetValidatorNodeChangesRequest, ::tari::rpc::GetValidatorNodeChangesResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetValidatorNodeChanges_, context, request, response, std::move(f));
|
||||
}
|
||||
|
||||
void BaseNode::Stub::async::GetValidatorNodeChanges(::grpc::ClientContext* context, const ::tari::rpc::GetValidatorNodeChangesRequest* request, ::tari::rpc::GetValidatorNodeChangesResponse* response, ::grpc::ClientUnaryReactor* reactor) {
|
||||
::grpc::internal::ClientCallbackUnaryFactory::Create< ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(stub_->channel_.get(), stub_->rpcmethod_GetValidatorNodeChanges_, context, request, response, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::tari::rpc::GetValidatorNodeChangesResponse>* BaseNode::Stub::PrepareAsyncGetValidatorNodeChangesRaw(::grpc::ClientContext* context, const ::tari::rpc::GetValidatorNodeChangesRequest& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncResponseReaderHelper::Create< ::tari::rpc::GetValidatorNodeChangesResponse, ::tari::rpc::GetValidatorNodeChangesRequest, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), cq, rpcmethod_GetValidatorNodeChanges_, context, request);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncResponseReader< ::tari::rpc::GetValidatorNodeChangesResponse>* BaseNode::Stub::AsyncGetValidatorNodeChangesRaw(::grpc::ClientContext* context, const ::tari::rpc::GetValidatorNodeChangesRequest& request, ::grpc::CompletionQueue* cq) {
|
||||
auto* result =
|
||||
this->PrepareAsyncGetValidatorNodeChangesRaw(context, request, cq);
|
||||
result->StartCall();
|
||||
return result;
|
||||
}
|
||||
|
||||
::grpc::Status BaseNode::Stub::GetShardKey(::grpc::ClientContext* context, const ::tari::rpc::GetShardKeyRequest& request, ::tari::rpc::GetShardKeyResponse* response) {
|
||||
return ::grpc::internal::BlockingUnaryCall< ::tari::rpc::GetShardKeyRequest, ::tari::rpc::GetShardKeyResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(channel_.get(), rpcmethod_GetShardKey_, context, request, response);
|
||||
}
|
||||
@@ -875,6 +905,38 @@ void BaseNode::Stub::async::GetNetworkState(::grpc::ClientContext* context, cons
|
||||
return result;
|
||||
}
|
||||
|
||||
::grpc::ClientReader< ::tari::rpc::PaymentReferenceResponse>* BaseNode::Stub::SearchPaymentReferencesRaw(::grpc::ClientContext* context, const ::tari::rpc::SearchPaymentReferencesRequest& request) {
|
||||
return ::grpc::internal::ClientReaderFactory< ::tari::rpc::PaymentReferenceResponse>::Create(channel_.get(), rpcmethod_SearchPaymentReferences_, context, request);
|
||||
}
|
||||
|
||||
void BaseNode::Stub::async::SearchPaymentReferences(::grpc::ClientContext* context, const ::tari::rpc::SearchPaymentReferencesRequest* request, ::grpc::ClientReadReactor< ::tari::rpc::PaymentReferenceResponse>* reactor) {
|
||||
::grpc::internal::ClientCallbackReaderFactory< ::tari::rpc::PaymentReferenceResponse>::Create(stub_->channel_.get(), stub_->rpcmethod_SearchPaymentReferences_, context, request, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncReader< ::tari::rpc::PaymentReferenceResponse>* BaseNode::Stub::AsyncSearchPaymentReferencesRaw(::grpc::ClientContext* context, const ::tari::rpc::SearchPaymentReferencesRequest& request, ::grpc::CompletionQueue* cq, void* tag) {
|
||||
return ::grpc::internal::ClientAsyncReaderFactory< ::tari::rpc::PaymentReferenceResponse>::Create(channel_.get(), cq, rpcmethod_SearchPaymentReferences_, context, request, true, tag);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncReader< ::tari::rpc::PaymentReferenceResponse>* BaseNode::Stub::PrepareAsyncSearchPaymentReferencesRaw(::grpc::ClientContext* context, const ::tari::rpc::SearchPaymentReferencesRequest& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncReaderFactory< ::tari::rpc::PaymentReferenceResponse>::Create(channel_.get(), cq, rpcmethod_SearchPaymentReferences_, context, request, false, nullptr);
|
||||
}
|
||||
|
||||
::grpc::ClientReader< ::tari::rpc::PaymentReferenceResponse>* BaseNode::Stub::SearchPaymentReferencesViaOutputHashRaw(::grpc::ClientContext* context, const ::tari::rpc::FetchMatchingUtxosRequest& request) {
|
||||
return ::grpc::internal::ClientReaderFactory< ::tari::rpc::PaymentReferenceResponse>::Create(channel_.get(), rpcmethod_SearchPaymentReferencesViaOutputHash_, context, request);
|
||||
}
|
||||
|
||||
void BaseNode::Stub::async::SearchPaymentReferencesViaOutputHash(::grpc::ClientContext* context, const ::tari::rpc::FetchMatchingUtxosRequest* request, ::grpc::ClientReadReactor< ::tari::rpc::PaymentReferenceResponse>* reactor) {
|
||||
::grpc::internal::ClientCallbackReaderFactory< ::tari::rpc::PaymentReferenceResponse>::Create(stub_->channel_.get(), stub_->rpcmethod_SearchPaymentReferencesViaOutputHash_, context, request, reactor);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncReader< ::tari::rpc::PaymentReferenceResponse>* BaseNode::Stub::AsyncSearchPaymentReferencesViaOutputHashRaw(::grpc::ClientContext* context, const ::tari::rpc::FetchMatchingUtxosRequest& request, ::grpc::CompletionQueue* cq, void* tag) {
|
||||
return ::grpc::internal::ClientAsyncReaderFactory< ::tari::rpc::PaymentReferenceResponse>::Create(channel_.get(), cq, rpcmethod_SearchPaymentReferencesViaOutputHash_, context, request, true, tag);
|
||||
}
|
||||
|
||||
::grpc::ClientAsyncReader< ::tari::rpc::PaymentReferenceResponse>* BaseNode::Stub::PrepareAsyncSearchPaymentReferencesViaOutputHashRaw(::grpc::ClientContext* context, const ::tari::rpc::FetchMatchingUtxosRequest& request, ::grpc::CompletionQueue* cq) {
|
||||
return ::grpc::internal::ClientAsyncReaderFactory< ::tari::rpc::PaymentReferenceResponse>::Create(channel_.get(), cq, rpcmethod_SearchPaymentReferencesViaOutputHash_, context, request, false, nullptr);
|
||||
}
|
||||
|
||||
BaseNode::Service::Service() {
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
BaseNode_method_names[0],
|
||||
@@ -949,11 +1011,11 @@ BaseNode::Service::Service() {
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
BaseNode_method_names[7],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< BaseNode::Service, ::tari::rpc::Empty, ::tari::rpc::StringValue, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
|
||||
new ::grpc::internal::RpcMethodHandler< BaseNode::Service, ::tari::rpc::Empty, ::tari::rpc::BaseNodeGetVersionResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
|
||||
[](BaseNode::Service* service,
|
||||
::grpc::ServerContext* ctx,
|
||||
const ::tari::rpc::Empty* req,
|
||||
::tari::rpc::StringValue* resp) {
|
||||
::tari::rpc::BaseNodeGetVersionResponse* resp) {
|
||||
return service->GetVersion(ctx, req, resp);
|
||||
}, this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
@@ -1209,6 +1271,16 @@ BaseNode::Service::Service() {
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
BaseNode_method_names[33],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< BaseNode::Service, ::tari::rpc::GetValidatorNodeChangesRequest, ::tari::rpc::GetValidatorNodeChangesResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
|
||||
[](BaseNode::Service* service,
|
||||
::grpc::ServerContext* ctx,
|
||||
const ::tari::rpc::GetValidatorNodeChangesRequest* req,
|
||||
::tari::rpc::GetValidatorNodeChangesResponse* resp) {
|
||||
return service->GetValidatorNodeChanges(ctx, req, resp);
|
||||
}, this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
BaseNode_method_names[34],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< BaseNode::Service, ::tari::rpc::GetShardKeyRequest, ::tari::rpc::GetShardKeyResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
|
||||
[](BaseNode::Service* service,
|
||||
::grpc::ServerContext* ctx,
|
||||
@@ -1217,7 +1289,7 @@ BaseNode::Service::Service() {
|
||||
return service->GetShardKey(ctx, req, resp);
|
||||
}, this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
BaseNode_method_names[34],
|
||||
BaseNode_method_names[35],
|
||||
::grpc::internal::RpcMethod::SERVER_STREAMING,
|
||||
new ::grpc::internal::ServerStreamingHandler< BaseNode::Service, ::tari::rpc::GetTemplateRegistrationsRequest, ::tari::rpc::GetTemplateRegistrationResponse>(
|
||||
[](BaseNode::Service* service,
|
||||
@@ -1227,7 +1299,7 @@ BaseNode::Service::Service() {
|
||||
return service->GetTemplateRegistrations(ctx, req, writer);
|
||||
}, this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
BaseNode_method_names[35],
|
||||
BaseNode_method_names[36],
|
||||
::grpc::internal::RpcMethod::SERVER_STREAMING,
|
||||
new ::grpc::internal::ServerStreamingHandler< BaseNode::Service, ::tari::rpc::GetSideChainUtxosRequest, ::tari::rpc::GetSideChainUtxosResponse>(
|
||||
[](BaseNode::Service* service,
|
||||
@@ -1237,7 +1309,7 @@ BaseNode::Service::Service() {
|
||||
return service->GetSideChainUtxos(ctx, req, writer);
|
||||
}, this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
BaseNode_method_names[36],
|
||||
BaseNode_method_names[37],
|
||||
::grpc::internal::RpcMethod::NORMAL_RPC,
|
||||
new ::grpc::internal::RpcMethodHandler< BaseNode::Service, ::tari::rpc::GetNetworkStateRequest, ::tari::rpc::GetNetworkStateResponse, ::grpc::protobuf::MessageLite, ::grpc::protobuf::MessageLite>(
|
||||
[](BaseNode::Service* service,
|
||||
@@ -1246,6 +1318,26 @@ BaseNode::Service::Service() {
|
||||
::tari::rpc::GetNetworkStateResponse* resp) {
|
||||
return service->GetNetworkState(ctx, req, resp);
|
||||
}, this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
BaseNode_method_names[38],
|
||||
::grpc::internal::RpcMethod::SERVER_STREAMING,
|
||||
new ::grpc::internal::ServerStreamingHandler< BaseNode::Service, ::tari::rpc::SearchPaymentReferencesRequest, ::tari::rpc::PaymentReferenceResponse>(
|
||||
[](BaseNode::Service* service,
|
||||
::grpc::ServerContext* ctx,
|
||||
const ::tari::rpc::SearchPaymentReferencesRequest* req,
|
||||
::grpc::ServerWriter<::tari::rpc::PaymentReferenceResponse>* writer) {
|
||||
return service->SearchPaymentReferences(ctx, req, writer);
|
||||
}, this)));
|
||||
AddMethod(new ::grpc::internal::RpcServiceMethod(
|
||||
BaseNode_method_names[39],
|
||||
::grpc::internal::RpcMethod::SERVER_STREAMING,
|
||||
new ::grpc::internal::ServerStreamingHandler< BaseNode::Service, ::tari::rpc::FetchMatchingUtxosRequest, ::tari::rpc::PaymentReferenceResponse>(
|
||||
[](BaseNode::Service* service,
|
||||
::grpc::ServerContext* ctx,
|
||||
const ::tari::rpc::FetchMatchingUtxosRequest* req,
|
||||
::grpc::ServerWriter<::tari::rpc::PaymentReferenceResponse>* writer) {
|
||||
return service->SearchPaymentReferencesViaOutputHash(ctx, req, writer);
|
||||
}, this)));
|
||||
}
|
||||
|
||||
BaseNode::Service::~Service() {
|
||||
@@ -1300,7 +1392,7 @@ BaseNode::Service::~Service() {
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status BaseNode::Service::GetVersion(::grpc::ServerContext* context, const ::tari::rpc::Empty* request, ::tari::rpc::StringValue* response) {
|
||||
::grpc::Status BaseNode::Service::GetVersion(::grpc::ServerContext* context, const ::tari::rpc::Empty* request, ::tari::rpc::BaseNodeGetVersionResponse* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
@@ -1482,6 +1574,13 @@ BaseNode::Service::~Service() {
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status BaseNode::Service::GetValidatorNodeChanges(::grpc::ServerContext* context, const ::tari::rpc::GetValidatorNodeChangesRequest* request, ::tari::rpc::GetValidatorNodeChangesResponse* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) response;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status BaseNode::Service::GetShardKey(::grpc::ServerContext* context, const ::tari::rpc::GetShardKeyRequest* request, ::tari::rpc::GetShardKeyResponse* response) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
@@ -1510,7 +1609,22 @@ BaseNode::Service::~Service() {
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status BaseNode::Service::SearchPaymentReferences(::grpc::ServerContext* context, const ::tari::rpc::SearchPaymentReferencesRequest* request, ::grpc::ServerWriter< ::tari::rpc::PaymentReferenceResponse>* writer) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) writer;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
::grpc::Status BaseNode::Service::SearchPaymentReferencesViaOutputHash(::grpc::ServerContext* context, const ::tari::rpc::FetchMatchingUtxosRequest* request, ::grpc::ServerWriter< ::tari::rpc::PaymentReferenceResponse>* writer) {
|
||||
(void) context;
|
||||
(void) request;
|
||||
(void) writer;
|
||||
return ::grpc::Status(::grpc::StatusCode::UNIMPLEMENTED, "");
|
||||
}
|
||||
|
||||
|
||||
} // namespace tari
|
||||
} // namespace rpc
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
|
||||
|
||||
+550
-73
File diff suppressed because it is too large
Load Diff
+15680
-7427
File diff suppressed because it is too large
Load Diff
+12759
-6451
File diff suppressed because it is too large
Load Diff
+146
-23
@@ -46,7 +46,7 @@ service BaseNode {
|
||||
// Returns Block Fees
|
||||
rpc GetBlockFees (BlockGroupRequest) returns (BlockGroupResponse);
|
||||
// Get Version
|
||||
rpc GetVersion(Empty) returns (StringValue);
|
||||
rpc GetVersion(Empty) returns (BaseNodeGetVersionResponse);
|
||||
// Check for new updates
|
||||
rpc CheckForUpdates(Empty) returns (SoftwareUpdate);
|
||||
// Get coins in circulation
|
||||
@@ -95,11 +95,17 @@ service BaseNode {
|
||||
rpc GetMempoolStats(Empty) returns (MempoolStatsResponse);
|
||||
// Get VNs
|
||||
rpc GetActiveValidatorNodes(GetActiveValidatorNodesRequest) returns (stream GetActiveValidatorNodesResponse);
|
||||
rpc GetValidatorNodeChanges(GetValidatorNodeChangesRequest) returns (GetValidatorNodeChangesResponse);
|
||||
rpc GetShardKey(GetShardKeyRequest) returns (GetShardKeyResponse);
|
||||
// Get templates
|
||||
rpc GetTemplateRegistrations(GetTemplateRegistrationsRequest) returns (stream GetTemplateRegistrationResponse);
|
||||
rpc GetSideChainUtxos(GetSideChainUtxosRequest) returns (stream GetSideChainUtxosResponse);
|
||||
rpc GetNetworkState(GetNetworkStateRequest) returns (GetNetworkStateResponse);
|
||||
// PayRef (Payment Reference) lookup for block explorers and external services
|
||||
rpc SearchPaymentReferences(SearchPaymentReferencesRequest) returns (stream PaymentReferenceResponse);
|
||||
// PayRef (Payment Reference) lookup for block explorers and external services via output hash
|
||||
rpc SearchPaymentReferencesViaOutputHash(FetchMatchingUtxosRequest) returns (stream PaymentReferenceResponse);
|
||||
|
||||
}
|
||||
|
||||
message GetAssetMetadataRequest {
|
||||
@@ -174,6 +180,42 @@ enum BaseNodeState{
|
||||
SYNC_FAILED = 6;
|
||||
}
|
||||
|
||||
message ReadinessStatus {
|
||||
enum State {
|
||||
NOT_READY = 0;
|
||||
STARTING_UP = 1;
|
||||
|
||||
// Database phase (10-19)
|
||||
DATABASE_INITIALIZING = 10;
|
||||
|
||||
// Recovery phase (20-29)
|
||||
RECOVERING_PREPARING = 20;
|
||||
RECOVERING_REBUILDING = 21;
|
||||
RECOVERING_REBUILDING_DATABASE = 22;
|
||||
|
||||
// Context building phase (30-39)
|
||||
BUILDING_CONTEXT_BLOCKCHAIN = 32;
|
||||
BUILDING_CONTEXT_BOOTSTRAP = 34;
|
||||
|
||||
READY = 100;
|
||||
}
|
||||
|
||||
oneof status {
|
||||
State state = 1;
|
||||
MigrationProgress migration = 2;
|
||||
}
|
||||
uint64 timestamp = 6;
|
||||
|
||||
}
|
||||
|
||||
message MigrationProgress {
|
||||
uint64 current_block = 1;
|
||||
uint64 total_blocks = 2;
|
||||
double progress_percentage = 3;
|
||||
uint64 current_db_version = 4;
|
||||
uint64 target_db_version = 5;
|
||||
}
|
||||
|
||||
/// return type of GetNewBlockTemplate
|
||||
message NewBlockTemplateResponse {
|
||||
NewBlockTemplate new_block_template = 1;
|
||||
@@ -226,9 +268,24 @@ message NetworkDifficultyResponse {
|
||||
|
||||
// A generic single value response for a specific height
|
||||
message ValueAtHeightResponse {
|
||||
// This is the total circulating token supply up to date ('mined_rewards + spendable_pre_mine').
|
||||
uint64 circulating_supply = 1;
|
||||
uint64 spendable_supply = 2;
|
||||
// uint64 spendable_supply = 2; // No longer used
|
||||
// This is the block height the values are valid for.
|
||||
uint64 height = 3;
|
||||
// This is the total mined rewards up to date, including time locked coinbase rewards that is not spendable.
|
||||
uint64 mined_rewards = 4;
|
||||
// This is the total spendable minded rewards up to date, which excludes all coinbase rewards that is
|
||||
// still time locked.
|
||||
uint64 spendable_rewards = 5;
|
||||
// This is the total spendable pre-mine tokens released up to date, i.e. not time-locked anymore.
|
||||
uint64 spendable_pre_mine = 6;
|
||||
// This is the total spendable token supply up to date ('spendable_rewards + spendable_pre_mine').
|
||||
uint64 total_spendable = 7;
|
||||
// This is the total pre-mine tokens in the genesis block, time-locked and not time-locked.
|
||||
uint64 total_pre_mine = 8;
|
||||
// This is the total pre-mine tokens that are still time-locked up to date (`total_pre_mine - spendable_pre_mine`).
|
||||
uint64 time_locked_pre_mine = 9;
|
||||
}
|
||||
|
||||
// A generic uint value
|
||||
@@ -236,9 +293,9 @@ message IntegerValue {
|
||||
uint64 value = 1;
|
||||
}
|
||||
|
||||
// A generic String value
|
||||
message StringValue {
|
||||
string value = 1;
|
||||
message BaseNodeGetVersionResponse {
|
||||
string version = 1;
|
||||
uint32 network = 2;
|
||||
}
|
||||
|
||||
/// GetBlockSize / GetBlockFees Request
|
||||
@@ -481,48 +538,76 @@ message MempoolStatsResponse {
|
||||
}
|
||||
|
||||
message GetActiveValidatorNodesRequest {
|
||||
uint64 height = 1;
|
||||
uint64 height = 1;
|
||||
bytes sidechain_id = 2;
|
||||
}
|
||||
|
||||
message GetActiveValidatorNodesResponse {
|
||||
bytes shard_key = 1;
|
||||
bytes public_key = 2;
|
||||
bytes shard_key = 1;
|
||||
bytes public_key = 2;
|
||||
bytes sidechain_id = 3;
|
||||
}
|
||||
|
||||
message GetValidatorNodeChangesRequest {
|
||||
uint64 epoch = 1;
|
||||
bytes sidechain_id = 2;
|
||||
}
|
||||
|
||||
message ValidatorNodeChange {
|
||||
oneof change {
|
||||
ValidatorNodeChangeAdd add = 1;
|
||||
ValidatorNodeChangeRemove remove = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message ValidatorNodeChangeAdd {
|
||||
uint64 activation_epoch = 1;
|
||||
ValidatorNodeRegistration registration = 2;
|
||||
uint64 minimum_value_promise = 3;
|
||||
bytes shard_key = 4;
|
||||
}
|
||||
|
||||
message ValidatorNodeChangeRemove {
|
||||
bytes public_key = 1;
|
||||
}
|
||||
|
||||
message GetValidatorNodeChangesResponse {
|
||||
repeated ValidatorNodeChange changes = 1;
|
||||
}
|
||||
|
||||
message GetShardKeyRequest {
|
||||
uint64 height = 1;
|
||||
bytes public_key = 2;
|
||||
uint64 epoch = 1;
|
||||
bytes public_key = 2;
|
||||
}
|
||||
|
||||
message GetShardKeyResponse {
|
||||
bytes shard_key = 1;
|
||||
bool found = 2;
|
||||
bytes shard_key = 1;
|
||||
}
|
||||
|
||||
message GetTemplateRegistrationsRequest {
|
||||
bytes start_hash = 1;
|
||||
uint64 count = 2;
|
||||
bytes start_hash = 1;
|
||||
uint64 count = 2;
|
||||
}
|
||||
|
||||
message GetTemplateRegistrationResponse {
|
||||
bytes utxo_hash = 1;
|
||||
TemplateRegistration registration = 2;
|
||||
bytes utxo_hash = 1;
|
||||
TemplateRegistration registration = 2;
|
||||
}
|
||||
|
||||
message BlockInfo {
|
||||
uint64 height = 1;
|
||||
bytes hash = 2;
|
||||
bytes next_block_hash = 3;
|
||||
uint64 height = 1;
|
||||
bytes hash = 2;
|
||||
bytes next_block_hash = 3;
|
||||
}
|
||||
|
||||
message GetSideChainUtxosRequest {
|
||||
bytes start_hash = 1;
|
||||
uint64 count = 2;
|
||||
bytes start_hash = 1;
|
||||
uint64 count = 2;
|
||||
}
|
||||
|
||||
message GetSideChainUtxosResponse {
|
||||
BlockInfo block_info = 1;
|
||||
repeated TransactionOutput outputs = 2;
|
||||
BlockInfo block_info = 1;
|
||||
repeated TransactionOutput outputs = 2;
|
||||
}
|
||||
|
||||
message GetNetworkStateRequest {
|
||||
@@ -548,6 +633,8 @@ message GetNetworkStateResponse {
|
||||
uint64 num_connections = 8;
|
||||
//liveness results
|
||||
repeated LivenessResult liveness_results = 9;
|
||||
// readiness status
|
||||
ReadinessStatus readiness_status = 11;
|
||||
}
|
||||
|
||||
message LivenessResult{
|
||||
@@ -559,3 +646,39 @@ message LivenessResult{
|
||||
uint64 ping_latency = 3;
|
||||
}
|
||||
|
||||
// PayRef (Payment Reference) search and lookup messages
|
||||
|
||||
// Request to search for outputs by payment reference
|
||||
message SearchPaymentReferencesRequest {
|
||||
// Payment reference as hex string (64 characters)
|
||||
repeated string payment_reference_hex = 1;
|
||||
repeated bytes payment_reference_bytes = 2;
|
||||
// Optional: include spent outputs in results
|
||||
bool include_spent = 3;
|
||||
}
|
||||
|
||||
// Response containing payment reference match
|
||||
message PaymentReferenceResponse {
|
||||
// The payment reference that was found
|
||||
string payment_reference_hex = 1;
|
||||
// Block height where the output was mined
|
||||
uint64 block_height = 2;
|
||||
// Block hash where the output was mined
|
||||
bytes block_hash = 3;
|
||||
// Timestamp when the output was mined
|
||||
uint64 mined_timestamp = 4;
|
||||
// Output commitment (32 bytes)
|
||||
bytes commitment = 5;
|
||||
// Whether this output has been spent
|
||||
bool is_spent = 6;
|
||||
// Height where output was spent - will be 0 for unspent outputs as it is not applicable
|
||||
uint64 spent_height = 7;
|
||||
// Block hash where output was spent - will be empty for unspent outputs
|
||||
bytes spent_block_hash = 8;
|
||||
// Minimum value promise
|
||||
uint64 min_value_promise = 9;
|
||||
// Timestamp when the output was spent - will be 0 for unspent outputs as it is not applicable
|
||||
uint64 spent_timestamp = 10;
|
||||
// Output hash of the output
|
||||
bytes output_hash = 11;
|
||||
}
|
||||
|
||||
@@ -19,9 +19,11 @@
|
||||
#include <grpcpp/server_context.h>
|
||||
#include <grpcpp/impl/service_type.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
|
||||
} // namespace tari
|
||||
} // namespace rpc
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <grpcpp/support/status.h>
|
||||
#include <grpcpp/support/stub_options.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
@@ -54,4 +55,5 @@ namespace rpc {
|
||||
} // namespace tari
|
||||
|
||||
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
#endif // GRPC_block_2eproto__INCLUDED
|
||||
|
||||
+1794
-1247
File diff suppressed because it is too large
Load Diff
+1499
-1095
File diff suppressed because it is too large
Load Diff
@@ -19,9 +19,11 @@
|
||||
#include <grpcpp/server_context.h>
|
||||
#include <grpcpp/impl/service_type.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
|
||||
} // namespace tari
|
||||
} // namespace rpc
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <grpcpp/support/status.h>
|
||||
#include <grpcpp/support/stub_options.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
@@ -54,4 +55,5 @@ namespace rpc {
|
||||
} // namespace tari
|
||||
|
||||
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
#endif // GRPC_network_2eproto__INCLUDED
|
||||
|
||||
+1964
-1162
File diff suppressed because it is too large
Load Diff
+1564
-1202
File diff suppressed because it is too large
Load Diff
@@ -19,9 +19,11 @@
|
||||
#include <grpcpp/server_context.h>
|
||||
#include <grpcpp/impl/service_type.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
|
||||
} // namespace tari
|
||||
} // namespace rpc
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <grpcpp/support/status.h>
|
||||
#include <grpcpp/support/stub_options.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
@@ -54,4 +55,5 @@ namespace rpc {
|
||||
} // namespace tari
|
||||
|
||||
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
#endif // GRPC_sidechain_5ftypes_2eproto__INCLUDED
|
||||
|
||||
+7067
-1003
File diff suppressed because it is too large
Load Diff
+7693
-1196
File diff suppressed because it is too large
Load Diff
+119
-24
@@ -26,43 +26,59 @@ package tari.rpc;
|
||||
import "types.proto";
|
||||
|
||||
message SideChainFeature {
|
||||
oneof side_chain_feature {
|
||||
ValidatorNodeRegistration validator_node_registration = 1;
|
||||
TemplateRegistration template_registration = 2;
|
||||
ConfidentialOutputData confidential_output = 3;
|
||||
}
|
||||
oneof feature {
|
||||
ValidatorNodeRegistration validator_node_registration = 1;
|
||||
TemplateRegistration template_registration = 2;
|
||||
ConfidentialOutputData confidential_output = 3;
|
||||
EvictionProof eviction_proof = 4;
|
||||
ValidatorNodeExit validator_node_exit = 5;
|
||||
}
|
||||
SideChainId sidechain_id = 6;
|
||||
}
|
||||
|
||||
message SideChainId {
|
||||
bytes public_key = 1;
|
||||
Signature knowledge_proof = 2;
|
||||
}
|
||||
|
||||
message ValidatorNodeRegistration {
|
||||
bytes public_key = 1;
|
||||
Signature signature = 2;
|
||||
bytes public_key = 1;
|
||||
Signature signature = 2;
|
||||
bytes claim_public_key = 3;
|
||||
uint64 max_epoch = 4;
|
||||
}
|
||||
|
||||
message ValidatorNodeExit {
|
||||
bytes public_key = 1;
|
||||
Signature signature = 2;
|
||||
uint64 max_epoch = 3;
|
||||
}
|
||||
|
||||
message TemplateRegistration {
|
||||
bytes author_public_key = 1;
|
||||
Signature author_signature = 2;
|
||||
string template_name = 3;
|
||||
uint32 template_version = 4;
|
||||
TemplateType template_type = 5;
|
||||
BuildInfo build_info = 6;
|
||||
bytes binary_sha = 7;
|
||||
string binary_url = 8;
|
||||
bytes author_public_key = 1;
|
||||
Signature author_signature = 2;
|
||||
string template_name = 3;
|
||||
uint32 template_version = 4;
|
||||
TemplateType template_type = 5;
|
||||
BuildInfo build_info = 6;
|
||||
bytes binary_sha = 7;
|
||||
string binary_url = 8;
|
||||
}
|
||||
|
||||
message ConfidentialOutputData {
|
||||
bytes claim_public_key = 1;
|
||||
bytes claim_public_key = 1;
|
||||
}
|
||||
|
||||
message TemplateType {
|
||||
oneof template_type {
|
||||
WasmInfo wasm = 1;
|
||||
FlowInfo flow = 2;
|
||||
ManifestInfo manifest = 3;
|
||||
}
|
||||
oneof template_type {
|
||||
WasmInfo wasm = 1;
|
||||
FlowInfo flow = 2;
|
||||
ManifestInfo manifest = 3;
|
||||
}
|
||||
}
|
||||
|
||||
message WasmInfo {
|
||||
uint32 abi_version = 1;
|
||||
uint32 abi_version = 1;
|
||||
}
|
||||
|
||||
message FlowInfo {
|
||||
@@ -72,6 +88,85 @@ message ManifestInfo {
|
||||
}
|
||||
|
||||
message BuildInfo {
|
||||
string repo_url = 1;
|
||||
bytes commit_hash = 2;
|
||||
string repo_url = 1;
|
||||
bytes commit_hash = 2;
|
||||
}
|
||||
|
||||
|
||||
message EvictionProof {
|
||||
CommitProof proof = 1;
|
||||
}
|
||||
|
||||
message CommitProof {
|
||||
oneof version {
|
||||
CommitProofV1 v1 = 1;
|
||||
}
|
||||
}
|
||||
|
||||
message CommitProofV1 {
|
||||
bytes command = 1;
|
||||
SidechainBlockCommitProof commit_proof = 2;
|
||||
bytes encoded_inclusion_proof = 3;
|
||||
}
|
||||
|
||||
message SidechainBlockCommitProof {
|
||||
SidechainBlockHeader header = 1;
|
||||
repeated CommitProofElement proof_elements = 2;
|
||||
}
|
||||
|
||||
message CommitProofElement {
|
||||
oneof proof_element {
|
||||
QuorumCertificate quorum_certificate = 1;
|
||||
DummyChain dummy_chain = 2;
|
||||
}
|
||||
}
|
||||
|
||||
message DummyChain {
|
||||
repeated ChainLink chain_links = 1;
|
||||
}
|
||||
|
||||
message ChainLink {
|
||||
bytes header_hash = 1;
|
||||
bytes parent_id = 2;
|
||||
}
|
||||
|
||||
message SidechainBlockHeader {
|
||||
uint32 network = 1;
|
||||
bytes parent_id = 2;
|
||||
bytes justify_id = 3;
|
||||
uint64 height = 4;
|
||||
uint64 epoch = 5;
|
||||
ShardGroup shard_group = 6;
|
||||
bytes proposed_by = 7;
|
||||
bytes state_merkle_root = 8;
|
||||
bytes command_merkle_root = 9;
|
||||
Signature signature = 11;
|
||||
bytes metadata_hash = 10;
|
||||
}
|
||||
|
||||
message ShardGroup {
|
||||
uint32 start = 1;
|
||||
uint32 end_inclusive = 2;
|
||||
}
|
||||
|
||||
message EvictAtom {
|
||||
bytes public_key = 1;
|
||||
}
|
||||
|
||||
message QuorumCertificate {
|
||||
bytes header_hash = 1;
|
||||
bytes parent_id = 2;
|
||||
repeated ValidatorSignature signatures = 3;
|
||||
QuorumDecision decision = 4;
|
||||
}
|
||||
|
||||
enum QuorumDecision {
|
||||
Accept = 0;
|
||||
Reject = 1;
|
||||
}
|
||||
|
||||
message ValidatorSignature {
|
||||
bytes public_key = 1;
|
||||
Signature signature = 2;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,9 +19,11 @@
|
||||
#include <grpcpp/server_context.h>
|
||||
#include <grpcpp/impl/service_type.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
|
||||
} // namespace tari
|
||||
} // namespace rpc
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <grpcpp/support/status.h>
|
||||
#include <grpcpp/support/stub_options.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
@@ -54,4 +55,5 @@ namespace rpc {
|
||||
} // namespace tari
|
||||
|
||||
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
#endif // GRPC_transaction_2eproto__INCLUDED
|
||||
|
||||
+2481
-1690
File diff suppressed because it is too large
Load Diff
+2526
-1824
File diff suppressed because it is too large
Load Diff
@@ -115,6 +115,10 @@ message TransactionOutput {
|
||||
bytes encrypted_data = 10;
|
||||
// The minimum value of the commitment that is proven by the range proof (in MicroMinotari)
|
||||
uint64 minimum_value_promise = 11;
|
||||
// Payment reference (PayRef) - 32-byte Blake2b hash of (block_hash || output_hash)
|
||||
// This provides a unique, deterministic reference for the output that can be used
|
||||
// for payment verification without revealing wallet ownership
|
||||
bytes payment_reference = 12;
|
||||
}
|
||||
|
||||
// Options for UTXOs
|
||||
|
||||
@@ -19,9 +19,11 @@
|
||||
#include <grpcpp/server_context.h>
|
||||
#include <grpcpp/impl/service_type.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
|
||||
} // namespace tari
|
||||
} // namespace rpc
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
#include <grpcpp/support/status.h>
|
||||
#include <grpcpp/support/stub_options.h>
|
||||
#include <grpcpp/support/sync_stream.h>
|
||||
#include <grpcpp/ports_def.inc>
|
||||
|
||||
namespace tari {
|
||||
namespace rpc {
|
||||
@@ -54,4 +55,5 @@ namespace rpc {
|
||||
} // namespace tari
|
||||
|
||||
|
||||
#include <grpcpp/ports_undef.inc>
|
||||
#endif // GRPC_types_2eproto__INCLUDED
|
||||
|
||||
+3218
-2066
File diff suppressed because it is too large
Load Diff
+2066
-1459
File diff suppressed because it is too large
Load Diff
+2
-1
@@ -126,7 +126,6 @@ message ConsensusConstants {
|
||||
uint64 block_weight_kernels = 16;
|
||||
uint64 pre_mine_value = 17;
|
||||
uint64 max_script_byte_size = 18;
|
||||
uint64 validator_node_validity_period = 19;
|
||||
uint64 effective_from_height = 20;
|
||||
Range valid_blockchain_version_range = 21;
|
||||
uint64 max_randomx_seed_height = 22;
|
||||
@@ -144,4 +143,6 @@ message ConsensusConstants {
|
||||
uint64 inflation_bips = 35;
|
||||
uint64 tail_epoch_length = 36;
|
||||
uint64 max_block_coinbase_count = 37;
|
||||
uint32 vn_registration_max_vns_initial_epoch = 38;
|
||||
uint32 vn_registration_max_vns_per_epoch = 39;
|
||||
}
|
||||
|
||||
@@ -9,4 +9,6 @@
|
||||
#define ASAN_UNPOISON_MEMORY_REGION(addr, size) __asan_unpoison_memory_region((addr), (size))
|
||||
#endif
|
||||
|
||||
#define __asan_address_is_poisoned(addr) false
|
||||
|
||||
#endif // P2POOL_EXTERNAL_SRC_COMMON_SANITIZER_ASAN_INTERFACE_H
|
||||
|
||||
Vendored
+1
-1
Submodule external/src/grpc updated: 58c4289a67...2b06027b57
@@ -1,16 +1,16 @@
|
||||
diff --git a/src/crypto/rand_extra/windows.c b/src/crypto/rand_extra/windows.c
|
||||
index a44774d23..09cf10942 100644
|
||||
--- a/src/crypto/rand_extra/windows.c
|
||||
+++ b/src/crypto/rand_extra/windows.c
|
||||
@@ -26,6 +26,7 @@
|
||||
OPENSSL_MSVC_PRAGMA(warning(push, 3))
|
||||
diff --git a/src/crypto/rand/windows.cc b/src/crypto/rand/windows.cc
|
||||
index 59df467e7..aa5ac076c 100644
|
||||
--- a/src/crypto/rand/windows.cc
|
||||
+++ b/src/crypto/rand/windows.cc
|
||||
@@ -24,6 +24,7 @@
|
||||
#include <stdlib.h>
|
||||
|
||||
#include <windows.h>
|
||||
+#include <wincrypt.h>
|
||||
|
||||
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) && \
|
||||
!WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
|
||||
@@ -61,16 +62,40 @@ void CRYPTO_sysrand(uint8_t *out, size_t requested) {
|
||||
@@ -57,16 +58,40 @@ void CRYPTO_sysrand(uint8_t *out, size_t requested) {
|
||||
// See: https://learn.microsoft.com/en-us/windows/win32/seccng/processprng
|
||||
typedef BOOL (WINAPI *ProcessPrngFunction)(PBYTE pbData, SIZE_T cbData);
|
||||
static ProcessPrngFunction g_processprng_fn = NULL;
|
||||
@@ -25,21 +25,22 @@ index a44774d23..09cf10942 100644
|
||||
HMODULE hmod = LoadLibraryW(L"bcryptprimitives");
|
||||
- if (hmod == NULL) {
|
||||
- abort();
|
||||
- }
|
||||
- g_processprng_fn = (ProcessPrngFunction)GetProcAddress(hmod, "ProcessPrng");
|
||||
- if (g_processprng_fn == NULL) {
|
||||
- abort();
|
||||
+
|
||||
+ if (hmod) {
|
||||
+ g_processprng_fn = (ProcessPrngFunction)GetProcAddress(hmod, "ProcessPrng");
|
||||
+ if (g_processprng_fn) {
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
- g_processprng_fn = (ProcessPrngFunction)GetProcAddress(hmod, "ProcessPrng");
|
||||
- if (g_processprng_fn == NULL) {
|
||||
- abort();
|
||||
+ }
|
||||
+
|
||||
+ if (CryptAcquireContext(&g_hCryptProv, NULL, NULL, PROV_RSA_FULL, 0)) {
|
||||
+ g_processprng_fn = &wrapper_CryptGenRandom;
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
+
|
||||
+ DWORD err = GetLastError();
|
||||
+ if (err == NTE_BAD_KEYSET) {
|
||||
@@ -50,7 +51,7 @@ index a44774d23..09cf10942 100644
|
||||
+ else {
|
||||
+ err = GetLastError();
|
||||
+ }
|
||||
}
|
||||
+ }
|
||||
+
|
||||
+ abort();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
diff --git a/src/google/protobuf/generated_message_tctable_lite.cc b/src/google/protobuf/generated_message_tctable_lite.cc
|
||||
index 5758c1602..e425d6715 100644
|
||||
--- a/src/google/protobuf/generated_message_tctable_lite.cc
|
||||
+++ b/src/google/protobuf/generated_message_tctable_lite.cc
|
||||
@@ -406,7 +406,7 @@ PROTOBUF_ALWAYS_INLINE const char* TcParser::MiniParse(PROTOBUF_TC_PARAM_DECL) {
|
||||
if (entry == nullptr) {
|
||||
if (export_called_function) *test_out = {table->fallback, tag};
|
||||
data.data = tag;
|
||||
- PROTOBUF_MUSTTAIL return table->fallback(PROTOBUF_TC_PARAM_PASS);
|
||||
+ return table->fallback(PROTOBUF_TC_PARAM_PASS);
|
||||
}
|
||||
|
||||
// The handler may need the tag and the entry to resolve fallback logic. Both
|
||||
@@ -468,7 +468,7 @@ PROTOBUF_ALWAYS_INLINE const char* TcParser::MiniParse(PROTOBUF_TC_PARAM_DECL) {
|
||||
TailCallParseFunc parse_fn = kMiniParseTable[field_type];
|
||||
if (export_called_function) *test_out = {parse_fn, tag, entry};
|
||||
|
||||
- PROTOBUF_MUSTTAIL return parse_fn(PROTOBUF_TC_PARAM_PASS);
|
||||
+ return parse_fn(PROTOBUF_TC_PARAM_PASS);
|
||||
}
|
||||
|
||||
PROTOBUF_NOINLINE const char* TcParser::MiniParse(
|
||||
diff --git a/src/google/protobuf/port_def.inc b/src/google/protobuf/port_def.inc
|
||||
index edd6d5122..da894d384 100644
|
||||
--- a/src/google/protobuf/port_def.inc
|
||||
+++ b/src/google/protobuf/port_def.inc
|
||||
@@ -506,7 +506,7 @@ static_assert(PROTOBUF_ABSL_MIN(20230125, 3),
|
||||
#error PROTOBUF_ATTRIBUTE_WEAK was previously defined
|
||||
#endif
|
||||
#if ABSL_HAVE_ATTRIBUTE(weak) && !defined(__APPLE__) && \
|
||||
- (!defined(_WIN32) || __clang_major__ < 9) && !defined(__MINGW32__)
|
||||
+ (!defined(_WIN32) || (defined(__clang_major__) && (__clang_major__ < 9))) && !defined(__MINGW32__)
|
||||
#define PROTOBUF_ATTRIBUTE_WEAK __attribute__((weak))
|
||||
#define PROTOBUF_HAVE_ATTRIBUTE_WEAK 1
|
||||
#else
|
||||
@@ -7,7 +7,7 @@ cd "$(dirname "$0")"
|
||||
docker build --build-arg P2POOL_VERSION=$1 --build-arg CLANG_VERSION=$2 -t p2pool_compiler_test_clang_$1_$2 .
|
||||
|
||||
docker create --name p2pool_compiler_test_clang_$1_$2_container p2pool_compiler_test_clang_$1_$2:latest
|
||||
docker cp p2pool_compiler_test_clang_$1_$2_container:/p2pool/logs.tar.gz clang_$2_logs.tar.gz
|
||||
docker cp p2pool_compiler_test_clang_$1_$2_container:/p2pool/output.log clang_$2_output.log
|
||||
docker rm p2pool_compiler_test_clang_$1_$2_container
|
||||
|
||||
docker image rm -f p2pool_compiler_test_clang_$1_$2
|
||||
|
||||
@@ -8,5 +8,3 @@ git submodule update --recursive --jobs $(nproc)
|
||||
export COMPILER="-DCMAKE_C_COMPILER=clang-$2 -DCMAKE_CXX_COMPILER=clang++-$2"
|
||||
|
||||
./test2.sh
|
||||
|
||||
tar -czvf /p2pool/logs.tar.gz /p2pool/output.log
|
||||
|
||||
@@ -7,7 +7,7 @@ cd "$(dirname "$0")"
|
||||
docker build --build-arg P2POOL_VERSION=$1 --build-arg GCC_VERSION=$2 -t p2pool_compiler_test_gcc_$1_$2 .
|
||||
|
||||
docker create --name p2pool_compiler_test_gcc_$1_$2_container p2pool_compiler_test_gcc_$1_$2:latest
|
||||
docker cp p2pool_compiler_test_gcc_$1_$2_container:/p2pool/logs.tar.gz gcc_$2_logs.tar.gz
|
||||
docker cp p2pool_compiler_test_gcc_$1_$2_container:/p2pool/output.log gcc_$2_output.log
|
||||
docker rm p2pool_compiler_test_gcc_$1_$2_container
|
||||
|
||||
docker image rm -f p2pool_compiler_test_gcc_$1_$2
|
||||
|
||||
@@ -8,5 +8,3 @@ git submodule update --recursive --jobs $(nproc)
|
||||
export COMPILER="-DCMAKE_C_COMPILER=/usr/local/gcc-$2/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/gcc-$2/bin/g++ -DCMAKE_AR=/usr/local/gcc-$2/bin/gcc-ar -DCMAKE_RANLIB=/usr/local/gcc-$2/bin/gcc-ranlib"
|
||||
|
||||
./test2.sh
|
||||
|
||||
tar -czvf /p2pool/logs.tar.gz /p2pool/output.log
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Example usage: release_scripts/build_all.sh v4.8.1
|
||||
# Example usage: release_scripts/build_all.sh v4.9
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
@@ -11,12 +11,16 @@ if [ $? -ne 0 ]; then
|
||||
images/ubuntu/build.sh
|
||||
fi
|
||||
|
||||
gnome-terminal --tab -- freebsd_aarch64/build.sh $1
|
||||
gnome-terminal --tab -- freebsd_x64/build.sh $1
|
||||
gnome-terminal --tab -- linux_aarch64/build.sh $1
|
||||
gnome-terminal --tab -- linux_riscv64/build.sh $1
|
||||
gnome-terminal --tab -- linux_x64/build.sh $1
|
||||
gnome-terminal --tab -- windows_x64/build.sh $1
|
||||
gnome-terminal --tab -- macos_aarch64/build.sh $1
|
||||
gnome-terminal --tab -- macos_x64/build.sh $1
|
||||
gnome-terminal --tab -- source/build.sh $1
|
||||
N=$(($(nproc)-1))
|
||||
N1=$(($N/2))
|
||||
N2=$(($N1+1))
|
||||
|
||||
gnome-terminal --tab -- freebsd_aarch64/build.sh $1 0-$N1
|
||||
gnome-terminal --tab -- freebsd_x64/build.sh $1 $N2-$N
|
||||
gnome-terminal --tab -- linux_aarch64/build.sh $1 0-$N1
|
||||
gnome-terminal --tab -- linux_riscv64/build.sh $1 $N2-$N
|
||||
gnome-terminal --tab -- linux_x64/build.sh $1 0-$N1
|
||||
gnome-terminal --tab -- windows_x64/build.sh $1 $N2-$N
|
||||
gnome-terminal --tab -- macos_aarch64/build.sh $1 0-$N1
|
||||
gnome-terminal --tab -- macos_x64/build.sh $1 $N2-$N
|
||||
gnome-terminal --tab -- source/build.sh $1 0-$N1
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Example usage: ./build.sh v4.8.1
|
||||
# Example usage: ./build.sh v4.9
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_freebsd_aarch64_build_$1 .
|
||||
if [ "$2" ]; then
|
||||
cpu_set="--cpuset-cpus $2"
|
||||
else
|
||||
cpu_set=""
|
||||
fi
|
||||
|
||||
docker build $cpu_set --build-arg P2POOL_VERSION=$1 -t p2pool_freebsd_aarch64_build_$1 .
|
||||
|
||||
docker create --name p2pool_freebsd_aarch64_build_$1_container p2pool_freebsd_aarch64_build_$1:latest
|
||||
docker cp p2pool_freebsd_aarch64_build_$1_container:/p2pool/build/p2pool-$1-freebsd-aarch64.tar.gz ../p2pool-$1-freebsd-aarch64.tar.gz
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Example usage: ./build.sh v4.8.1
|
||||
# Example usage: ./build.sh v4.9
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_freebsd_x64_build_$1 .
|
||||
if [ "$2" ]; then
|
||||
cpu_set="--cpuset-cpus $2"
|
||||
else
|
||||
cpu_set=""
|
||||
fi
|
||||
|
||||
docker build $cpu_set --build-arg P2POOL_VERSION=$1 -t p2pool_freebsd_x64_build_$1 .
|
||||
|
||||
docker create --name p2pool_freebsd_x64_build_$1_container p2pool_freebsd_x64_build_$1:latest
|
||||
docker cp p2pool_freebsd_x64_build_$1_container:/p2pool/build/p2pool-$1-freebsd-x64.tar.gz ../p2pool-$1-freebsd-x64.tar.gz
|
||||
|
||||
@@ -15,6 +15,7 @@ MACOSX_SDK_VERSION=15.5
|
||||
MAKE_VERSION=4.4.1
|
||||
MINGW_VERSION=13.0.0
|
||||
XZ_VERSION=5.8.1
|
||||
TAR_VERSION=1.35
|
||||
|
||||
_7ZIP_SHA256="914c7e20ad5ef8e4d3cf08620ff8894b28fe11b7eb99809d6930870fbe48a281"
|
||||
CMAKE_SHA256="585ae9e013107bc8e7c7c9ce872cbdcbdff569e675b07ef57aacfb88c886faac"
|
||||
@@ -24,6 +25,7 @@ GLIBC_SHA256="a5a26b22f545d6b7d7b3dd828e11e428f24f4fac43c934fb071b6a7d0828e901"
|
||||
HEADERS_SHA256="0eafd627b602f58d73917d00e4fc3196ba18cba67df6995a42aa74744d8efa16"
|
||||
MACOSX_SDK_SHA256="c15cf0f3f17d714d1aa5a642da8e118db53d79429eb015771ba816aa7c6c1cbd"
|
||||
MAKE_SHA256="dd16fb1d67bfab79a72f5e8390735c49e3e8e70b4945a15ab1f81ddb78658fb3"
|
||||
TAR_SHA256="4d62ff37342ec7aed748535323930c7cf94acf71c3591882b26a7ea50f3edc16"
|
||||
|
||||
echo "Install prerequisites"
|
||||
|
||||
@@ -427,6 +429,27 @@ make -j$(nproc)
|
||||
cp -f lzma* /usr/bin
|
||||
cp -f xz* /usr/bin
|
||||
|
||||
echo "Install tar"
|
||||
|
||||
cd /root
|
||||
|
||||
TAR_FILE=tar-$TAR_VERSION.tar.xz
|
||||
|
||||
curl -L -O https://ftpmirror.gnu.org/tar/$TAR_FILE
|
||||
|
||||
TAR_FILE_SHA256="$(sha256sum $TAR_FILE | awk '{ print $1 }')"
|
||||
|
||||
if [ $TAR_FILE_SHA256 != $TAR_SHA256 ]; then
|
||||
echo "Error: SHA256 sum does not match for $TAR_FILE - expected $TAR_SHA256, got $TAR_FILE_SHA256"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
tar xvf $TAR_FILE
|
||||
cd tar-$TAR_VERSION
|
||||
FORCE_UNSAFE_CONFIGURE=1 ./configure
|
||||
make -j$(nproc)
|
||||
make install
|
||||
|
||||
echo "Deleting system glibc files to force our glibc"
|
||||
|
||||
rm /usr/lib/x86_64-linux-gnu/crt1.o
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Example usage: ./build.sh v4.8.1
|
||||
# Example usage: ./build.sh v4.9
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_ubuntu_aarch64_build_$1 .
|
||||
if [ "$2" ]; then
|
||||
cpu_set="--cpuset-cpus $2"
|
||||
else
|
||||
cpu_set=""
|
||||
fi
|
||||
|
||||
docker build $cpu_set --build-arg P2POOL_VERSION=$1 -t p2pool_ubuntu_aarch64_build_$1 .
|
||||
|
||||
docker create --name p2pool_ubuntu_aarch64_build_$1_container p2pool_ubuntu_aarch64_build_$1:latest
|
||||
docker cp p2pool_ubuntu_aarch64_build_$1_container:/p2pool/build/p2pool-$1-linux-aarch64.tar.gz ../p2pool-$1-linux-aarch64.tar.gz
|
||||
|
||||
@@ -3,7 +3,7 @@ set -e
|
||||
|
||||
cd /p2pool
|
||||
git fetch --jobs=$(nproc)
|
||||
git checkout $3
|
||||
git checkout $2
|
||||
git submodule update --recursive --jobs $(nproc)
|
||||
|
||||
export TZ=UTC0
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Example usage: ./build.sh v4.8.1
|
||||
# Example usage: ./build.sh v4.9
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_ubuntu_riscv64_build_$1 .
|
||||
if [ "$2" ]; then
|
||||
cpu_set="--cpuset-cpus $2"
|
||||
else
|
||||
cpu_set=""
|
||||
fi
|
||||
|
||||
docker build $cpu_set --build-arg P2POOL_VERSION=$1 -t p2pool_ubuntu_riscv64_build_$1 .
|
||||
|
||||
docker create --name p2pool_ubuntu_riscv64_build_$1_container p2pool_ubuntu_riscv64_build_$1:latest
|
||||
docker cp p2pool_ubuntu_riscv64_build_$1_container:/p2pool/build/p2pool-$1-linux-riscv64.tar.gz ../p2pool-$1-linux-riscv64.tar.gz
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Example usage: ./build.sh v4.8.1
|
||||
# Example usage: ./build.sh v4.9
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_linux_x64_build_$1 .
|
||||
if [ "$2" ]; then
|
||||
cpu_set="--cpuset-cpus $2"
|
||||
else
|
||||
cpu_set=""
|
||||
fi
|
||||
|
||||
docker build $cpu_set --build-arg P2POOL_VERSION=$1 -t p2pool_linux_x64_build_$1 .
|
||||
|
||||
docker create --name p2pool_linux_x64_build_$1_container p2pool_linux_x64_build_$1:latest
|
||||
docker cp p2pool_linux_x64_build_$1_container:/p2pool/build/p2pool-$1-linux-x64.tar.gz ../p2pool-$1-linux-x64.tar.gz
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM p2pool_build_ubuntu
|
||||
ARG P2POOL_VERSION
|
||||
ADD p2pool_macos_aarch64.sh zutil.patch /p2pool/
|
||||
ADD p2pool_macos_aarch64.sh /p2pool/
|
||||
RUN /p2pool/p2pool_macos_aarch64.sh p2pool-${P2POOL_VERSION}-macos-aarch64 ${P2POOL_VERSION}
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Example usage: ./build.sh v4.8.1
|
||||
# Example usage: ./build.sh v4.9
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_macos_aarch64_build_$1 .
|
||||
if [ "$2" ]; then
|
||||
cpu_set="--cpuset-cpus $2"
|
||||
else
|
||||
cpu_set=""
|
||||
fi
|
||||
|
||||
docker build $cpu_set --build-arg P2POOL_VERSION=$1 -t p2pool_macos_aarch64_build_$1 .
|
||||
|
||||
docker create --name p2pool_macos_aarch64_build_$1_container p2pool_macos_aarch64_build_$1:latest
|
||||
docker cp p2pool_macos_aarch64_build_$1_container:/p2pool/build/p2pool-$1-macos-aarch64.tar.gz ../p2pool-$1-macos-aarch64.tar.gz
|
||||
|
||||
@@ -19,8 +19,6 @@ flags_datetime="-D__DATE__=\"\\\"$CURRENT_DATE\\\"\" -D__TIME__=\"\\\"$CURRENT_T
|
||||
flags_libs="-Os -flto -w $flags_size $flags_datetime"
|
||||
flags_p2pool="$flags_size $flags_datetime"
|
||||
|
||||
patch -u /p2pool/external/src/grpc/third_party/zlib/zutil.h -i /p2pool/zutil.patch
|
||||
|
||||
cd /p2pool/external/src/curl
|
||||
cmake . -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=../../../cmake/macos_aarch64_toolchain_clang.cmake -DCMAKE_C_FLAGS="$flags_libs" -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON -DCURL_ENABLE_EXPORT_TARGET=OFF -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_BINDLOCAL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_DISABLE_WEBSOCKETS=ON -DHTTP_ONLY=ON -DCURL_ENABLE_SSL=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DENABLE_UNIX_SOCKETS=OFF -DBUILD_TESTING=OFF -DUSE_NGHTTP2=OFF -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_AWS=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_KERBEROS_AUTH=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j$(nproc)
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
--- zutil.h
|
||||
+++ zutil.h
|
||||
@@ -144,7 +144,6 @@
|
||||
# include <unix.h> /* for fdopen */
|
||||
# else
|
||||
# ifndef fdopen
|
||||
-# define fdopen(fd,mode) NULL /* No fdopen() */
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM p2pool_build_ubuntu
|
||||
ARG P2POOL_VERSION
|
||||
ADD p2pool_macos_x64.sh zutil.patch /p2pool/
|
||||
ADD p2pool_macos_x64.sh /p2pool/
|
||||
RUN /p2pool/p2pool_macos_x64.sh p2pool-${P2POOL_VERSION}-macos-x64 ${P2POOL_VERSION}
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Example usage: ./build.sh v4.8.1
|
||||
# Example usage: ./build.sh v4.9
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_macos_x64_build_$1 .
|
||||
if [ "$2" ]; then
|
||||
cpu_set="--cpuset-cpus $2"
|
||||
else
|
||||
cpu_set=""
|
||||
fi
|
||||
|
||||
docker build $cpu_set --build-arg P2POOL_VERSION=$1 -t p2pool_macos_x64_build_$1 .
|
||||
|
||||
docker create --name p2pool_macos_x64_build_$1_container p2pool_macos_x64_build_$1:latest
|
||||
docker cp p2pool_macos_x64_build_$1_container:/p2pool/build/p2pool-$1-macos-x64.tar.gz ../p2pool-$1-macos-x64.tar.gz
|
||||
|
||||
@@ -19,8 +19,6 @@ flags_datetime="-D__DATE__=\"\\\"$CURRENT_DATE\\\"\" -D__TIME__=\"\\\"$CURRENT_T
|
||||
flags_libs="-Os -flto -w $flags_size $flags_datetime"
|
||||
flags_p2pool="$flags_size $flags_datetime"
|
||||
|
||||
patch -u /p2pool/external/src/grpc/third_party/zlib/zutil.h -i /p2pool/zutil.patch
|
||||
|
||||
cd /p2pool/external/src/curl
|
||||
cmake . -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_TOOLCHAIN_FILE=../../../cmake/macos_x86_64_toolchain_clang.cmake -DCMAKE_C_FLAGS="$flags_libs" -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON -DCURL_ENABLE_EXPORT_TARGET=OFF -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_BINDLOCAL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_ZLIB=OFF -DCURL_BROTLI=OFF -DCURL_ZSTD=OFF -DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DCURL_DISABLE_WEBSOCKETS=ON -DHTTP_ONLY=ON -DCURL_ENABLE_SSL=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DENABLE_UNIX_SOCKETS=OFF -DBUILD_TESTING=OFF -DUSE_NGHTTP2=OFF -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DCURL_DISABLE_AWS=ON -DCURL_DISABLE_BASIC_AUTH=ON -DCURL_DISABLE_BEARER_AUTH=ON -DCURL_DISABLE_KERBEROS_AUTH=ON -DCURL_DISABLE_NEGOTIATE_AUTH=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j$(nproc)
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
--- zutil.h
|
||||
+++ zutil.h
|
||||
@@ -144,7 +144,6 @@
|
||||
# include <unix.h> /* for fdopen */
|
||||
# else
|
||||
# ifndef fdopen
|
||||
-# define fdopen(fd,mode) NULL /* No fdopen() */
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
@@ -1,10 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Example usage: ./build.sh v4.8.1
|
||||
# Example usage: ./build.sh v4.9
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_source_build_$1 .
|
||||
if [ "$2" ]; then
|
||||
cpu_set="--cpuset-cpus $2"
|
||||
else
|
||||
cpu_set=""
|
||||
fi
|
||||
|
||||
docker build $cpu_set --build-arg P2POOL_VERSION=$1 -t p2pool_source_build_$1 .
|
||||
|
||||
docker create --name p2pool_source_build_$1_container p2pool_source_build_$1:latest
|
||||
docker cp p2pool_source_build_$1_container:/p2pool_source-$1.tar.xz ../p2pool_source-$1.tar.xz
|
||||
|
||||
@@ -1,10 +1,16 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Example usage: ./build.sh v4.8.1
|
||||
# Example usage: ./build.sh v4.9
|
||||
|
||||
cd "$(dirname "$0")"
|
||||
|
||||
docker build --build-arg P2POOL_VERSION=$1 -t p2pool_windows_x64_build_$1 .
|
||||
if [ "$2" ]; then
|
||||
cpu_set="--cpuset-cpus $2"
|
||||
else
|
||||
cpu_set=""
|
||||
fi
|
||||
|
||||
docker build $cpu_set --build-arg P2POOL_VERSION=$1 -t p2pool_windows_x64_build_$1 .
|
||||
|
||||
docker create --name p2pool_windows_x64_build_$1_container p2pool_windows_x64_build_$1:latest
|
||||
docker cp p2pool_windows_x64_build_$1_container:/p2pool/build/p2pool-$1-windows-x64.zip ../p2pool-$1-windows-x64.zip
|
||||
|
||||
@@ -18,7 +18,7 @@ flags_datetime="-D__DATE__=\"\\\"$CURRENT_DATE\\\"\" -D__TIME__=\"\\\"$CURRENT_T
|
||||
|
||||
flags_libs="--target=x86_64-pc-windows-gnu -Os -flto -Wl,/timestamp:$BUILD_TIMESTAMP -fuse-ld=lld -w $flags_size $flags_datetime"
|
||||
|
||||
flags_p2pool="--target=x86_64-pc-windows-gnu -Wl,/timestamp:$BUILD_TIMESTAMP -fuse-ld=lld -femulated-tls -Wno-unused-command-line-argument $flags_size $flags_datetime"
|
||||
flags_p2pool="--target=x86_64-pc-windows-gnu -Wl,/timestamp:$BUILD_TIMESTAMP -fuse-ld=lld -femulated-tls -Wno-unused-command-line-argument -Wno-unknown-attributes $flags_size $flags_datetime"
|
||||
flags_cxx_headers="-isystem /usr/local/x86_64-w64-mingw32/include/c++ -isystem /usr/local/x86_64-w64-mingw32/include/c++/15.1.0 -isystem /usr/local/x86_64-w64-mingw32/include"
|
||||
|
||||
cd /p2pool
|
||||
|
||||
@@ -25,7 +25,7 @@ LOG_CATEGORY(JSONRPCRequest)
|
||||
namespace p2pool {
|
||||
namespace JSONRPCRequest {
|
||||
|
||||
struct CurlContext
|
||||
struct CurlContext : public nocopy_nomove
|
||||
{
|
||||
CurlContext(const std::string& address, int port, const std::string& req, const std::string& auth, const std::string& proxy, bool ssl, const std::string& ssl_fingerprint, CallbackBase* cb, CallbackBase* close_cb, uv_loop_t* loop);
|
||||
~CurlContext();
|
||||
|
||||
+44
-13
@@ -38,6 +38,7 @@
|
||||
#endif // WITH_GRPC
|
||||
|
||||
#include <filesystem>
|
||||
#include <fstream>
|
||||
|
||||
#ifdef WITH_RANDOMX
|
||||
#include "randomx.h"
|
||||
@@ -220,6 +221,9 @@ int main(int argc, char* argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool is_mini = false;
|
||||
bool is_nano = false;
|
||||
|
||||
for (int i = 1; i < argc; ++i) {
|
||||
if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "/help") || !strcmp(argv[i], "-h") || !strcmp(argv[i], "/h")) {
|
||||
p2pool_usage();
|
||||
@@ -237,25 +241,52 @@ int main(int argc, char* argv[])
|
||||
|
||||
if ((strcmp(argv[i], "--data-dir") == 0) && (i + 1 < argc)) {
|
||||
std::string path = argv[++i];
|
||||
|
||||
if (!path.empty() && (path.back() != '/')
|
||||
#ifdef _WIN32
|
||||
&& (path.back() != '\\')
|
||||
#endif
|
||||
) {
|
||||
path.append(1, '/');
|
||||
}
|
||||
|
||||
p2pool::DATA_DIR = std::move(path);
|
||||
p2pool::fixup_path(p2pool::DATA_DIR);
|
||||
}
|
||||
|
||||
// Try to create it if it doesn't exist
|
||||
if (!p2pool::DATA_DIR.empty()) {
|
||||
std::error_code err;
|
||||
std::filesystem::create_directories(p2pool::DATA_DIR, err);
|
||||
if (!strcmp(argv[i], "--mini")) is_mini = true;
|
||||
if (!strcmp(argv[i], "--nano")) is_nano = true;
|
||||
}
|
||||
|
||||
// If the data directory is not set, check if P2Pool has write access to the current directory
|
||||
// If it doesn't, switch to user's home directory
|
||||
if (p2pool::DATA_DIR.empty()) {
|
||||
std::ofstream f("p2pool.tmp");
|
||||
if (f && f.put(' ')) {
|
||||
f.close();
|
||||
std::remove("p2pool.tmp");
|
||||
}
|
||||
else {
|
||||
char buf[1024];
|
||||
size_t size = sizeof(buf);
|
||||
|
||||
if (uv_os_homedir(buf, &size) == 0) {
|
||||
p2pool::DATA_DIR.assign(buf, size);
|
||||
p2pool::fixup_path(p2pool::DATA_DIR);
|
||||
|
||||
p2pool::DATA_DIR += ".p2pool/";
|
||||
|
||||
if (is_mini) {
|
||||
p2pool::DATA_DIR += "mini/";
|
||||
}
|
||||
else if (is_nano) {
|
||||
p2pool::DATA_DIR += "nano/";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!p2pool::DATA_DIR.empty()) {
|
||||
printf("Using \"%s\" for P2Pool files\n", p2pool::DATA_DIR.c_str());
|
||||
}
|
||||
|
||||
// Try to create it if it doesn't exist
|
||||
if (!p2pool::DATA_DIR.empty()) {
|
||||
std::error_code err;
|
||||
std::filesystem::create_directories(p2pool::DATA_DIR, err);
|
||||
}
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER) && !defined(NDEBUG)
|
||||
SymInitialize(GetCurrentProcess(), NULL, TRUE);
|
||||
#endif
|
||||
|
||||
@@ -287,6 +287,9 @@ void MergeMiningClientTari::on_external_block(const PoolBlock& block)
|
||||
chain_params.aux_diff = diff;
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_previousAuxHashesFoundIndex = std::numeric_limits<uint32_t>::max();
|
||||
}
|
||||
|
||||
if (!diff.check_pow(block.m_powHash)) {
|
||||
LOGINFO(4, "External aux job solution found, but it doesn't have enough PoW (block diff = " << block.m_difficulty << ", Tari diff = " << diff << ')');
|
||||
@@ -867,6 +870,10 @@ bool MergeMiningClientTari::TariServer::connect_upstream(TariClient* downstream)
|
||||
|
||||
upstream->m_pairedClient = downstream;
|
||||
upstream->m_pairedClientSavedResetCounter = downstream->m_resetCounter;
|
||||
upstream->m_connectionPending = true;
|
||||
|
||||
downstream->m_pairedClient = upstream;
|
||||
downstream->m_pairedClientSavedResetCounter = upstream->m_resetCounter;
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -882,6 +889,7 @@ const char* MergeMiningClientTari::TariServer::get_log_category() const
|
||||
|
||||
MergeMiningClientTari::TariClient::TariClient()
|
||||
: Client(m_buf, sizeof(m_buf))
|
||||
, m_connectionPending(false)
|
||||
, m_pairedClient(nullptr)
|
||||
, m_pairedClientSavedResetCounter(std::numeric_limits<uint32_t>::max())
|
||||
{
|
||||
@@ -889,12 +897,23 @@ MergeMiningClientTari::TariClient::TariClient()
|
||||
}
|
||||
|
||||
void MergeMiningClientTari::TariClient::reset()
|
||||
{
|
||||
m_pendingData.clear();
|
||||
m_connectionPending = false;
|
||||
|
||||
break_pairing();
|
||||
}
|
||||
|
||||
void MergeMiningClientTari::TariClient::break_pairing()
|
||||
{
|
||||
if (is_paired()) {
|
||||
m_pairedClient->m_pairedClient = nullptr;
|
||||
m_pairedClient->close();
|
||||
m_pairedClient = nullptr;
|
||||
m_pairedClient->m_pairedClientSavedResetCounter = std::numeric_limits<uint32_t>::max();
|
||||
if (!m_pairedClient->m_connectionPending) {
|
||||
m_pairedClient->close();
|
||||
}
|
||||
}
|
||||
m_pairedClient = nullptr;
|
||||
m_pairedClientSavedResetCounter = std::numeric_limits<uint32_t>::max();
|
||||
}
|
||||
|
||||
@@ -910,10 +929,10 @@ bool MergeMiningClientTari::TariClient::on_connect()
|
||||
}
|
||||
else {
|
||||
// The outgoing connection is ready now
|
||||
m_connectionPending = false;
|
||||
|
||||
// Check if the incoming connection (downstream) has already sent something that needs to be relayed
|
||||
TariClient* downstream = m_pairedClient;
|
||||
downstream->m_pairedClient = this;
|
||||
downstream->m_pairedClientSavedResetCounter = m_resetCounter;
|
||||
|
||||
const std::vector<uint8_t>& v = downstream->m_pendingData;
|
||||
|
||||
@@ -944,7 +963,7 @@ bool MergeMiningClientTari::TariClient::on_read(const char* data, uint32_t size)
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!is_paired()) {
|
||||
if (!is_paired() || m_pairedClient->m_connectionPending) {
|
||||
LOGWARN(5, "Read " << size << " bytes from " << static_cast<char*>(m_addrString) << " but it's not paired yet. Buffering it.");
|
||||
m_pendingData.insert(m_pendingData.end(), data, data + size);
|
||||
return true;
|
||||
|
||||
@@ -116,12 +116,17 @@ private:
|
||||
void reset() override;
|
||||
[[nodiscard]] bool on_connect() override;
|
||||
[[nodiscard]] bool on_read(const char* data, uint32_t size) override;
|
||||
void on_connect_failed(int /*err*/) override { break_pairing(); }
|
||||
void on_disconnected() override { break_pairing(); }
|
||||
|
||||
alignas(8) char m_buf[BUF_SIZE];
|
||||
std::vector<uint8_t> m_pendingData;
|
||||
bool m_connectionPending;
|
||||
|
||||
bool is_paired() const { return m_pairedClient && (m_pairedClient->m_resetCounter == m_pairedClientSavedResetCounter); }
|
||||
|
||||
void break_pairing();
|
||||
|
||||
TariClient* m_pairedClient;
|
||||
uint32_t m_pairedClientSavedResetCounter;
|
||||
};
|
||||
|
||||
+30
-10
@@ -17,7 +17,9 @@
|
||||
|
||||
#include "common.h"
|
||||
#include "p2pool.h"
|
||||
#ifndef P2POOL_UNIT_TESTS
|
||||
#include "zmq_reader.h"
|
||||
#endif
|
||||
#include "mempool.h"
|
||||
#include "json_rpc_request.h"
|
||||
#include "rapidjson_wrapper.h"
|
||||
@@ -27,11 +29,13 @@
|
||||
#include "side_chain.h"
|
||||
#include "stratum_server.h"
|
||||
#include "p2p_server.h"
|
||||
#ifdef WITH_RANDOMX
|
||||
#if defined(WITH_RANDOMX) && !defined(P2POOL_UNIT_TESTS)
|
||||
#include "miner.h"
|
||||
#endif
|
||||
#include "params.h"
|
||||
#ifndef P2POOL_UNIT_TESTS
|
||||
#include "console_commands.h"
|
||||
#endif
|
||||
#include "crypto.h"
|
||||
#include "p2pool_api.h"
|
||||
#include "pool_block.h"
|
||||
@@ -156,7 +160,9 @@ p2pool::p2pool(int argc, char* argv[])
|
||||
|
||||
uv_rwlock_init_checked(&m_mainchainLock);
|
||||
uv_rwlock_init_checked(&m_minerDataLock);
|
||||
#ifndef P2POOL_UNIT_TESTS
|
||||
uv_rwlock_init_checked(&m_ZMQReaderLock);
|
||||
#endif
|
||||
uv_rwlock_init_checked(&m_mergeMiningClientsLock);
|
||||
|
||||
#ifdef WITH_MERGE_MINING_DONATION
|
||||
@@ -166,7 +172,7 @@ p2pool::p2pool(int argc, char* argv[])
|
||||
uv_rwlock_init_checked(&m_auxIdLock);
|
||||
uv_mutex_init_checked(&m_foundBlocksLock);
|
||||
|
||||
#ifdef WITH_RANDOMX
|
||||
#if defined(WITH_RANDOMX) && !defined(P2POOL_UNIT_TESTS)
|
||||
uv_mutex_init_checked(&m_minerLock);
|
||||
#endif
|
||||
|
||||
@@ -208,6 +214,7 @@ p2pool::p2pool(int argc, char* argv[])
|
||||
m_blockTemplate = new BlockTemplate(m_sideChain, m_hasher);
|
||||
m_mempool = new Mempool();
|
||||
|
||||
#ifndef P2POOL_UNIT_TESTS
|
||||
try {
|
||||
m_consoleCommands = new ConsoleCommands(this);
|
||||
}
|
||||
@@ -215,6 +222,7 @@ p2pool::p2pool(int argc, char* argv[])
|
||||
LOGERR(1, "Couldn't start console commands handler");
|
||||
m_consoleCommands = nullptr;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
p2pool::~p2pool()
|
||||
@@ -237,7 +245,9 @@ p2pool::~p2pool()
|
||||
|
||||
uv_rwlock_destroy(&m_mainchainLock);
|
||||
uv_rwlock_destroy(&m_minerDataLock);
|
||||
#ifndef P2POOL_UNIT_TESTS
|
||||
uv_rwlock_destroy(&m_ZMQReaderLock);
|
||||
#endif
|
||||
uv_rwlock_destroy(&m_mergeMiningClientsLock);
|
||||
|
||||
#ifdef WITH_MERGE_MINING_DONATION
|
||||
@@ -247,7 +257,7 @@ p2pool::~p2pool()
|
||||
uv_rwlock_destroy(&m_auxIdLock);
|
||||
uv_mutex_destroy(&m_foundBlocksLock);
|
||||
|
||||
#ifdef WITH_RANDOMX
|
||||
#if defined(WITH_RANDOMX) && !defined(P2POOL_UNIT_TESTS)
|
||||
uv_mutex_destroy(&m_minerLock);
|
||||
#endif
|
||||
|
||||
@@ -340,7 +350,7 @@ bool p2pool::get_seed(uint64_t height, hash& seed) const
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef WITH_RANDOMX
|
||||
#if defined(WITH_RANDOMX) && !defined(P2POOL_UNIT_TESTS)
|
||||
void p2pool::print_miner_status()
|
||||
{
|
||||
MutexLock lock(m_minerLock);
|
||||
@@ -965,7 +975,9 @@ void p2pool::on_stop(uv_async_t* async)
|
||||
{
|
||||
p2pool* pool = reinterpret_cast<p2pool*>(async->data);
|
||||
|
||||
#ifndef P2POOL_UNIT_TESTS
|
||||
delete pool->m_consoleCommands;
|
||||
#endif
|
||||
|
||||
if (pool->m_api) {
|
||||
pool->m_api->on_stop();
|
||||
@@ -1144,7 +1156,7 @@ void p2pool::update_block_template()
|
||||
stratum_on_block();
|
||||
api_update_pool_stats();
|
||||
|
||||
#ifdef WITH_RANDOMX
|
||||
#if defined(WITH_RANDOMX) && !defined(P2POOL_UNIT_TESTS)
|
||||
if (m_isAlternativeBlock.exchange(false)) {
|
||||
MutexLock lock(m_minerLock);
|
||||
|
||||
@@ -1278,11 +1290,10 @@ void p2pool::download_block_headers4(uint64_t start_height, uint64_t current_hei
|
||||
if (m_serversStarted.exchange(1) == 0) {
|
||||
m_p2pServer = new P2PServer(this);
|
||||
m_stratumServer = new StratumServer(this);
|
||||
#ifdef WITH_RANDOMX
|
||||
#if defined(WITH_RANDOMX) && !defined(P2POOL_UNIT_TESTS)
|
||||
if (m_params->m_minerThreads) {
|
||||
start_mining(m_params->m_minerThreads);
|
||||
}
|
||||
#endif
|
||||
{
|
||||
WriteLock lock(m_ZMQReaderLock);
|
||||
|
||||
@@ -1295,6 +1306,7 @@ void p2pool::download_block_headers4(uint64_t start_height, uint64_t current_hei
|
||||
PANIC_STOP();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
api_update_network_stats();
|
||||
get_miner_data();
|
||||
@@ -1393,7 +1405,7 @@ void p2pool::update_median_timestamp()
|
||||
|
||||
void p2pool::stratum_on_block()
|
||||
{
|
||||
#ifdef WITH_RANDOMX
|
||||
#if defined(WITH_RANDOMX) && !defined(P2POOL_UNIT_TESTS)
|
||||
{
|
||||
MutexLock lock(m_minerLock);
|
||||
|
||||
@@ -2063,7 +2075,7 @@ bool p2pool::get_difficulty_at_height(uint64_t height, difficulty_type& diff)
|
||||
return true;
|
||||
}
|
||||
|
||||
#ifdef WITH_RANDOMX
|
||||
#if defined(WITH_RANDOMX) && !defined(P2POOL_UNIT_TESTS)
|
||||
void p2pool::start_mining(uint32_t threads)
|
||||
{
|
||||
stop_mining();
|
||||
@@ -2168,8 +2180,12 @@ void p2pool::stop()
|
||||
|
||||
bool p2pool::zmq_running() const
|
||||
{
|
||||
#ifdef P2POOL_UNIT_TESTS
|
||||
return true;
|
||||
#else
|
||||
ReadLock lock(m_ZMQReaderLock);
|
||||
return m_ZMQReader && m_ZMQReader->is_running();
|
||||
#endif
|
||||
}
|
||||
|
||||
const Params::Host& p2pool::switch_host()
|
||||
@@ -2190,6 +2206,7 @@ void p2pool::reconnect_to_host()
|
||||
return;
|
||||
}
|
||||
|
||||
#ifndef P2POOL_UNIT_TESTS
|
||||
const Params::Host& new_host = switch_host();
|
||||
|
||||
WriteLock lock(m_ZMQReaderLock);
|
||||
@@ -2209,6 +2226,7 @@ void p2pool::reconnect_to_host()
|
||||
if (m_ZMQReader) {
|
||||
get_miner_data(false);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
int p2pool::run()
|
||||
@@ -2245,10 +2263,12 @@ int p2pool::run()
|
||||
const int rc = uv_run(uv_default_loop_checked(), UV_RUN_DEFAULT);
|
||||
LOGINFO(1, "uv_run exited, result = " << rc);
|
||||
|
||||
#ifndef P2POOL_UNIT_TESTS
|
||||
WriteLock lock(m_ZMQReaderLock);
|
||||
|
||||
delete m_ZMQReader;
|
||||
m_ZMQReader = nullptr;
|
||||
#endif
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
LOGERR(1, "exception " << e.what());
|
||||
@@ -2259,7 +2279,7 @@ int p2pool::run()
|
||||
|
||||
bkg_jobs_tracker->wait();
|
||||
|
||||
#ifdef WITH_RANDOMX
|
||||
#if defined(WITH_RANDOMX) && !defined(P2POOL_UNIT_TESTS)
|
||||
{
|
||||
MutexLock lock(m_minerLock);
|
||||
|
||||
|
||||
+7
-3
@@ -77,7 +77,7 @@ public:
|
||||
StratumServer* stratum_server() const { return m_stratumServer; }
|
||||
P2PServer* p2p_server() const { return m_p2pServer; }
|
||||
|
||||
#ifdef WITH_RANDOMX
|
||||
#if defined(WITH_RANDOMX) && !defined(P2POOL_UNIT_TESTS)
|
||||
void print_miner_status();
|
||||
#endif
|
||||
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
|
||||
bool get_difficulty_at_height(uint64_t height, difficulty_type& diff);
|
||||
|
||||
#ifdef WITH_RANDOMX
|
||||
#if defined(WITH_RANDOMX) && !defined(P2POOL_UNIT_TESTS)
|
||||
void start_mining(uint32_t threads);
|
||||
void stop_mining();
|
||||
#endif
|
||||
@@ -226,12 +226,14 @@ private:
|
||||
|
||||
std::atomic<bool> m_startupFinished{ false };
|
||||
|
||||
#ifdef WITH_RANDOMX
|
||||
#if defined(WITH_RANDOMX) && !defined(P2POOL_UNIT_TESTS)
|
||||
uv_mutex_t m_minerLock;
|
||||
Miner* m_miner = nullptr;
|
||||
#endif
|
||||
|
||||
#ifndef P2POOL_UNIT_TESTS
|
||||
ConsoleCommands* m_consoleCommands;
|
||||
#endif
|
||||
|
||||
struct SubmitBlockData
|
||||
{
|
||||
@@ -258,8 +260,10 @@ private:
|
||||
uint64_t m_startTime;
|
||||
uv_async_t m_reconnectToHostAsync;
|
||||
|
||||
#ifndef P2POOL_UNIT_TESTS
|
||||
mutable uv_rwlock_t m_ZMQReaderLock;
|
||||
ZMQReader* m_ZMQReader = nullptr;
|
||||
#endif
|
||||
|
||||
mutable uv_rwlock_t m_mergeMiningClientsLock;
|
||||
std::vector<IMergeMiningClient*> m_mergeMiningClients;
|
||||
|
||||
@@ -766,6 +766,7 @@ void TCPServer::on_connect(uv_connect_t* req, int status)
|
||||
LOGWARN(5, "failed to connect to " << static_cast<char*>(client->m_addrString) << ", error " << uv_err_name(status));
|
||||
}
|
||||
server->on_connect_failed(client->m_isV6, client->m_addr, client->m_port);
|
||||
client->on_connect_failed(status);
|
||||
uv_close(reinterpret_cast<uv_handle_t*>(&client->m_socket), on_connection_error);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -65,6 +65,7 @@ public:
|
||||
[[nodiscard]] virtual bool on_connect() = 0;
|
||||
[[nodiscard]] virtual bool on_read(const char* data, uint32_t size) = 0;
|
||||
[[nodiscard]] bool on_proxy_handshake(const char* data, uint32_t size);
|
||||
virtual void on_connect_failed(int /*err*/) {}
|
||||
virtual void on_read_failed(int /*err*/) {}
|
||||
virtual void on_disconnected() {}
|
||||
|
||||
|
||||
@@ -40,7 +40,10 @@
|
||||
#include <resolv.h>
|
||||
#endif
|
||||
|
||||
#ifndef P2POOL_UNIT_TESTS
|
||||
#include <curl/curl.h>
|
||||
#endif
|
||||
|
||||
#include <zmq.h>
|
||||
|
||||
#ifdef HAVE_GLIBC
|
||||
@@ -75,7 +78,9 @@ const char* VERSION = "v" STR2(P2POOL_VERSION_MAJOR) "." STR2(P2POOL_VERSION_MIN
|
||||
|
||||
std::string p2pool_version()
|
||||
{
|
||||
#ifndef P2POOL_UNIT_TESTS
|
||||
const curl_version_info_data* curl_version_data = curl_version_info(CURLVERSION_NOW);
|
||||
#endif
|
||||
|
||||
int zmq_major, zmq_minor, zmq_patch;
|
||||
zmq_version(&zmq_major, &zmq_minor, &zmq_patch);
|
||||
@@ -91,7 +96,9 @@ std::string p2pool_version()
|
||||
#ifdef WITH_GRPC
|
||||
<< " - grpc " << GRPC_CPP_VERSION_STRING << '\n'
|
||||
#endif
|
||||
#ifndef P2POOL_UNIT_TESTS
|
||||
<< " - libcurl " << (curl_version_data ? curl_version_data->version : "unknown") << '\n'
|
||||
#endif
|
||||
<< " - libuv " << uv_version_string() << '\n'
|
||||
<< " - libzmq " << zmq_major << '.' << zmq_minor << '.' << zmq_patch << '\n'
|
||||
#ifdef WITH_UPNP
|
||||
@@ -103,6 +110,17 @@ std::string p2pool_version()
|
||||
return std::string(buf, s.m_pos);
|
||||
}
|
||||
|
||||
void fixup_path(std::string& path)
|
||||
{
|
||||
if (!path.empty() && (path.back() != '/')
|
||||
#ifdef _WIN32
|
||||
&& (path.back() != '\\')
|
||||
#endif
|
||||
) {
|
||||
path.append(1, '/');
|
||||
}
|
||||
}
|
||||
|
||||
const uint8_t ED25519_MASTER_PUBLIC_KEY[32] = {51,175,37,73,203,241,188,115,195,255,123,53,218,120,90,74,186,240,82,178,67,139,124,91,180,106,188,181,187,51,236,10};
|
||||
|
||||
std::string DATA_DIR;
|
||||
|
||||
+3
-1
@@ -36,7 +36,7 @@ namespace p2pool {
|
||||
|
||||
#define P2POOL_VERSION_MAJOR 4
|
||||
#define P2POOL_VERSION_MINOR 9
|
||||
#define P2POOL_VERSION_PATCH 0
|
||||
#define P2POOL_VERSION_PATCH 1
|
||||
|
||||
constexpr uint32_t P2POOL_VERSION = (P2POOL_VERSION_MAJOR << 16) | (P2POOL_VERSION_MINOR << 8) | P2POOL_VERSION_PATCH;
|
||||
|
||||
@@ -383,6 +383,8 @@ void minidump_and_crash(size_t delay);
|
||||
|
||||
std::string p2pool_version();
|
||||
|
||||
void fixup_path(std::string& path);
|
||||
|
||||
} // namespace p2pool
|
||||
|
||||
void memory_tracking_start();
|
||||
|
||||
+1
-1
@@ -22,7 +22,7 @@
|
||||
|
||||
namespace p2pool {
|
||||
|
||||
class ZMQReader {
|
||||
class ZMQReader : public nocopy_nomove {
|
||||
public:
|
||||
ZMQReader(const std::string& address, uint32_t zmq_port, const std::string& proxy, MinerCallbackHandler* handler);
|
||||
~ZMQReader();
|
||||
|
||||
+1
-37
@@ -36,11 +36,6 @@ else()
|
||||
endif()
|
||||
|
||||
add_definitions(-DWITH_RANDOMX)
|
||||
|
||||
add_subdirectory(cmake/ssl)
|
||||
include_directories(../external/src/grpc/third_party/boringssl-with-bazel/src/include)
|
||||
add_definitions(-DWITH_TLS)
|
||||
|
||||
add_definitions(-DWITH_MERGE_MINING_DONATION)
|
||||
|
||||
add_definitions(-DP2POOL_UNIT_TESTS)
|
||||
@@ -70,17 +65,12 @@ set(SOURCES
|
||||
../external/src/hardforks/hardforks.cpp
|
||||
../src/block_cache.cpp
|
||||
../src/block_template.cpp
|
||||
../src/console_commands.cpp
|
||||
../src/crypto.cpp
|
||||
../src/json_rpc_request.cpp
|
||||
../src/keccak.cpp
|
||||
../src/log.cpp
|
||||
../src/memory_leak_debug.cpp
|
||||
../src/mempool.cpp
|
||||
../src/merge_mining_client.cpp
|
||||
../src/merge_mining_client_json_rpc.cpp
|
||||
../src/merkle.cpp
|
||||
../src/miner.cpp
|
||||
../src/p2p_server.cpp
|
||||
../src/p2pool.cpp
|
||||
../src/p2pool_api.cpp
|
||||
@@ -90,10 +80,8 @@ set(SOURCES
|
||||
../src/side_chain.cpp
|
||||
../src/stratum_server.cpp
|
||||
../src/tcp_server.cpp
|
||||
../src/tls.cpp
|
||||
../src/util.cpp
|
||||
../src/wallet.cpp
|
||||
../src/zmq_reader.cpp
|
||||
)
|
||||
|
||||
if (AMD64)
|
||||
@@ -103,16 +91,6 @@ if (AMD64)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT ((CMAKE_CXX_COMPILER_ID MATCHES MSVC) OR STATIC_BINARY OR STATIC_LIBS))
|
||||
include(FindCURL)
|
||||
endif()
|
||||
|
||||
if (CURL_INCLUDE_DIRS)
|
||||
include_directories(${CURL_INCLUDE_DIRS})
|
||||
else()
|
||||
include_directories(../external/src/curl/include)
|
||||
endif()
|
||||
|
||||
if ((CMAKE_CXX_COMPILER_ID MATCHES MSVC) OR STATIC_BINARY OR STATIC_LIBS)
|
||||
set(UV_INCLUDE_DIR ../external/src/libuv/include)
|
||||
set(ZMQ_INCLUDE_DIR ../external/src/libzmq/include)
|
||||
@@ -140,7 +118,6 @@ if (WIN32)
|
||||
if ((CMAKE_CXX_COMPILER_ID MATCHES GNU) OR (CMAKE_CXX_COMPILER_ID MATCHES Clang))
|
||||
set(LIBS ${LIBS} bcrypt)
|
||||
endif()
|
||||
add_definitions(-DCURL_STATICLIB)
|
||||
elseif (NOT APPLE)
|
||||
set(LIBS ${LIBS} pthread)
|
||||
endif()
|
||||
@@ -150,24 +127,13 @@ if (STATIC_LIBS)
|
||||
set(ZMQ_LIBRARY_DEBUG "${CMAKE_SOURCE_DIR}/../external/src/libzmq/build/lib/libzmq.a")
|
||||
set(UV_LIBRARY_DEBUG "${CMAKE_SOURCE_DIR}/../external/src/libuv/build/libuv.a")
|
||||
set(UV_LIBRARY "${CMAKE_SOURCE_DIR}/../external/src/libuv/build/libuv.a")
|
||||
set(CURL_LIBRARY_DEBUG "${CMAKE_SOURCE_DIR}/../external/src/curl/lib/.libs/libcurl.a")
|
||||
set(CURL_LIBRARY "${CMAKE_SOURCE_DIR}/../external/src/curl/lib/.libs/libcurl.a")
|
||||
else()
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
find_library(CURL_LIBRARY_DEBUG NAMES libcurl-d PATHS "../external/lib/libcurl_tls/Debug")
|
||||
find_library(CURL_LIBRARY NAMES libcurl PATHS "../external/lib/libcurl_tls/Release")
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||
find_library(ZMQ_LIBRARY_DEBUG NAMES zmq libzmq.a)
|
||||
find_library(ZMQ_LIBRARY NAMES zmq libzmq.a)
|
||||
find_library(UV_LIBRARY_DEBUG NAMES uv libuv.a)
|
||||
find_library(UV_LIBRARY NAMES uv libuv.a)
|
||||
if (WIN32)
|
||||
find_library(CURL_LIBRARY_DEBUG NAMES libcurl.a PATHS "../external/src/curl/lib/.libs" NO_DEFAULT_PATH)
|
||||
find_library(CURL_LIBRARY NAMES libcurl.a PATHS "../external/src/curl/lib/.libs" NO_DEFAULT_PATH)
|
||||
else()
|
||||
find_library(CURL_LIBRARY_DEBUG NAMES curl)
|
||||
find_library(CURL_LIBRARY NAMES curl)
|
||||
endif()
|
||||
find_library(SODIUM_LIBRARY sodium)
|
||||
endif()
|
||||
|
||||
@@ -194,8 +160,6 @@ if(APPLE)
|
||||
set(LIBS ${LIBS} ${FOUNDATION_LIB} ${CORE_FOUNDATION_LIB} ${SYSTEM_CONFIGURATION_LIB})
|
||||
endif()
|
||||
|
||||
set(LIBS ${LIBS} ssl crypto)
|
||||
|
||||
add_definitions(/DZMQ_STATIC /DP2POOL_LOG_DISABLE)
|
||||
|
||||
include(CheckCXXSourceCompiles)
|
||||
@@ -214,7 +178,7 @@ endif()
|
||||
add_definitions("-DRAPIDJSON_PARSE_DEFAULT_FLAGS=kParseTrailingCommasFlag")
|
||||
|
||||
add_executable(${CMAKE_PROJECT_NAME} ${HEADERS} ${SOURCES})
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME} debug ${ZMQ_LIBRARY_DEBUG} debug ${UV_LIBRARY_DEBUG} debug ${CURL_LIBRARY_DEBUG} optimized ${ZMQ_LIBRARY} optimized ${UV_LIBRARY} optimized ${CURL_LIBRARY} ${LIBS})
|
||||
target_link_libraries(${CMAKE_PROJECT_NAME} debug ${ZMQ_LIBRARY_DEBUG} debug ${UV_LIBRARY_DEBUG} optimized ${ZMQ_LIBRARY} optimized ${UV_LIBRARY} ${LIBS})
|
||||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/src/crypto_tests.txt" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
||||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/src/block.dat" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
||||
add_custom_command(TARGET ${CMAKE_PROJECT_NAME} POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_if_different "${CMAKE_SOURCE_DIR}/src/sidechain_dump.dat.xz" $<TARGET_FILE_DIR:${CMAKE_PROJECT_NAME}>)
|
||||
|
||||
@@ -296,6 +296,11 @@ allowedAPIs = {
|
||||
"CryptGenRandom",
|
||||
"HeapQueryInformation",
|
||||
"AreFileApisANSI",
|
||||
"GetUserProfileDirectoryW",
|
||||
"GetUserNameW",
|
||||
"GetEnvironmentVariableW",
|
||||
"RtlCaptureStackBackTrace",
|
||||
"GetDynamicTimeZoneInformation",
|
||||
}
|
||||
|
||||
f = open(sys.argv[1], 'r')
|
||||
|
||||
@@ -18,11 +18,23 @@
|
||||
#include "common.h"
|
||||
#include "util.h"
|
||||
#include "pool_block.h"
|
||||
#include "json_rpc_request.h"
|
||||
#include "merge_mining_client.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
void p2pool_usage() {}
|
||||
|
||||
namespace p2pool {
|
||||
|
||||
IMergeMiningClient* IMergeMiningClient::create(p2pool*, const std::string&, const std::string&) noexcept { return nullptr; }
|
||||
|
||||
namespace JSONRPCRequest {
|
||||
void Call(const std::string&, int, const std::string&, const std::string&, const std::string&, bool, const std::string&, CallbackBase*, CallbackBase*, uv_loop_t*) {}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
using namespace p2pool;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
|
||||
Reference in New Issue
Block a user