Added gRPC library

This commit is contained in:
SChernykh 2024-02-10 23:38:22 +01:00
parent 2ff6fb7b65
commit 0801d607a1
54 changed files with 73684 additions and 16721 deletions

View file

@ -109,7 +109,7 @@ jobs:
build-ubuntu: build-ubuntu:
timeout-minutes: 10 timeout-minutes: 60
runs-on: ${{ matrix.config.os }} runs-on: ${{ matrix.config.os }}
strategy: strategy:
@ -165,7 +165,7 @@ jobs:
build-ubuntu-static-libs: build-ubuntu-static-libs:
timeout-minutes: 15 timeout-minutes: 60
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
strategy: strategy:
@ -320,14 +320,14 @@ jobs:
build-windows-msys2: build-windows-msys2:
timeout-minutes: 45 timeout-minutes: 60
runs-on: windows-latest runs-on: windows-latest
strategy: strategy:
matrix: matrix:
config: config:
- {c: "gcc", cxx: "g++", flags: "-flto=2 -fuse-linker-plugin -ffunction-sections -Wno-error=maybe-uninitialized -Wno-error=attributes"} - {c: "gcc", cxx: "g++", flags: "-ffunction-sections -Wno-error=maybe-uninitialized -Wno-error=attributes"}
- {c: "clang", cxx: "clang++", flags: "-flto -ffunction-sections -fuse-ld=lld -Wno-unused-command-line-argument"} - {c: "clang", cxx: "clang++", flags: "-fuse-ld=lld -Wno-unused-command-line-argument"}
defaults: defaults:
run: run:
@ -372,7 +372,7 @@ jobs:
run: | run: |
mkdir build mkdir build
cd build cd build
cmake .. -G "Unix Makefiles" -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -DCMAKE_C_FLAGS="${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections" -DSTATIC_LIBS=ON cmake .. -G "Unix Makefiles" -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -DCMAKE_C_FLAGS="${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections" -DSTATIC_LIBS=ON -DOPENSSL_NO_ASM=ON -DWITH_LTO=OFF
make -j$(nproc) make -j$(nproc)
- name: Run RandomX tests - name: Run RandomX tests
@ -402,7 +402,7 @@ jobs:
build-windows-msbuild: build-windows-msbuild:
timeout-minutes: 20 timeout-minutes: 60
runs-on: windows-${{ matrix.config.os }} runs-on: windows-${{ matrix.config.os }}
strategy: strategy:

7
.gitmodules vendored
View file

@ -25,6 +25,7 @@
[submodule "external/src/miniupnp"] [submodule "external/src/miniupnp"]
path = external/src/miniupnp path = external/src/miniupnp
url = https://github.com/SChernykh/miniupnp url = https://github.com/SChernykh/miniupnp
[submodule "external/src/protobuf-c"] [submodule "external/src/grpc"]
path = external/src/protobuf-c path = external/src/grpc
url = https://github.com/SChernykh/protobuf-c url = https://github.com/SChernykh/grpc
branch = v1.61.x

View file

@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.10) cmake_minimum_required(VERSION 3.10)
project(p2pool) project(p2pool)
include(cmake/standard.cmake)
message(STATUS "Build environment: message(STATUS "Build environment:
System processor: ${CMAKE_SYSTEM_PROCESSOR} System processor: ${CMAKE_SYSTEM_PROCESSOR}
C compiler: ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_ID}) C compiler: ${CMAKE_C_COMPILER} (${CMAKE_C_COMPILER_ID})
@ -25,6 +27,8 @@ option(DEV_TRACK_MEMORY "[Developer only] Track memory allocations" OFF)
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT p2pool) set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT p2pool)
include(cmake/grpc.cmake)
add_subdirectory(external/src/Tari) add_subdirectory(external/src/Tari)
set(LIBS ${LIBS} Tari_gRPC) set(LIBS ${LIBS} Tari_gRPC)
@ -178,7 +182,6 @@ include_directories(external/src/robin-hood-hashing/src/include)
if (WITH_UPNP) if (WITH_UPNP)
include_directories(external/src/miniupnp/miniupnpc/include) include_directories(external/src/miniupnp/miniupnpc/include)
endif() endif()
include_directories(external/src/protobuf-c)
if (WIN32) if (WIN32)
set(LIBS ${LIBS} ws2_32 iphlpapi userenv psapi dnsapi dbghelp) set(LIBS ${LIBS} ws2_32 iphlpapi userenv psapi dnsapi dbghelp)
@ -372,6 +375,8 @@ if (STATIC_BINARY OR STATIC_LIBS)
set(STATIC_LIBS ${STATIC_LIBS} resolv) set(STATIC_LIBS ${STATIC_LIBS} resolv)
endif() endif()
set(STATIC_LIBS ${STATIC_LIBS} Tari_gRPC grpc grpc++ libprotobuf)
target_link_libraries(${CMAKE_PROJECT_NAME} target_link_libraries(${CMAKE_PROJECT_NAME}
"${CMAKE_SOURCE_DIR}/external/src/libzmq/build/lib/libzmq.a" "${CMAKE_SOURCE_DIR}/external/src/libzmq/build/lib/libzmq.a"
"${CMAKE_SOURCE_DIR}/external/src/libuv/build/libuv.a" "${CMAKE_SOURCE_DIR}/external/src/libuv/build/libuv.a"

View file

@ -1,17 +1,3 @@
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 99)
set(CMAKE_C_STANDARD_REQUIRED ON)
if(NOT ARCH_ID)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "")
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR})
endif()
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" ARCH_ID)
endif()
if (ARCH_ID MATCHES "^(aarch64|arm64|armv8-a)$") if (ARCH_ID MATCHES "^(aarch64|arm64|armv8-a)$")
set(ARMv8 1) set(ARMv8 1)
endif() endif()

46
cmake/grpc.cmake Normal file
View file

@ -0,0 +1,46 @@
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_SHARED_LIBS OFF CACHE BOOL "Build protobuf Shared Libraries")
set(utf8_range_ENABLE_TESTS OFF CACHE BOOL "Build test suite")
set(utf8_range_ENABLE_INSTALL OFF CACHE BOOL "Configure installation")
set(RE2_BUILD_TESTING OFF CACHE BOOL "enable testing for RE2")
set(gRPC_BUILD_CODEGEN OFF CACHE BOOL "Build codegen")
set(gRPC_BUILD_GRPC_CPP_PLUGIN OFF CACHE BOOL "Build grpc_cpp_plugin")
set(gRPC_BUILD_GRPC_CSHARP_PLUGIN OFF CACHE BOOL "Build grpc_csharp_plugin")
set(gRPC_BUILD_GRPC_NODE_PLUGIN OFF CACHE BOOL "Build grpc_node_plugin")
set(gRPC_BUILD_GRPC_OBJECTIVE_C_PLUGIN OFF CACHE BOOL "Build grpc_objective_c_plugin")
set(gRPC_BUILD_GRPC_PHP_PLUGIN OFF CACHE BOOL "Build grpc_php_plugin")
set(gRPC_BUILD_GRPC_PYTHON_PLUGIN OFF CACHE BOOL "Build grpc_python_plugin")
set(gRPC_BUILD_GRPC_RUBY_PLUGIN OFF CACHE BOOL "Build grpc_ruby_plugin")
set(gRPC_MSVC_STATIC_RUNTIME ON CACHE BOOL "Link gRPC with static msvc runtime libraries")
set(CARES_STATIC ON CACHE BOOL "Build as a static library")
set(CARES_SHARED OFF CACHE BOOL "Build as a shared library")
set(CARES_INSTALL OFF CACHE BOOL "Create installation targets (chain builders may want to disable this)")
set(CARES_BUILD_TOOLS OFF CACHE BOOL "Build tools")
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /W0 /Zi /Od /Ob0 /MP /MTd")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W0 /Zi /Od /Ob0 /MP /MTd")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /MT /GL")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /MT /GL")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -w")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os -w")
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
include_directories(external/src/common)
endif()
add_subdirectory(external/src/grpc)
set(LIBS ${LIBS} grpc grpc++ libprotobuf)
include_directories(external/src/grpc/third_party/abseil-cpp)
include_directories(external/src/grpc/third_party/protobuf/src)
include_directories(external/src/grpc/include)

13
cmake/standard.cmake Normal file
View file

@ -0,0 +1,13 @@
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
if(NOT ARCH_ID)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "")
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR})
endif()
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" ARCH_ID)
endif()

View file

@ -2,32 +2,50 @@ cmake_minimum_required(VERSION 3.10)
project(Tari_gRPC) project(Tari_gRPC)
set(HEADERS set(HEADERS
../protobuf-c/protobuf-c/protobuf-c.h proto/gRPC/base_node.pb.h
proto/gRPC/google/protobuf/timestamp.pb-c.h proto/gRPC/block.pb.h
proto/gRPC/base_node.pb-c.h proto/gRPC/network.pb.h
proto/gRPC/block.pb-c.h proto/gRPC/sidechain_types.pb.h
proto/gRPC/network.pb-c.h proto/gRPC/transaction.pb.h
proto/gRPC/sidechain_types.pb-c.h proto/gRPC/types.pb.h
proto/gRPC/transaction.pb-c.h proto/gRPC/base_node.grpc.pb.h
proto/gRPC/types.pb-c.h proto/gRPC/block.grpc.pb.h
proto/gRPC/network.grpc.pb.h
proto/gRPC/sidechain_types.grpc.pb.h
proto/gRPC/transaction.grpc.pb.h
proto/gRPC/types.grpc.pb.h
proto.h proto.h
) )
set(SOURCES set(SOURCES
../protobuf-c/protobuf-c/protobuf-c.c proto/gRPC/base_node.pb.cc
proto/gRPC/google/protobuf/timestamp.pb-c.c proto/gRPC/block.pb.cc
proto/gRPC/base_node.pb-c.c proto/gRPC/network.pb.cc
proto/gRPC/block.pb-c.c proto/gRPC/sidechain_types.pb.cc
proto/gRPC/network.pb-c.c proto/gRPC/transaction.pb.cc
proto/gRPC/sidechain_types.pb-c.c proto/gRPC/types.pb.cc
proto/gRPC/transaction.pb-c.c proto/gRPC/base_node.grpc.pb.cc
proto/gRPC/types.pb-c.c proto/gRPC/block.grpc.pb.cc
proto/gRPC/network.grpc.pb.cc
proto/gRPC/sidechain_types.grpc.pb.cc
proto/gRPC/transaction.grpc.pb.cc
proto/gRPC/types.grpc.pb.cc
) )
include_directories(../protobuf-c) include_directories(../grpc/third_party/protobuf/src)
include_directories(../grpc/include)
include_directories(../grpc/third_party/abseil-cpp)
set(DISABLE_WARNINGS ON) set(DISABLE_WARNINGS ON)
include(../../../cmake/flags.cmake) if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /W0 /Zi /Od /Ob0 /MP /MTd")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /W0 /Zi /Od /Ob0 /MP /MTd")
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /GL /MT")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /GL /MT")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -w")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os -w")
endif()
add_library(Tari_gRPC ${HEADERS} ${SOURCES}) add_library(Tari_gRPC ${HEADERS} ${SOURCES})

View file

@ -2,19 +2,33 @@
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(push, 0) #pragma warning(push, 0)
#elif __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wundef"
#endif #endif
extern "C" { #include "proto/gRPC/base_node.pb.h"
#include "proto/gRPC/block.pb.h"
#include "proto/gRPC/network.pb.h"
#include "proto/gRPC/sidechain_types.pb.h"
#include "proto/gRPC/transaction.pb.h"
#include "proto/gRPC/types.pb.h"
#include "proto/gRPC/base_node.pb-c.h" #include "proto/gRPC/base_node.grpc.pb.h"
#include "proto/gRPC/block.pb-c.h" #include "proto/gRPC/block.grpc.pb.h"
#include "proto/gRPC/network.pb-c.h" #include "proto/gRPC/network.grpc.pb.h"
#include "proto/gRPC/sidechain_types.pb-c.h" #include "proto/gRPC/sidechain_types.grpc.pb.h"
#include "proto/gRPC/transaction.pb-c.h" #include "proto/gRPC/transaction.grpc.pb.h"
#include "proto/gRPC/types.pb-c.h" #include "proto/gRPC/types.grpc.pb.h"
} #include <grpc/grpc.h>
#include <grpcpp/channel.h>
#include <grpcpp/client_context.h>
#include <grpcpp/create_channel.h>
#include <grpcpp/security/credentials.h>
#ifdef _MSC_VER #ifdef _MSC_VER
#pragma warning(pop) #pragma warning(pop)
#elif __GNUC__
#pragma GCC diagnostic pop
#endif #endif

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

16879
external/src/Tari/proto/gRPC/base_node.pb.h vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,27 @@
// Generated by the gRPC C++ plugin.
// If you make any local change, they will be lost.
// source: block.proto
#include "block.pb.h"
#include "block.grpc.pb.h"
#include <functional>
#include <grpcpp/support/async_stream.h>
#include <grpcpp/support/async_unary_call.h>
#include <grpcpp/impl/channel_interface.h>
#include <grpcpp/impl/client_unary_call.h>
#include <grpcpp/support/client_callback.h>
#include <grpcpp/support/message_allocator.h>
#include <grpcpp/support/method_handler.h>
#include <grpcpp/impl/rpc_service_method.h>
#include <grpcpp/support/server_callback.h>
#include <grpcpp/impl/server_callback_handlers.h>
#include <grpcpp/server_context.h>
#include <grpcpp/impl/service_type.h>
#include <grpcpp/support/sync_stream.h>
namespace tari {
namespace rpc {
} // namespace tari
} // namespace rpc

View file

@ -0,0 +1,57 @@
// Generated by the gRPC C++ plugin.
// If you make any local change, they will be lost.
// source: block.proto
// Original file comments:
// Copyright 2020. The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
// following disclaimer in the documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
// products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef GRPC_block_2eproto__INCLUDED
#define GRPC_block_2eproto__INCLUDED
#include "block.pb.h"
#include <functional>
#include <grpcpp/generic/async_generic_service.h>
#include <grpcpp/support/async_stream.h>
#include <grpcpp/support/async_unary_call.h>
#include <grpcpp/support/client_callback.h>
#include <grpcpp/client_context.h>
#include <grpcpp/completion_queue.h>
#include <grpcpp/support/message_allocator.h>
#include <grpcpp/support/method_handler.h>
#include <grpcpp/impl/proto_utils.h>
#include <grpcpp/impl/rpc_method.h>
#include <grpcpp/support/server_callback.h>
#include <grpcpp/impl/server_callback_handlers.h>
#include <grpcpp/server_context.h>
#include <grpcpp/impl/service_type.h>
#include <grpcpp/support/status.h>
#include <grpcpp/support/stub_options.h>
#include <grpcpp/support/sync_stream.h>
namespace tari {
namespace rpc {
} // namespace rpc
} // namespace tari
#endif // GRPC_block_2eproto__INCLUDED

View file

@ -1,933 +0,0 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: block.proto */
/* Do not generate deprecated warnings for self */
#ifndef PROTOBUF_C__NO_DEPRECATED
#define PROTOBUF_C__NO_DEPRECATED
#endif
#include "block.pb-c.h"
void tari__rpc__block_header__init
(Tari__Rpc__BlockHeader *message)
{
static const Tari__Rpc__BlockHeader init_value = TARI__RPC__BLOCK_HEADER__INIT;
*message = init_value;
}
size_t tari__rpc__block_header__get_packed_size
(const Tari__Rpc__BlockHeader *message)
{
assert(message->base.descriptor == &tari__rpc__block_header__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__block_header__pack
(const Tari__Rpc__BlockHeader *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__block_header__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__block_header__pack_to_buffer
(const Tari__Rpc__BlockHeader *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__block_header__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__BlockHeader *
tari__rpc__block_header__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__BlockHeader *)
protobuf_c_message_unpack (&tari__rpc__block_header__descriptor,
allocator, len, data);
}
void tari__rpc__block_header__free_unpacked
(Tari__Rpc__BlockHeader *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__block_header__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__proof_of_work__init
(Tari__Rpc__ProofOfWork *message)
{
static const Tari__Rpc__ProofOfWork init_value = TARI__RPC__PROOF_OF_WORK__INIT;
*message = init_value;
}
size_t tari__rpc__proof_of_work__get_packed_size
(const Tari__Rpc__ProofOfWork *message)
{
assert(message->base.descriptor == &tari__rpc__proof_of_work__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__proof_of_work__pack
(const Tari__Rpc__ProofOfWork *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__proof_of_work__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__proof_of_work__pack_to_buffer
(const Tari__Rpc__ProofOfWork *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__proof_of_work__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__ProofOfWork *
tari__rpc__proof_of_work__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__ProofOfWork *)
protobuf_c_message_unpack (&tari__rpc__proof_of_work__descriptor,
allocator, len, data);
}
void tari__rpc__proof_of_work__free_unpacked
(Tari__Rpc__ProofOfWork *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__proof_of_work__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__pow_algo__init
(Tari__Rpc__PowAlgo *message)
{
static const Tari__Rpc__PowAlgo init_value = TARI__RPC__POW_ALGO__INIT;
*message = init_value;
}
size_t tari__rpc__pow_algo__get_packed_size
(const Tari__Rpc__PowAlgo *message)
{
assert(message->base.descriptor == &tari__rpc__pow_algo__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__pow_algo__pack
(const Tari__Rpc__PowAlgo *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__pow_algo__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__pow_algo__pack_to_buffer
(const Tari__Rpc__PowAlgo *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__pow_algo__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__PowAlgo *
tari__rpc__pow_algo__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__PowAlgo *)
protobuf_c_message_unpack (&tari__rpc__pow_algo__descriptor,
allocator, len, data);
}
void tari__rpc__pow_algo__free_unpacked
(Tari__Rpc__PowAlgo *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__pow_algo__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__block__init
(Tari__Rpc__Block *message)
{
static const Tari__Rpc__Block init_value = TARI__RPC__BLOCK__INIT;
*message = init_value;
}
size_t tari__rpc__block__get_packed_size
(const Tari__Rpc__Block *message)
{
assert(message->base.descriptor == &tari__rpc__block__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__block__pack
(const Tari__Rpc__Block *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__block__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__block__pack_to_buffer
(const Tari__Rpc__Block *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__block__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__Block *
tari__rpc__block__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__Block *)
protobuf_c_message_unpack (&tari__rpc__block__descriptor,
allocator, len, data);
}
void tari__rpc__block__free_unpacked
(Tari__Rpc__Block *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__block__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__historical_block__init
(Tari__Rpc__HistoricalBlock *message)
{
static const Tari__Rpc__HistoricalBlock init_value = TARI__RPC__HISTORICAL_BLOCK__INIT;
*message = init_value;
}
size_t tari__rpc__historical_block__get_packed_size
(const Tari__Rpc__HistoricalBlock *message)
{
assert(message->base.descriptor == &tari__rpc__historical_block__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__historical_block__pack
(const Tari__Rpc__HistoricalBlock *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__historical_block__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__historical_block__pack_to_buffer
(const Tari__Rpc__HistoricalBlock *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__historical_block__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__HistoricalBlock *
tari__rpc__historical_block__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__HistoricalBlock *)
protobuf_c_message_unpack (&tari__rpc__historical_block__descriptor,
allocator, len, data);
}
void tari__rpc__historical_block__free_unpacked
(Tari__Rpc__HistoricalBlock *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__historical_block__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__new_block_header_template__init
(Tari__Rpc__NewBlockHeaderTemplate *message)
{
static const Tari__Rpc__NewBlockHeaderTemplate init_value = TARI__RPC__NEW_BLOCK_HEADER_TEMPLATE__INIT;
*message = init_value;
}
size_t tari__rpc__new_block_header_template__get_packed_size
(const Tari__Rpc__NewBlockHeaderTemplate *message)
{
assert(message->base.descriptor == &tari__rpc__new_block_header_template__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__new_block_header_template__pack
(const Tari__Rpc__NewBlockHeaderTemplate *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__new_block_header_template__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__new_block_header_template__pack_to_buffer
(const Tari__Rpc__NewBlockHeaderTemplate *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__new_block_header_template__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__NewBlockHeaderTemplate *
tari__rpc__new_block_header_template__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__NewBlockHeaderTemplate *)
protobuf_c_message_unpack (&tari__rpc__new_block_header_template__descriptor,
allocator, len, data);
}
void tari__rpc__new_block_header_template__free_unpacked
(Tari__Rpc__NewBlockHeaderTemplate *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__new_block_header_template__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__new_block_template__init
(Tari__Rpc__NewBlockTemplate *message)
{
static const Tari__Rpc__NewBlockTemplate init_value = TARI__RPC__NEW_BLOCK_TEMPLATE__INIT;
*message = init_value;
}
size_t tari__rpc__new_block_template__get_packed_size
(const Tari__Rpc__NewBlockTemplate *message)
{
assert(message->base.descriptor == &tari__rpc__new_block_template__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__new_block_template__pack
(const Tari__Rpc__NewBlockTemplate *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__new_block_template__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__new_block_template__pack_to_buffer
(const Tari__Rpc__NewBlockTemplate *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__new_block_template__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__NewBlockTemplate *
tari__rpc__new_block_template__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__NewBlockTemplate *)
protobuf_c_message_unpack (&tari__rpc__new_block_template__descriptor,
allocator, len, data);
}
void tari__rpc__new_block_template__free_unpacked
(Tari__Rpc__NewBlockTemplate *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__new_block_template__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
static const ProtobufCFieldDescriptor tari__rpc__block_header__field_descriptors[16] =
{
{
"hash",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BlockHeader, hash),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"version",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT32,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BlockHeader, version),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"height",
3,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT64,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BlockHeader, height),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"prev_hash",
4,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BlockHeader, prev_hash),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"timestamp",
5,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT64,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BlockHeader, timestamp),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"output_mr",
6,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BlockHeader, output_mr),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"kernel_mr",
8,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BlockHeader, kernel_mr),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"input_mr",
9,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BlockHeader, input_mr),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"total_kernel_offset",
10,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BlockHeader, total_kernel_offset),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"nonce",
11,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT64,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BlockHeader, nonce),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"pow",
12,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BlockHeader, pow),
&tari__rpc__proof_of_work__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"kernel_mmr_size",
13,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT64,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BlockHeader, kernel_mmr_size),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"output_mmr_size",
14,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT64,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BlockHeader, output_mmr_size),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"total_script_offset",
15,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BlockHeader, total_script_offset),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"validator_node_mr",
16,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BlockHeader, validator_node_mr),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"validator_node_size",
17,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT64,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BlockHeader, validator_node_size),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__block_header__field_indices_by_name[] = {
0, /* field[0] = hash */
2, /* field[2] = height */
7, /* field[7] = input_mr */
11, /* field[11] = kernel_mmr_size */
6, /* field[6] = kernel_mr */
9, /* field[9] = nonce */
12, /* field[12] = output_mmr_size */
5, /* field[5] = output_mr */
10, /* field[10] = pow */
3, /* field[3] = prev_hash */
4, /* field[4] = timestamp */
8, /* field[8] = total_kernel_offset */
13, /* field[13] = total_script_offset */
14, /* field[14] = validator_node_mr */
15, /* field[15] = validator_node_size */
1, /* field[1] = version */
};
static const ProtobufCIntRange tari__rpc__block_header__number_ranges[2 + 1] =
{
{ 1, 0 },
{ 8, 6 },
{ 0, 16 }
};
const ProtobufCMessageDescriptor tari__rpc__block_header__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.BlockHeader",
"BlockHeader",
"Tari__Rpc__BlockHeader",
"tari.rpc",
sizeof(Tari__Rpc__BlockHeader),
16,
tari__rpc__block_header__field_descriptors,
tari__rpc__block_header__field_indices_by_name,
2, tari__rpc__block_header__number_ranges,
(ProtobufCMessageInit) tari__rpc__block_header__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor tari__rpc__proof_of_work__field_descriptors[2] =
{
{
"pow_algo",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT64,
0, /* quantifier_offset */
offsetof(Tari__Rpc__ProofOfWork, pow_algo),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"pow_data",
4,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__ProofOfWork, pow_data),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__proof_of_work__field_indices_by_name[] = {
0, /* field[0] = pow_algo */
1, /* field[1] = pow_data */
};
static const ProtobufCIntRange tari__rpc__proof_of_work__number_ranges[2 + 1] =
{
{ 1, 0 },
{ 4, 1 },
{ 0, 2 }
};
const ProtobufCMessageDescriptor tari__rpc__proof_of_work__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.ProofOfWork",
"ProofOfWork",
"Tari__Rpc__ProofOfWork",
"tari.rpc",
sizeof(Tari__Rpc__ProofOfWork),
2,
tari__rpc__proof_of_work__field_descriptors,
tari__rpc__proof_of_work__field_indices_by_name,
2, tari__rpc__proof_of_work__number_ranges,
(ProtobufCMessageInit) tari__rpc__proof_of_work__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCEnumValue tari__rpc__pow_algo__pow_algos__enum_values_by_number[2] =
{
{ "POW_ALGOS_RANDOMX", "TARI__RPC__POW_ALGO__POW_ALGOS__POW_ALGOS_RANDOMX", 0 },
{ "POW_ALGOS_SHA3X", "TARI__RPC__POW_ALGO__POW_ALGOS__POW_ALGOS_SHA3X", 1 },
};
static const ProtobufCIntRange tari__rpc__pow_algo__pow_algos__value_ranges[] = {
{0, 0},{0, 2}
};
static const ProtobufCEnumValueIndex tari__rpc__pow_algo__pow_algos__enum_values_by_name[2] =
{
{ "POW_ALGOS_RANDOMX", 0 },
{ "POW_ALGOS_SHA3X", 1 },
};
const ProtobufCEnumDescriptor tari__rpc__pow_algo__pow_algos__descriptor =
{
PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
"tari.rpc.PowAlgo.PowAlgos",
"PowAlgos",
"Tari__Rpc__PowAlgo__PowAlgos",
"tari.rpc",
2,
tari__rpc__pow_algo__pow_algos__enum_values_by_number,
2,
tari__rpc__pow_algo__pow_algos__enum_values_by_name,
1,
tari__rpc__pow_algo__pow_algos__value_ranges,
NULL,NULL,NULL,NULL /* reserved[1234] */
};
static const ProtobufCFieldDescriptor tari__rpc__pow_algo__field_descriptors[1] =
{
{
"pow_algo",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_ENUM,
0, /* quantifier_offset */
offsetof(Tari__Rpc__PowAlgo, pow_algo),
&tari__rpc__pow_algo__pow_algos__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__pow_algo__field_indices_by_name[] = {
0, /* field[0] = pow_algo */
};
static const ProtobufCIntRange tari__rpc__pow_algo__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 1 }
};
const ProtobufCMessageDescriptor tari__rpc__pow_algo__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.PowAlgo",
"PowAlgo",
"Tari__Rpc__PowAlgo",
"tari.rpc",
sizeof(Tari__Rpc__PowAlgo),
1,
tari__rpc__pow_algo__field_descriptors,
tari__rpc__pow_algo__field_indices_by_name,
1, tari__rpc__pow_algo__number_ranges,
(ProtobufCMessageInit) tari__rpc__pow_algo__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor tari__rpc__block__field_descriptors[2] =
{
{
"header",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
0, /* quantifier_offset */
offsetof(Tari__Rpc__Block, header),
&tari__rpc__block_header__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"body",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
0, /* quantifier_offset */
offsetof(Tari__Rpc__Block, body),
&tari__rpc__aggregate_body__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__block__field_indices_by_name[] = {
1, /* field[1] = body */
0, /* field[0] = header */
};
static const ProtobufCIntRange tari__rpc__block__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 2 }
};
const ProtobufCMessageDescriptor tari__rpc__block__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.Block",
"Block",
"Tari__Rpc__Block",
"tari.rpc",
sizeof(Tari__Rpc__Block),
2,
tari__rpc__block__field_descriptors,
tari__rpc__block__field_indices_by_name,
1, tari__rpc__block__number_ranges,
(ProtobufCMessageInit) tari__rpc__block__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor tari__rpc__historical_block__field_descriptors[2] =
{
{
"confirmations",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT64,
0, /* quantifier_offset */
offsetof(Tari__Rpc__HistoricalBlock, confirmations),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"block",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
0, /* quantifier_offset */
offsetof(Tari__Rpc__HistoricalBlock, block),
&tari__rpc__block__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__historical_block__field_indices_by_name[] = {
1, /* field[1] = block */
0, /* field[0] = confirmations */
};
static const ProtobufCIntRange tari__rpc__historical_block__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 2 }
};
const ProtobufCMessageDescriptor tari__rpc__historical_block__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.HistoricalBlock",
"HistoricalBlock",
"Tari__Rpc__HistoricalBlock",
"tari.rpc",
sizeof(Tari__Rpc__HistoricalBlock),
2,
tari__rpc__historical_block__field_descriptors,
tari__rpc__historical_block__field_indices_by_name,
1, tari__rpc__historical_block__number_ranges,
(ProtobufCMessageInit) tari__rpc__historical_block__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor tari__rpc__new_block_header_template__field_descriptors[6] =
{
{
"version",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT32,
0, /* quantifier_offset */
offsetof(Tari__Rpc__NewBlockHeaderTemplate, version),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"height",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT64,
0, /* quantifier_offset */
offsetof(Tari__Rpc__NewBlockHeaderTemplate, height),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"prev_hash",
3,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__NewBlockHeaderTemplate, prev_hash),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"total_kernel_offset",
4,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__NewBlockHeaderTemplate, total_kernel_offset),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"pow",
5,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
0, /* quantifier_offset */
offsetof(Tari__Rpc__NewBlockHeaderTemplate, pow),
&tari__rpc__proof_of_work__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"total_script_offset",
7,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__NewBlockHeaderTemplate, total_script_offset),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__new_block_header_template__field_indices_by_name[] = {
1, /* field[1] = height */
4, /* field[4] = pow */
2, /* field[2] = prev_hash */
3, /* field[3] = total_kernel_offset */
5, /* field[5] = total_script_offset */
0, /* field[0] = version */
};
static const ProtobufCIntRange tari__rpc__new_block_header_template__number_ranges[2 + 1] =
{
{ 1, 0 },
{ 7, 5 },
{ 0, 6 }
};
const ProtobufCMessageDescriptor tari__rpc__new_block_header_template__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.NewBlockHeaderTemplate",
"NewBlockHeaderTemplate",
"Tari__Rpc__NewBlockHeaderTemplate",
"tari.rpc",
sizeof(Tari__Rpc__NewBlockHeaderTemplate),
6,
tari__rpc__new_block_header_template__field_descriptors,
tari__rpc__new_block_header_template__field_indices_by_name,
2, tari__rpc__new_block_header_template__number_ranges,
(ProtobufCMessageInit) tari__rpc__new_block_header_template__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor tari__rpc__new_block_template__field_descriptors[2] =
{
{
"header",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
0, /* quantifier_offset */
offsetof(Tari__Rpc__NewBlockTemplate, header),
&tari__rpc__new_block_header_template__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"body",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
0, /* quantifier_offset */
offsetof(Tari__Rpc__NewBlockTemplate, body),
&tari__rpc__aggregate_body__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__new_block_template__field_indices_by_name[] = {
1, /* field[1] = body */
0, /* field[0] = header */
};
static const ProtobufCIntRange tari__rpc__new_block_template__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 2 }
};
const ProtobufCMessageDescriptor tari__rpc__new_block_template__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.NewBlockTemplate",
"NewBlockTemplate",
"Tari__Rpc__NewBlockTemplate",
"tari.rpc",
sizeof(Tari__Rpc__NewBlockTemplate),
2,
tari__rpc__new_block_template__field_descriptors,
tari__rpc__new_block_template__field_indices_by_name,
1, tari__rpc__new_block_template__number_ranges,
(ProtobufCMessageInit) tari__rpc__new_block_template__init,
NULL,NULL,NULL /* reserved[123] */
};

View file

@ -1,442 +0,0 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: block.proto */
#ifndef PROTOBUF_C_block_2eproto__INCLUDED
#define PROTOBUF_C_block_2eproto__INCLUDED
#include <protobuf-c/protobuf-c.h>
PROTOBUF_C__BEGIN_DECLS
#if PROTOBUF_C_VERSION_NUMBER < 1003000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1003003 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif
#include "transaction.pb-c.h"
typedef struct _Tari__Rpc__BlockHeader Tari__Rpc__BlockHeader;
typedef struct _Tari__Rpc__ProofOfWork Tari__Rpc__ProofOfWork;
typedef struct _Tari__Rpc__PowAlgo Tari__Rpc__PowAlgo;
typedef struct _Tari__Rpc__Block Tari__Rpc__Block;
typedef struct _Tari__Rpc__HistoricalBlock Tari__Rpc__HistoricalBlock;
typedef struct _Tari__Rpc__NewBlockHeaderTemplate Tari__Rpc__NewBlockHeaderTemplate;
typedef struct _Tari__Rpc__NewBlockTemplate Tari__Rpc__NewBlockTemplate;
/* --- enums --- */
/*
* The permitted pow algorithms
*/
typedef enum _Tari__Rpc__PowAlgo__PowAlgos {
/*
* Accessible as `grpc::pow_algo::PowAlgos::Randomx`
*/
TARI__RPC__POW_ALGO__POW_ALGOS__POW_ALGOS_RANDOMX = 0,
/*
* Accessible as `grpc::pow_algo::PowAlgos::Sha3x`
*/
TARI__RPC__POW_ALGO__POW_ALGOS__POW_ALGOS_SHA3X = 1
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(TARI__RPC__POW_ALGO__POW_ALGOS)
} Tari__Rpc__PowAlgo__PowAlgos;
/* --- messages --- */
/*
* The BlockHeader contains all the metadata for the block, including proof of work, a link to the previous block
* and the transaction kernels.
*/
struct _Tari__Rpc__BlockHeader
{
ProtobufCMessage base;
/*
* The hash of the block
*/
ProtobufCBinaryData hash;
/*
* Version of the block
*/
uint32_t version;
/*
* Height of this block since the genesis block (height 0)
*/
uint64_t height;
/*
* Hash of the block previous to this in the chain.
*/
ProtobufCBinaryData prev_hash;
/*
* Timestamp at which the block was built.
*/
uint64_t timestamp;
/*
* This is the UTXO merkle root of the outputs
* This is calculated as Hash (txo MMR root || roaring bitmap hash of UTXO indices)
*/
ProtobufCBinaryData output_mr;
/*
* This is the MMR root of the kernels
*/
ProtobufCBinaryData kernel_mr;
/*
* This is the Merkle root of the inputs in this block
*/
ProtobufCBinaryData input_mr;
/*
* Total accumulated sum of kernel offsets since genesis block. We can derive the kernel offset sum for *this*
* block from the total kernel offset of the previous block header.
*/
ProtobufCBinaryData total_kernel_offset;
/*
* Nonce increment used to mine this block.
*/
uint64_t nonce;
/*
* Proof of work metadata
*/
Tari__Rpc__ProofOfWork *pow;
/*
* Kernel MMR size
*/
uint64_t kernel_mmr_size;
/*
* Output MMR size
*/
uint64_t output_mmr_size;
/*
* Sum of script offsets for all kernels in this block.
*/
ProtobufCBinaryData total_script_offset;
/*
* Merkle root of validator nodes
*/
ProtobufCBinaryData validator_node_mr;
/*
* Validator size
*/
uint64_t validator_node_size;
};
#define TARI__RPC__BLOCK_HEADER__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__block_header__descriptor) \
, {0,NULL}, 0, 0, {0,NULL}, 0, {0,NULL}, {0,NULL}, {0,NULL}, {0,NULL}, 0, NULL, 0, 0, {0,NULL}, {0,NULL}, 0 }
/*
* The proof of work data structure that is included in the block header.
*/
struct _Tari__Rpc__ProofOfWork
{
ProtobufCMessage base;
/*
* The algorithm used to mine this block
* 0 = Monero
* 1 = Sha3X
*/
uint64_t pow_algo;
/*
* Supplemental proof of work data. For example for Sha3x, this would be empty (only the block header is
* required), but for Monero merge mining we need the Monero block header and RandomX seed hash.
*/
ProtobufCBinaryData pow_data;
};
#define TARI__RPC__PROOF_OF_WORK__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__proof_of_work__descriptor) \
, 0, {0,NULL} }
/*
*This is used to request the which pow algo should be used with the block template
*/
struct _Tari__Rpc__PowAlgo
{
ProtobufCMessage base;
/*
* The pow algo to use
*/
Tari__Rpc__PowAlgo__PowAlgos pow_algo;
};
#define TARI__RPC__POW_ALGO__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__pow_algo__descriptor) \
, TARI__RPC__POW_ALGO__POW_ALGOS__POW_ALGOS_RANDOMX }
/*
* A Minotari block. Blocks are linked together into a blockchain.
*/
struct _Tari__Rpc__Block
{
ProtobufCMessage base;
/*
* The BlockHeader contains all the metadata for the block, including proof of work, a link to the previous block
* and the transaction kernels.
*/
Tari__Rpc__BlockHeader *header;
/*
* The components of the block or transaction. The same struct can be used for either, since in Mimblewimble,
* blocks consist of inputs, outputs and kernels, rather than transactions.
*/
Tari__Rpc__AggregateBody *body;
};
#define TARI__RPC__BLOCK__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__block__descriptor) \
, NULL, NULL }
/*
* The representation of a historical block in the blockchain. It is essentially identical to a protocol-defined
* block but contains some extra metadata that clients such as Block Explorers will find interesting.
*/
struct _Tari__Rpc__HistoricalBlock
{
ProtobufCMessage base;
/*
* The number of blocks that have been mined since this block, including this one. The current tip will have one
* confirmation.
*/
uint64_t confirmations;
/*
* The underlying block
*/
Tari__Rpc__Block *block;
};
#define TARI__RPC__HISTORICAL_BLOCK__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__historical_block__descriptor) \
, 0, NULL }
/*
* The NewBlockHeaderTemplate is used for the construction of a new mine-able block. It contains all the metadata for the block that the Base Node is able to complete on behalf of a Miner.
*/
struct _Tari__Rpc__NewBlockHeaderTemplate
{
ProtobufCMessage base;
/*
* Version of the block
*/
uint32_t version;
/*
* Height of this block since the genesis block (height 0)
*/
uint64_t height;
/*
* Hash of the block previous to this in the chain.
*/
ProtobufCBinaryData prev_hash;
/*
* Total accumulated sum of kernel offsets since genesis block. We can derive the kernel offset sum for *this*
* block from the total kernel offset of the previous block header.
*/
ProtobufCBinaryData total_kernel_offset;
/*
* Proof of work metadata
*/
Tari__Rpc__ProofOfWork *pow;
/*
* Sum of script offsets for all kernels in this block.
*/
ProtobufCBinaryData total_script_offset;
};
#define TARI__RPC__NEW_BLOCK_HEADER_TEMPLATE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__new_block_header_template__descriptor) \
, 0, 0, {0,NULL}, {0,NULL}, NULL, {0,NULL} }
/*
* The new block template is used constructing a new partial block, allowing a miner to added the coinbase utxo and as a final step the Base node to add the MMR roots to the header.
*/
struct _Tari__Rpc__NewBlockTemplate
{
ProtobufCMessage base;
/*
* The NewBlockHeaderTemplate is used for the construction of a new mineable block. It contains all the metadata for
* the block that the Base Node is able to complete on behalf of a Miner.
*/
Tari__Rpc__NewBlockHeaderTemplate *header;
/*
* This flag indicates if the inputs, outputs and kernels have been sorted internally, that is, the sort() method
* has been called. This may be false even if all components are sorted.
*/
Tari__Rpc__AggregateBody *body;
};
#define TARI__RPC__NEW_BLOCK_TEMPLATE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__new_block_template__descriptor) \
, NULL, NULL }
/* Tari__Rpc__BlockHeader methods */
void tari__rpc__block_header__init
(Tari__Rpc__BlockHeader *message);
size_t tari__rpc__block_header__get_packed_size
(const Tari__Rpc__BlockHeader *message);
size_t tari__rpc__block_header__pack
(const Tari__Rpc__BlockHeader *message,
uint8_t *out);
size_t tari__rpc__block_header__pack_to_buffer
(const Tari__Rpc__BlockHeader *message,
ProtobufCBuffer *buffer);
Tari__Rpc__BlockHeader *
tari__rpc__block_header__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__block_header__free_unpacked
(Tari__Rpc__BlockHeader *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__ProofOfWork methods */
void tari__rpc__proof_of_work__init
(Tari__Rpc__ProofOfWork *message);
size_t tari__rpc__proof_of_work__get_packed_size
(const Tari__Rpc__ProofOfWork *message);
size_t tari__rpc__proof_of_work__pack
(const Tari__Rpc__ProofOfWork *message,
uint8_t *out);
size_t tari__rpc__proof_of_work__pack_to_buffer
(const Tari__Rpc__ProofOfWork *message,
ProtobufCBuffer *buffer);
Tari__Rpc__ProofOfWork *
tari__rpc__proof_of_work__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__proof_of_work__free_unpacked
(Tari__Rpc__ProofOfWork *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__PowAlgo methods */
void tari__rpc__pow_algo__init
(Tari__Rpc__PowAlgo *message);
size_t tari__rpc__pow_algo__get_packed_size
(const Tari__Rpc__PowAlgo *message);
size_t tari__rpc__pow_algo__pack
(const Tari__Rpc__PowAlgo *message,
uint8_t *out);
size_t tari__rpc__pow_algo__pack_to_buffer
(const Tari__Rpc__PowAlgo *message,
ProtobufCBuffer *buffer);
Tari__Rpc__PowAlgo *
tari__rpc__pow_algo__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__pow_algo__free_unpacked
(Tari__Rpc__PowAlgo *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__Block methods */
void tari__rpc__block__init
(Tari__Rpc__Block *message);
size_t tari__rpc__block__get_packed_size
(const Tari__Rpc__Block *message);
size_t tari__rpc__block__pack
(const Tari__Rpc__Block *message,
uint8_t *out);
size_t tari__rpc__block__pack_to_buffer
(const Tari__Rpc__Block *message,
ProtobufCBuffer *buffer);
Tari__Rpc__Block *
tari__rpc__block__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__block__free_unpacked
(Tari__Rpc__Block *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__HistoricalBlock methods */
void tari__rpc__historical_block__init
(Tari__Rpc__HistoricalBlock *message);
size_t tari__rpc__historical_block__get_packed_size
(const Tari__Rpc__HistoricalBlock *message);
size_t tari__rpc__historical_block__pack
(const Tari__Rpc__HistoricalBlock *message,
uint8_t *out);
size_t tari__rpc__historical_block__pack_to_buffer
(const Tari__Rpc__HistoricalBlock *message,
ProtobufCBuffer *buffer);
Tari__Rpc__HistoricalBlock *
tari__rpc__historical_block__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__historical_block__free_unpacked
(Tari__Rpc__HistoricalBlock *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__NewBlockHeaderTemplate methods */
void tari__rpc__new_block_header_template__init
(Tari__Rpc__NewBlockHeaderTemplate *message);
size_t tari__rpc__new_block_header_template__get_packed_size
(const Tari__Rpc__NewBlockHeaderTemplate *message);
size_t tari__rpc__new_block_header_template__pack
(const Tari__Rpc__NewBlockHeaderTemplate *message,
uint8_t *out);
size_t tari__rpc__new_block_header_template__pack_to_buffer
(const Tari__Rpc__NewBlockHeaderTemplate *message,
ProtobufCBuffer *buffer);
Tari__Rpc__NewBlockHeaderTemplate *
tari__rpc__new_block_header_template__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__new_block_header_template__free_unpacked
(Tari__Rpc__NewBlockHeaderTemplate *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__NewBlockTemplate methods */
void tari__rpc__new_block_template__init
(Tari__Rpc__NewBlockTemplate *message);
size_t tari__rpc__new_block_template__get_packed_size
(const Tari__Rpc__NewBlockTemplate *message);
size_t tari__rpc__new_block_template__pack
(const Tari__Rpc__NewBlockTemplate *message,
uint8_t *out);
size_t tari__rpc__new_block_template__pack_to_buffer
(const Tari__Rpc__NewBlockTemplate *message,
ProtobufCBuffer *buffer);
Tari__Rpc__NewBlockTemplate *
tari__rpc__new_block_template__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__new_block_template__free_unpacked
(Tari__Rpc__NewBlockTemplate *message,
ProtobufCAllocator *allocator);
/* --- per-message closures --- */
typedef void (*Tari__Rpc__BlockHeader_Closure)
(const Tari__Rpc__BlockHeader *message,
void *closure_data);
typedef void (*Tari__Rpc__ProofOfWork_Closure)
(const Tari__Rpc__ProofOfWork *message,
void *closure_data);
typedef void (*Tari__Rpc__PowAlgo_Closure)
(const Tari__Rpc__PowAlgo *message,
void *closure_data);
typedef void (*Tari__Rpc__Block_Closure)
(const Tari__Rpc__Block *message,
void *closure_data);
typedef void (*Tari__Rpc__HistoricalBlock_Closure)
(const Tari__Rpc__HistoricalBlock *message,
void *closure_data);
typedef void (*Tari__Rpc__NewBlockHeaderTemplate_Closure)
(const Tari__Rpc__NewBlockHeaderTemplate *message,
void *closure_data);
typedef void (*Tari__Rpc__NewBlockTemplate_Closure)
(const Tari__Rpc__NewBlockTemplate *message,
void *closure_data);
/* --- services --- */
/* --- descriptors --- */
extern const ProtobufCMessageDescriptor tari__rpc__block_header__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__proof_of_work__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__pow_algo__descriptor;
extern const ProtobufCEnumDescriptor tari__rpc__pow_algo__pow_algos__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__block__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__historical_block__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__new_block_header_template__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__new_block_template__descriptor;
PROTOBUF_C__END_DECLS
#endif /* PROTOBUF_C_block_2eproto__INCLUDED */

2567
external/src/Tari/proto/gRPC/block.pb.cc vendored Normal file

File diff suppressed because it is too large Load diff

3416
external/src/Tari/proto/gRPC/block.pb.h vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -1,105 +0,0 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: timestamp.proto */
/* Do not generate deprecated warnings for self */
#ifndef PROTOBUF_C__NO_DEPRECATED
#define PROTOBUF_C__NO_DEPRECATED
#endif
#include "timestamp.pb-c.h"
void google__protobuf__timestamp__init
(Google__Protobuf__Timestamp *message)
{
static const Google__Protobuf__Timestamp init_value = GOOGLE__PROTOBUF__TIMESTAMP__INIT;
*message = init_value;
}
size_t google__protobuf__timestamp__get_packed_size
(const Google__Protobuf__Timestamp *message)
{
assert(message->base.descriptor == &google__protobuf__timestamp__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t google__protobuf__timestamp__pack
(const Google__Protobuf__Timestamp *message,
uint8_t *out)
{
assert(message->base.descriptor == &google__protobuf__timestamp__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t google__protobuf__timestamp__pack_to_buffer
(const Google__Protobuf__Timestamp *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &google__protobuf__timestamp__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Google__Protobuf__Timestamp *
google__protobuf__timestamp__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Google__Protobuf__Timestamp *)
protobuf_c_message_unpack (&google__protobuf__timestamp__descriptor,
allocator, len, data);
}
void google__protobuf__timestamp__free_unpacked
(Google__Protobuf__Timestamp *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &google__protobuf__timestamp__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
static const ProtobufCFieldDescriptor google__protobuf__timestamp__field_descriptors[2] =
{
{
"seconds",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_INT64,
0, /* quantifier_offset */
offsetof(Google__Protobuf__Timestamp, seconds),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"nanos",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_INT32,
0, /* quantifier_offset */
offsetof(Google__Protobuf__Timestamp, nanos),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned google__protobuf__timestamp__field_indices_by_name[] = {
1, /* field[1] = nanos */
0, /* field[0] = seconds */
};
static const ProtobufCIntRange google__protobuf__timestamp__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 2 }
};
const ProtobufCMessageDescriptor google__protobuf__timestamp__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"google.protobuf.Timestamp",
"Timestamp",
"Google__Protobuf__Timestamp",
"google.protobuf",
sizeof(Google__Protobuf__Timestamp),
2,
google__protobuf__timestamp__field_descriptors,
google__protobuf__timestamp__field_indices_by_name,
1, google__protobuf__timestamp__number_ranges,
(ProtobufCMessageInit) google__protobuf__timestamp__init,
NULL,NULL,NULL /* reserved[123] */
};

View file

@ -1,151 +0,0 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: timestamp.proto */
#ifndef PROTOBUF_C_timestamp_2eproto__INCLUDED
#define PROTOBUF_C_timestamp_2eproto__INCLUDED
#include <protobuf-c/protobuf-c.h>
PROTOBUF_C__BEGIN_DECLS
#if PROTOBUF_C_VERSION_NUMBER < 1003000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1003003 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif
typedef struct _Google__Protobuf__Timestamp Google__Protobuf__Timestamp;
/* --- enums --- */
/* --- messages --- */
/*
* A Timestamp represents a point in time independent of any time zone or local
* calendar, encoded as a count of seconds and fractions of seconds at
* nanosecond resolution. The count is relative to an epoch at UTC midnight on
* January 1, 1970, in the proleptic Gregorian calendar which extends the
* Gregorian calendar backwards to year one.
* All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
* second table is needed for interpretation, using a [24-hour linear
* smear](https://developers.google.com/time/smear).
* The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
* restricting to that range, we ensure that we can convert to and from [RFC
* 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
* # Examples
* Example 1: Compute Timestamp from POSIX `time()`.
* Timestamp timestamp;
* timestamp.set_seconds(time(NULL));
* timestamp.set_nanos(0);
* Example 2: Compute Timestamp from POSIX `gettimeofday()`.
* struct timeval tv;
* gettimeofday(&tv, NULL);
* Timestamp timestamp;
* timestamp.set_seconds(tv.tv_sec);
* timestamp.set_nanos(tv.tv_usec * 1000);
* Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
* FILETIME ft;
* GetSystemTimeAsFileTime(&ft);
* UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
* // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
* // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
* Timestamp timestamp;
* timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
* timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
* Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
* long millis = System.currentTimeMillis();
* Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
* .setNanos((int) ((millis % 1000) * 1000000)).build();
* Example 5: Compute Timestamp from Java `Instant.now()`.
* Instant now = Instant.now();
* Timestamp timestamp =
* Timestamp.newBuilder().setSeconds(now.getEpochSecond())
* .setNanos(now.getNano()).build();
* Example 6: Compute Timestamp from current time in Python.
* timestamp = Timestamp()
* timestamp.GetCurrentTime()
* # JSON Mapping
* In JSON format, the Timestamp type is encoded as a string in the
* [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
* format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
* where {year} is always expressed using four digits while {month}, {day},
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
* is required. A proto3 JSON serializer should always use UTC (as indicated by
* "Z") when printing the Timestamp type and a proto3 JSON parser should be
* able to accept both UTC and other timezones (as indicated by an offset).
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
* 01:30 UTC on January 15, 2017.
* In JavaScript, one can convert a Date object to this format using the
* standard
* [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
* method. In Python, a standard `datetime.datetime` object can be converted
* to this format using
* [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
* the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
* the Joda Time's [`ISODateTimeFormat.dateTime()`](
* http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
* ) to obtain a formatter capable of generating timestamps in this format.
*/
struct _Google__Protobuf__Timestamp
{
ProtobufCMessage base;
/*
* Represents seconds of UTC time since Unix epoch
* 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
* 9999-12-31T23:59:59Z inclusive.
*/
int64_t seconds;
/*
* Non-negative fractions of a second at nanosecond resolution. Negative
* second values with fractions must still have non-negative nanos values
* that count forward in time. Must be from 0 to 999,999,999
* inclusive.
*/
int32_t nanos;
};
#define GOOGLE__PROTOBUF__TIMESTAMP__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&google__protobuf__timestamp__descriptor) \
, 0, 0 }
/* Google__Protobuf__Timestamp methods */
void google__protobuf__timestamp__init
(Google__Protobuf__Timestamp *message);
size_t google__protobuf__timestamp__get_packed_size
(const Google__Protobuf__Timestamp *message);
size_t google__protobuf__timestamp__pack
(const Google__Protobuf__Timestamp *message,
uint8_t *out);
size_t google__protobuf__timestamp__pack_to_buffer
(const Google__Protobuf__Timestamp *message,
ProtobufCBuffer *buffer);
Google__Protobuf__Timestamp *
google__protobuf__timestamp__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void google__protobuf__timestamp__free_unpacked
(Google__Protobuf__Timestamp *message,
ProtobufCAllocator *allocator);
/* --- per-message closures --- */
typedef void (*Google__Protobuf__Timestamp_Closure)
(const Google__Protobuf__Timestamp *message,
void *closure_data);
/* --- services --- */
/* --- descriptors --- */
extern const ProtobufCMessageDescriptor google__protobuf__timestamp__descriptor;
PROTOBUF_C__END_DECLS
#endif /* PROTOBUF_C_timestamp_2eproto__INCLUDED */

View file

@ -1,144 +0,0 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto3";
package google.protobuf;
option cc_enable_arenas = true;
option go_package = "google.golang.org/protobuf/types/known/timestamppb";
option java_package = "com.google.protobuf";
option java_outer_classname = "TimestampProto";
option java_multiple_files = true;
option objc_class_prefix = "GPB";
option csharp_namespace = "Google.Protobuf.WellKnownTypes";
// A Timestamp represents a point in time independent of any time zone or local
// calendar, encoded as a count of seconds and fractions of seconds at
// nanosecond resolution. The count is relative to an epoch at UTC midnight on
// January 1, 1970, in the proleptic Gregorian calendar which extends the
// Gregorian calendar backwards to year one.
//
// All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
// second table is needed for interpretation, using a [24-hour linear
// smear](https://developers.google.com/time/smear).
//
// The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
// restricting to that range, we ensure that we can convert to and from [RFC
// 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
//
// # Examples
//
// Example 1: Compute Timestamp from POSIX `time()`.
//
// Timestamp timestamp;
// timestamp.set_seconds(time(NULL));
// timestamp.set_nanos(0);
//
// Example 2: Compute Timestamp from POSIX `gettimeofday()`.
//
// struct timeval tv;
// gettimeofday(&tv, NULL);
//
// Timestamp timestamp;
// timestamp.set_seconds(tv.tv_sec);
// timestamp.set_nanos(tv.tv_usec * 1000);
//
// Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
//
// FILETIME ft;
// GetSystemTimeAsFileTime(&ft);
// UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
//
// // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
// // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
// Timestamp timestamp;
// timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
// timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
//
// Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
//
// long millis = System.currentTimeMillis();
//
// Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
// .setNanos((int) ((millis % 1000) * 1000000)).build();
//
// Example 5: Compute Timestamp from Java `Instant.now()`.
//
// Instant now = Instant.now();
//
// Timestamp timestamp =
// Timestamp.newBuilder().setSeconds(now.getEpochSecond())
// .setNanos(now.getNano()).build();
//
// Example 6: Compute Timestamp from current time in Python.
//
// timestamp = Timestamp()
// timestamp.GetCurrentTime()
//
// # JSON Mapping
//
// In JSON format, the Timestamp type is encoded as a string in the
// [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
// format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
// where {year} is always expressed using four digits while {month}, {day},
// {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
// seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
// are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
// is required. A proto3 JSON serializer should always use UTC (as indicated by
// "Z") when printing the Timestamp type and a proto3 JSON parser should be
// able to accept both UTC and other timezones (as indicated by an offset).
//
// For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
// 01:30 UTC on January 15, 2017.
//
// In JavaScript, one can convert a Date object to this format using the
// standard
// [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
// method. In Python, a standard `datetime.datetime` object can be converted
// to this format using
// [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
// the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
// the Joda Time's [`ISODateTimeFormat.dateTime()`](
// http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
// ) to obtain a formatter capable of generating timestamps in this format.
//
message Timestamp {
// Represents seconds of UTC time since Unix epoch
// 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
// 9999-12-31T23:59:59Z inclusive.
int64 seconds = 1;
// Non-negative fractions of a second at nanosecond resolution. Negative
// second values with fractions must still have non-negative nanos values
// that count forward in time. Must be from 0 to 999,999,999
// inclusive.
int32 nanos = 2;
}

View file

@ -0,0 +1,27 @@
// Generated by the gRPC C++ plugin.
// If you make any local change, they will be lost.
// source: network.proto
#include "network.pb.h"
#include "network.grpc.pb.h"
#include <functional>
#include <grpcpp/support/async_stream.h>
#include <grpcpp/support/async_unary_call.h>
#include <grpcpp/impl/channel_interface.h>
#include <grpcpp/impl/client_unary_call.h>
#include <grpcpp/support/client_callback.h>
#include <grpcpp/support/message_allocator.h>
#include <grpcpp/support/method_handler.h>
#include <grpcpp/impl/rpc_service_method.h>
#include <grpcpp/support/server_callback.h>
#include <grpcpp/impl/server_callback_handlers.h>
#include <grpcpp/server_context.h>
#include <grpcpp/impl/service_type.h>
#include <grpcpp/support/sync_stream.h>
namespace tari {
namespace rpc {
} // namespace tari
} // namespace rpc

View file

@ -0,0 +1,57 @@
// Generated by the gRPC C++ plugin.
// If you make any local change, they will be lost.
// source: network.proto
// Original file comments:
// Copyright 2020. The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
// following disclaimer in the documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
// products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef GRPC_network_2eproto__INCLUDED
#define GRPC_network_2eproto__INCLUDED
#include "network.pb.h"
#include <functional>
#include <grpcpp/generic/async_generic_service.h>
#include <grpcpp/support/async_stream.h>
#include <grpcpp/support/async_unary_call.h>
#include <grpcpp/support/client_callback.h>
#include <grpcpp/client_context.h>
#include <grpcpp/completion_queue.h>
#include <grpcpp/support/message_allocator.h>
#include <grpcpp/support/method_handler.h>
#include <grpcpp/impl/proto_utils.h>
#include <grpcpp/impl/rpc_method.h>
#include <grpcpp/support/server_callback.h>
#include <grpcpp/impl/server_callback_handlers.h>
#include <grpcpp/server_context.h>
#include <grpcpp/impl/service_type.h>
#include <grpcpp/support/status.h>
#include <grpcpp/support/stub_options.h>
#include <grpcpp/support/sync_stream.h>
namespace tari {
namespace rpc {
} // namespace rpc
} // namespace tari
#endif // GRPC_network_2eproto__INCLUDED

View file

@ -1,973 +0,0 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: network.proto */
/* Do not generate deprecated warnings for self */
#ifndef PROTOBUF_C__NO_DEPRECATED
#define PROTOBUF_C__NO_DEPRECATED
#endif
#include "network.pb-c.h"
void tari__rpc__node_identity__init
(Tari__Rpc__NodeIdentity *message)
{
static const Tari__Rpc__NodeIdentity init_value = TARI__RPC__NODE_IDENTITY__INIT;
*message = init_value;
}
size_t tari__rpc__node_identity__get_packed_size
(const Tari__Rpc__NodeIdentity *message)
{
assert(message->base.descriptor == &tari__rpc__node_identity__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__node_identity__pack
(const Tari__Rpc__NodeIdentity *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__node_identity__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__node_identity__pack_to_buffer
(const Tari__Rpc__NodeIdentity *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__node_identity__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__NodeIdentity *
tari__rpc__node_identity__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__NodeIdentity *)
protobuf_c_message_unpack (&tari__rpc__node_identity__descriptor,
allocator, len, data);
}
void tari__rpc__node_identity__free_unpacked
(Tari__Rpc__NodeIdentity *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__node_identity__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__peer__init
(Tari__Rpc__Peer *message)
{
static const Tari__Rpc__Peer init_value = TARI__RPC__PEER__INIT;
*message = init_value;
}
size_t tari__rpc__peer__get_packed_size
(const Tari__Rpc__Peer *message)
{
assert(message->base.descriptor == &tari__rpc__peer__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__peer__pack
(const Tari__Rpc__Peer *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__peer__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__peer__pack_to_buffer
(const Tari__Rpc__Peer *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__peer__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__Peer *
tari__rpc__peer__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__Peer *)
protobuf_c_message_unpack (&tari__rpc__peer__descriptor,
allocator, len, data);
}
void tari__rpc__peer__free_unpacked
(Tari__Rpc__Peer *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__peer__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__network_status_response__init
(Tari__Rpc__NetworkStatusResponse *message)
{
static const Tari__Rpc__NetworkStatusResponse init_value = TARI__RPC__NETWORK_STATUS_RESPONSE__INIT;
*message = init_value;
}
size_t tari__rpc__network_status_response__get_packed_size
(const Tari__Rpc__NetworkStatusResponse *message)
{
assert(message->base.descriptor == &tari__rpc__network_status_response__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__network_status_response__pack
(const Tari__Rpc__NetworkStatusResponse *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__network_status_response__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__network_status_response__pack_to_buffer
(const Tari__Rpc__NetworkStatusResponse *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__network_status_response__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__NetworkStatusResponse *
tari__rpc__network_status_response__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__NetworkStatusResponse *)
protobuf_c_message_unpack (&tari__rpc__network_status_response__descriptor,
allocator, len, data);
}
void tari__rpc__network_status_response__free_unpacked
(Tari__Rpc__NetworkStatusResponse *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__network_status_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__address__init
(Tari__Rpc__Address *message)
{
static const Tari__Rpc__Address init_value = TARI__RPC__ADDRESS__INIT;
*message = init_value;
}
size_t tari__rpc__address__get_packed_size
(const Tari__Rpc__Address *message)
{
assert(message->base.descriptor == &tari__rpc__address__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__address__pack
(const Tari__Rpc__Address *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__address__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__address__pack_to_buffer
(const Tari__Rpc__Address *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__address__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__Address *
tari__rpc__address__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__Address *)
protobuf_c_message_unpack (&tari__rpc__address__descriptor,
allocator, len, data);
}
void tari__rpc__address__free_unpacked
(Tari__Rpc__Address *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__address__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__list_connected_peers_response__init
(Tari__Rpc__ListConnectedPeersResponse *message)
{
static const Tari__Rpc__ListConnectedPeersResponse init_value = TARI__RPC__LIST_CONNECTED_PEERS_RESPONSE__INIT;
*message = init_value;
}
size_t tari__rpc__list_connected_peers_response__get_packed_size
(const Tari__Rpc__ListConnectedPeersResponse *message)
{
assert(message->base.descriptor == &tari__rpc__list_connected_peers_response__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__list_connected_peers_response__pack
(const Tari__Rpc__ListConnectedPeersResponse *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__list_connected_peers_response__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__list_connected_peers_response__pack_to_buffer
(const Tari__Rpc__ListConnectedPeersResponse *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__list_connected_peers_response__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__ListConnectedPeersResponse *
tari__rpc__list_connected_peers_response__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__ListConnectedPeersResponse *)
protobuf_c_message_unpack (&tari__rpc__list_connected_peers_response__descriptor,
allocator, len, data);
}
void tari__rpc__list_connected_peers_response__free_unpacked
(Tari__Rpc__ListConnectedPeersResponse *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__list_connected_peers_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__software_update__init
(Tari__Rpc__SoftwareUpdate *message)
{
static const Tari__Rpc__SoftwareUpdate init_value = TARI__RPC__SOFTWARE_UPDATE__INIT;
*message = init_value;
}
size_t tari__rpc__software_update__get_packed_size
(const Tari__Rpc__SoftwareUpdate *message)
{
assert(message->base.descriptor == &tari__rpc__software_update__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__software_update__pack
(const Tari__Rpc__SoftwareUpdate *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__software_update__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__software_update__pack_to_buffer
(const Tari__Rpc__SoftwareUpdate *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__software_update__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__SoftwareUpdate *
tari__rpc__software_update__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__SoftwareUpdate *)
protobuf_c_message_unpack (&tari__rpc__software_update__descriptor,
allocator, len, data);
}
void tari__rpc__software_update__free_unpacked
(Tari__Rpc__SoftwareUpdate *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__software_update__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__get_identity_request__init
(Tari__Rpc__GetIdentityRequest *message)
{
static const Tari__Rpc__GetIdentityRequest init_value = TARI__RPC__GET_IDENTITY_REQUEST__INIT;
*message = init_value;
}
size_t tari__rpc__get_identity_request__get_packed_size
(const Tari__Rpc__GetIdentityRequest *message)
{
assert(message->base.descriptor == &tari__rpc__get_identity_request__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__get_identity_request__pack
(const Tari__Rpc__GetIdentityRequest *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__get_identity_request__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__get_identity_request__pack_to_buffer
(const Tari__Rpc__GetIdentityRequest *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__get_identity_request__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__GetIdentityRequest *
tari__rpc__get_identity_request__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__GetIdentityRequest *)
protobuf_c_message_unpack (&tari__rpc__get_identity_request__descriptor,
allocator, len, data);
}
void tari__rpc__get_identity_request__free_unpacked
(Tari__Rpc__GetIdentityRequest *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__get_identity_request__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__get_identity_response__init
(Tari__Rpc__GetIdentityResponse *message)
{
static const Tari__Rpc__GetIdentityResponse init_value = TARI__RPC__GET_IDENTITY_RESPONSE__INIT;
*message = init_value;
}
size_t tari__rpc__get_identity_response__get_packed_size
(const Tari__Rpc__GetIdentityResponse *message)
{
assert(message->base.descriptor == &tari__rpc__get_identity_response__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__get_identity_response__pack
(const Tari__Rpc__GetIdentityResponse *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__get_identity_response__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__get_identity_response__pack_to_buffer
(const Tari__Rpc__GetIdentityResponse *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__get_identity_response__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__GetIdentityResponse *
tari__rpc__get_identity_response__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__GetIdentityResponse *)
protobuf_c_message_unpack (&tari__rpc__get_identity_response__descriptor,
allocator, len, data);
}
void tari__rpc__get_identity_response__free_unpacked
(Tari__Rpc__GetIdentityResponse *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__get_identity_response__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
static const ProtobufCFieldDescriptor tari__rpc__node_identity__field_descriptors[3] =
{
{
"public_key",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__NodeIdentity, public_key),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"public_addresses",
2,
PROTOBUF_C_LABEL_REPEATED,
PROTOBUF_C_TYPE_STRING,
offsetof(Tari__Rpc__NodeIdentity, n_public_addresses),
offsetof(Tari__Rpc__NodeIdentity, public_addresses),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"node_id",
3,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__NodeIdentity, node_id),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__node_identity__field_indices_by_name[] = {
2, /* field[2] = node_id */
1, /* field[1] = public_addresses */
0, /* field[0] = public_key */
};
static const ProtobufCIntRange tari__rpc__node_identity__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 3 }
};
const ProtobufCMessageDescriptor tari__rpc__node_identity__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.NodeIdentity",
"NodeIdentity",
"Tari__Rpc__NodeIdentity",
"tari.rpc",
sizeof(Tari__Rpc__NodeIdentity),
3,
tari__rpc__node_identity__field_descriptors,
tari__rpc__node_identity__field_indices_by_name,
1, tari__rpc__node_identity__number_ranges,
(ProtobufCMessageInit) tari__rpc__node_identity__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor tari__rpc__peer__field_descriptors[11] =
{
{
"public_key",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__Peer, public_key),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"node_id",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__Peer, node_id),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"addresses",
3,
PROTOBUF_C_LABEL_REPEATED,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(Tari__Rpc__Peer, n_addresses),
offsetof(Tari__Rpc__Peer, addresses),
&tari__rpc__address__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"last_connection",
4,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT64,
0, /* quantifier_offset */
offsetof(Tari__Rpc__Peer, last_connection),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"flags",
5,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT32,
0, /* quantifier_offset */
offsetof(Tari__Rpc__Peer, flags),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"banned_until",
6,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT64,
0, /* quantifier_offset */
offsetof(Tari__Rpc__Peer, banned_until),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"banned_reason",
7,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Tari__Rpc__Peer, banned_reason),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"offline_at",
8,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT64,
0, /* quantifier_offset */
offsetof(Tari__Rpc__Peer, offline_at),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"features",
9,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT32,
0, /* quantifier_offset */
offsetof(Tari__Rpc__Peer, features),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"supported_protocols",
11,
PROTOBUF_C_LABEL_REPEATED,
PROTOBUF_C_TYPE_BYTES,
offsetof(Tari__Rpc__Peer, n_supported_protocols),
offsetof(Tari__Rpc__Peer, supported_protocols),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"user_agent",
12,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Tari__Rpc__Peer, user_agent),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__peer__field_indices_by_name[] = {
2, /* field[2] = addresses */
6, /* field[6] = banned_reason */
5, /* field[5] = banned_until */
8, /* field[8] = features */
4, /* field[4] = flags */
3, /* field[3] = last_connection */
1, /* field[1] = node_id */
7, /* field[7] = offline_at */
0, /* field[0] = public_key */
9, /* field[9] = supported_protocols */
10, /* field[10] = user_agent */
};
static const ProtobufCIntRange tari__rpc__peer__number_ranges[2 + 1] =
{
{ 1, 0 },
{ 11, 9 },
{ 0, 11 }
};
const ProtobufCMessageDescriptor tari__rpc__peer__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.Peer",
"Peer",
"Tari__Rpc__Peer",
"tari.rpc",
sizeof(Tari__Rpc__Peer),
11,
tari__rpc__peer__field_descriptors,
tari__rpc__peer__field_indices_by_name,
2, tari__rpc__peer__number_ranges,
(ProtobufCMessageInit) tari__rpc__peer__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor tari__rpc__network_status_response__field_descriptors[3] =
{
{
"status",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_ENUM,
0, /* quantifier_offset */
offsetof(Tari__Rpc__NetworkStatusResponse, status),
&tari__rpc__connectivity_status__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"avg_latency_ms",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT32,
0, /* quantifier_offset */
offsetof(Tari__Rpc__NetworkStatusResponse, avg_latency_ms),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"num_node_connections",
3,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT32,
0, /* quantifier_offset */
offsetof(Tari__Rpc__NetworkStatusResponse, num_node_connections),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__network_status_response__field_indices_by_name[] = {
1, /* field[1] = avg_latency_ms */
2, /* field[2] = num_node_connections */
0, /* field[0] = status */
};
static const ProtobufCIntRange tari__rpc__network_status_response__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 3 }
};
const ProtobufCMessageDescriptor tari__rpc__network_status_response__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.NetworkStatusResponse",
"NetworkStatusResponse",
"Tari__Rpc__NetworkStatusResponse",
"tari.rpc",
sizeof(Tari__Rpc__NetworkStatusResponse),
3,
tari__rpc__network_status_response__field_descriptors,
tari__rpc__network_status_response__field_indices_by_name,
1, tari__rpc__network_status_response__number_ranges,
(ProtobufCMessageInit) tari__rpc__network_status_response__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor tari__rpc__address__field_descriptors[4] =
{
{
"address",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__Address, address),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"last_seen",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Tari__Rpc__Address, last_seen),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"connection_attempts",
3,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT32,
0, /* quantifier_offset */
offsetof(Tari__Rpc__Address, connection_attempts),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"avg_latency",
5,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT64,
0, /* quantifier_offset */
offsetof(Tari__Rpc__Address, avg_latency),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__address__field_indices_by_name[] = {
0, /* field[0] = address */
3, /* field[3] = avg_latency */
2, /* field[2] = connection_attempts */
1, /* field[1] = last_seen */
};
static const ProtobufCIntRange tari__rpc__address__number_ranges[2 + 1] =
{
{ 1, 0 },
{ 5, 3 },
{ 0, 4 }
};
const ProtobufCMessageDescriptor tari__rpc__address__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.Address",
"Address",
"Tari__Rpc__Address",
"tari.rpc",
sizeof(Tari__Rpc__Address),
4,
tari__rpc__address__field_descriptors,
tari__rpc__address__field_indices_by_name,
2, tari__rpc__address__number_ranges,
(ProtobufCMessageInit) tari__rpc__address__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor tari__rpc__list_connected_peers_response__field_descriptors[1] =
{
{
"connected_peers",
1,
PROTOBUF_C_LABEL_REPEATED,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(Tari__Rpc__ListConnectedPeersResponse, n_connected_peers),
offsetof(Tari__Rpc__ListConnectedPeersResponse, connected_peers),
&tari__rpc__peer__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__list_connected_peers_response__field_indices_by_name[] = {
0, /* field[0] = connected_peers */
};
static const ProtobufCIntRange tari__rpc__list_connected_peers_response__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 1 }
};
const ProtobufCMessageDescriptor tari__rpc__list_connected_peers_response__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.ListConnectedPeersResponse",
"ListConnectedPeersResponse",
"Tari__Rpc__ListConnectedPeersResponse",
"tari.rpc",
sizeof(Tari__Rpc__ListConnectedPeersResponse),
1,
tari__rpc__list_connected_peers_response__field_descriptors,
tari__rpc__list_connected_peers_response__field_indices_by_name,
1, tari__rpc__list_connected_peers_response__number_ranges,
(ProtobufCMessageInit) tari__rpc__list_connected_peers_response__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor tari__rpc__software_update__field_descriptors[4] =
{
{
"has_update",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BOOL,
0, /* quantifier_offset */
offsetof(Tari__Rpc__SoftwareUpdate, has_update),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"version",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Tari__Rpc__SoftwareUpdate, version),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"sha",
3,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Tari__Rpc__SoftwareUpdate, sha),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"download_url",
4,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Tari__Rpc__SoftwareUpdate, download_url),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__software_update__field_indices_by_name[] = {
3, /* field[3] = download_url */
0, /* field[0] = has_update */
2, /* field[2] = sha */
1, /* field[1] = version */
};
static const ProtobufCIntRange tari__rpc__software_update__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 4 }
};
const ProtobufCMessageDescriptor tari__rpc__software_update__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.SoftwareUpdate",
"SoftwareUpdate",
"Tari__Rpc__SoftwareUpdate",
"tari.rpc",
sizeof(Tari__Rpc__SoftwareUpdate),
4,
tari__rpc__software_update__field_descriptors,
tari__rpc__software_update__field_indices_by_name,
1, tari__rpc__software_update__number_ranges,
(ProtobufCMessageInit) tari__rpc__software_update__init,
NULL,NULL,NULL /* reserved[123] */
};
#define tari__rpc__get_identity_request__field_descriptors NULL
#define tari__rpc__get_identity_request__field_indices_by_name NULL
#define tari__rpc__get_identity_request__number_ranges NULL
const ProtobufCMessageDescriptor tari__rpc__get_identity_request__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.GetIdentityRequest",
"GetIdentityRequest",
"Tari__Rpc__GetIdentityRequest",
"tari.rpc",
sizeof(Tari__Rpc__GetIdentityRequest),
0,
tari__rpc__get_identity_request__field_descriptors,
tari__rpc__get_identity_request__field_indices_by_name,
0, tari__rpc__get_identity_request__number_ranges,
(ProtobufCMessageInit) tari__rpc__get_identity_request__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor tari__rpc__get_identity_response__field_descriptors[3] =
{
{
"public_key",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__GetIdentityResponse, public_key),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"public_address",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Tari__Rpc__GetIdentityResponse, public_address),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"node_id",
3,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__GetIdentityResponse, node_id),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__get_identity_response__field_indices_by_name[] = {
2, /* field[2] = node_id */
1, /* field[1] = public_address */
0, /* field[0] = public_key */
};
static const ProtobufCIntRange tari__rpc__get_identity_response__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 3 }
};
const ProtobufCMessageDescriptor tari__rpc__get_identity_response__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.GetIdentityResponse",
"GetIdentityResponse",
"Tari__Rpc__GetIdentityResponse",
"tari.rpc",
sizeof(Tari__Rpc__GetIdentityResponse),
3,
tari__rpc__get_identity_response__field_descriptors,
tari__rpc__get_identity_response__field_indices_by_name,
1, tari__rpc__get_identity_response__number_ranges,
(ProtobufCMessageInit) tari__rpc__get_identity_response__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCEnumValue tari__rpc__connectivity_status__enum_values_by_number[4] =
{
{ "Initializing", "TARI__RPC__CONNECTIVITY_STATUS__Initializing", 0 },
{ "Online", "TARI__RPC__CONNECTIVITY_STATUS__Online", 1 },
{ "Degraded", "TARI__RPC__CONNECTIVITY_STATUS__Degraded", 2 },
{ "Offline", "TARI__RPC__CONNECTIVITY_STATUS__Offline", 3 },
};
static const ProtobufCIntRange tari__rpc__connectivity_status__value_ranges[] = {
{0, 0},{0, 4}
};
static const ProtobufCEnumValueIndex tari__rpc__connectivity_status__enum_values_by_name[4] =
{
{ "Degraded", 2 },
{ "Initializing", 0 },
{ "Offline", 3 },
{ "Online", 1 },
};
const ProtobufCEnumDescriptor tari__rpc__connectivity_status__descriptor =
{
PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC,
"tari.rpc.ConnectivityStatus",
"ConnectivityStatus",
"Tari__Rpc__ConnectivityStatus",
"tari.rpc",
4,
tari__rpc__connectivity_status__enum_values_by_number,
4,
tari__rpc__connectivity_status__enum_values_by_name,
1,
tari__rpc__connectivity_status__value_ranges,
NULL,NULL,NULL,NULL /* reserved[1234] */
};

View file

@ -1,367 +0,0 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: network.proto */
#ifndef PROTOBUF_C_network_2eproto__INCLUDED
#define PROTOBUF_C_network_2eproto__INCLUDED
#include <protobuf-c/protobuf-c.h>
PROTOBUF_C__BEGIN_DECLS
#if PROTOBUF_C_VERSION_NUMBER < 1003000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1003003 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif
#include "google/protobuf/timestamp.pb-c.h"
typedef struct _Tari__Rpc__NodeIdentity Tari__Rpc__NodeIdentity;
typedef struct _Tari__Rpc__Peer Tari__Rpc__Peer;
typedef struct _Tari__Rpc__NetworkStatusResponse Tari__Rpc__NetworkStatusResponse;
typedef struct _Tari__Rpc__Address Tari__Rpc__Address;
typedef struct _Tari__Rpc__ListConnectedPeersResponse Tari__Rpc__ListConnectedPeersResponse;
typedef struct _Tari__Rpc__SoftwareUpdate Tari__Rpc__SoftwareUpdate;
typedef struct _Tari__Rpc__GetIdentityRequest Tari__Rpc__GetIdentityRequest;
typedef struct _Tari__Rpc__GetIdentityResponse Tari__Rpc__GetIdentityResponse;
/* --- enums --- */
typedef enum _Tari__Rpc__ConnectivityStatus {
TARI__RPC__CONNECTIVITY_STATUS__Initializing = 0,
TARI__RPC__CONNECTIVITY_STATUS__Online = 1,
TARI__RPC__CONNECTIVITY_STATUS__Degraded = 2,
TARI__RPC__CONNECTIVITY_STATUS__Offline = 3
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(TARI__RPC__CONNECTIVITY_STATUS)
} Tari__Rpc__ConnectivityStatus;
/* --- messages --- */
struct _Tari__Rpc__NodeIdentity
{
ProtobufCMessage base;
ProtobufCBinaryData public_key;
size_t n_public_addresses;
char **public_addresses;
ProtobufCBinaryData node_id;
};
#define TARI__RPC__NODE_IDENTITY__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__node_identity__descriptor) \
, {0,NULL}, 0,NULL, {0,NULL} }
struct _Tari__Rpc__Peer
{
ProtobufCMessage base;
/*
* / Public key of the peer
*/
ProtobufCBinaryData public_key;
/*
* / NodeId of the peer
*/
ProtobufCBinaryData node_id;
/*
* / Peer's addresses
*/
size_t n_addresses;
Tari__Rpc__Address **addresses;
/*
* / Last connection attempt to peer
*/
uint64_t last_connection;
/*
* / Flags for the peer.
*/
uint32_t flags;
uint64_t banned_until;
char *banned_reason;
uint64_t offline_at;
/*
* / Features supported by the peer
*/
uint32_t features;
/*
* / used as information for more efficient protocol negotiation.
*/
size_t n_supported_protocols;
ProtobufCBinaryData *supported_protocols;
/*
* / User agent advertised by the peer
*/
char *user_agent;
};
#define TARI__RPC__PEER__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__peer__descriptor) \
, {0,NULL}, {0,NULL}, 0,NULL, 0, 0, 0, (char *)protobuf_c_empty_string, 0, 0, 0,NULL, (char *)protobuf_c_empty_string }
struct _Tari__Rpc__NetworkStatusResponse
{
ProtobufCMessage base;
Tari__Rpc__ConnectivityStatus status;
uint32_t avg_latency_ms;
uint32_t num_node_connections;
};
#define TARI__RPC__NETWORK_STATUS_RESPONSE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__network_status_response__descriptor) \
, TARI__RPC__CONNECTIVITY_STATUS__Initializing, 0, 0 }
struct _Tari__Rpc__Address
{
ProtobufCMessage base;
ProtobufCBinaryData address;
char *last_seen;
uint32_t connection_attempts;
uint64_t avg_latency;
};
#define TARI__RPC__ADDRESS__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__address__descriptor) \
, {0,NULL}, (char *)protobuf_c_empty_string, 0, 0 }
struct _Tari__Rpc__ListConnectedPeersResponse
{
ProtobufCMessage base;
size_t n_connected_peers;
Tari__Rpc__Peer **connected_peers;
};
#define TARI__RPC__LIST_CONNECTED_PEERS_RESPONSE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__list_connected_peers_response__descriptor) \
, 0,NULL }
struct _Tari__Rpc__SoftwareUpdate
{
ProtobufCMessage base;
protobuf_c_boolean has_update;
char *version;
char *sha;
char *download_url;
};
#define TARI__RPC__SOFTWARE_UPDATE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__software_update__descriptor) \
, 0, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string, (char *)protobuf_c_empty_string }
struct _Tari__Rpc__GetIdentityRequest
{
ProtobufCMessage base;
};
#define TARI__RPC__GET_IDENTITY_REQUEST__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__get_identity_request__descriptor) \
}
struct _Tari__Rpc__GetIdentityResponse
{
ProtobufCMessage base;
ProtobufCBinaryData public_key;
char *public_address;
ProtobufCBinaryData node_id;
};
#define TARI__RPC__GET_IDENTITY_RESPONSE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__get_identity_response__descriptor) \
, {0,NULL}, (char *)protobuf_c_empty_string, {0,NULL} }
/* Tari__Rpc__NodeIdentity methods */
void tari__rpc__node_identity__init
(Tari__Rpc__NodeIdentity *message);
size_t tari__rpc__node_identity__get_packed_size
(const Tari__Rpc__NodeIdentity *message);
size_t tari__rpc__node_identity__pack
(const Tari__Rpc__NodeIdentity *message,
uint8_t *out);
size_t tari__rpc__node_identity__pack_to_buffer
(const Tari__Rpc__NodeIdentity *message,
ProtobufCBuffer *buffer);
Tari__Rpc__NodeIdentity *
tari__rpc__node_identity__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__node_identity__free_unpacked
(Tari__Rpc__NodeIdentity *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__Peer methods */
void tari__rpc__peer__init
(Tari__Rpc__Peer *message);
size_t tari__rpc__peer__get_packed_size
(const Tari__Rpc__Peer *message);
size_t tari__rpc__peer__pack
(const Tari__Rpc__Peer *message,
uint8_t *out);
size_t tari__rpc__peer__pack_to_buffer
(const Tari__Rpc__Peer *message,
ProtobufCBuffer *buffer);
Tari__Rpc__Peer *
tari__rpc__peer__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__peer__free_unpacked
(Tari__Rpc__Peer *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__NetworkStatusResponse methods */
void tari__rpc__network_status_response__init
(Tari__Rpc__NetworkStatusResponse *message);
size_t tari__rpc__network_status_response__get_packed_size
(const Tari__Rpc__NetworkStatusResponse *message);
size_t tari__rpc__network_status_response__pack
(const Tari__Rpc__NetworkStatusResponse *message,
uint8_t *out);
size_t tari__rpc__network_status_response__pack_to_buffer
(const Tari__Rpc__NetworkStatusResponse *message,
ProtobufCBuffer *buffer);
Tari__Rpc__NetworkStatusResponse *
tari__rpc__network_status_response__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__network_status_response__free_unpacked
(Tari__Rpc__NetworkStatusResponse *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__Address methods */
void tari__rpc__address__init
(Tari__Rpc__Address *message);
size_t tari__rpc__address__get_packed_size
(const Tari__Rpc__Address *message);
size_t tari__rpc__address__pack
(const Tari__Rpc__Address *message,
uint8_t *out);
size_t tari__rpc__address__pack_to_buffer
(const Tari__Rpc__Address *message,
ProtobufCBuffer *buffer);
Tari__Rpc__Address *
tari__rpc__address__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__address__free_unpacked
(Tari__Rpc__Address *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__ListConnectedPeersResponse methods */
void tari__rpc__list_connected_peers_response__init
(Tari__Rpc__ListConnectedPeersResponse *message);
size_t tari__rpc__list_connected_peers_response__get_packed_size
(const Tari__Rpc__ListConnectedPeersResponse *message);
size_t tari__rpc__list_connected_peers_response__pack
(const Tari__Rpc__ListConnectedPeersResponse *message,
uint8_t *out);
size_t tari__rpc__list_connected_peers_response__pack_to_buffer
(const Tari__Rpc__ListConnectedPeersResponse *message,
ProtobufCBuffer *buffer);
Tari__Rpc__ListConnectedPeersResponse *
tari__rpc__list_connected_peers_response__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__list_connected_peers_response__free_unpacked
(Tari__Rpc__ListConnectedPeersResponse *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__SoftwareUpdate methods */
void tari__rpc__software_update__init
(Tari__Rpc__SoftwareUpdate *message);
size_t tari__rpc__software_update__get_packed_size
(const Tari__Rpc__SoftwareUpdate *message);
size_t tari__rpc__software_update__pack
(const Tari__Rpc__SoftwareUpdate *message,
uint8_t *out);
size_t tari__rpc__software_update__pack_to_buffer
(const Tari__Rpc__SoftwareUpdate *message,
ProtobufCBuffer *buffer);
Tari__Rpc__SoftwareUpdate *
tari__rpc__software_update__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__software_update__free_unpacked
(Tari__Rpc__SoftwareUpdate *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__GetIdentityRequest methods */
void tari__rpc__get_identity_request__init
(Tari__Rpc__GetIdentityRequest *message);
size_t tari__rpc__get_identity_request__get_packed_size
(const Tari__Rpc__GetIdentityRequest *message);
size_t tari__rpc__get_identity_request__pack
(const Tari__Rpc__GetIdentityRequest *message,
uint8_t *out);
size_t tari__rpc__get_identity_request__pack_to_buffer
(const Tari__Rpc__GetIdentityRequest *message,
ProtobufCBuffer *buffer);
Tari__Rpc__GetIdentityRequest *
tari__rpc__get_identity_request__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__get_identity_request__free_unpacked
(Tari__Rpc__GetIdentityRequest *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__GetIdentityResponse methods */
void tari__rpc__get_identity_response__init
(Tari__Rpc__GetIdentityResponse *message);
size_t tari__rpc__get_identity_response__get_packed_size
(const Tari__Rpc__GetIdentityResponse *message);
size_t tari__rpc__get_identity_response__pack
(const Tari__Rpc__GetIdentityResponse *message,
uint8_t *out);
size_t tari__rpc__get_identity_response__pack_to_buffer
(const Tari__Rpc__GetIdentityResponse *message,
ProtobufCBuffer *buffer);
Tari__Rpc__GetIdentityResponse *
tari__rpc__get_identity_response__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__get_identity_response__free_unpacked
(Tari__Rpc__GetIdentityResponse *message,
ProtobufCAllocator *allocator);
/* --- per-message closures --- */
typedef void (*Tari__Rpc__NodeIdentity_Closure)
(const Tari__Rpc__NodeIdentity *message,
void *closure_data);
typedef void (*Tari__Rpc__Peer_Closure)
(const Tari__Rpc__Peer *message,
void *closure_data);
typedef void (*Tari__Rpc__NetworkStatusResponse_Closure)
(const Tari__Rpc__NetworkStatusResponse *message,
void *closure_data);
typedef void (*Tari__Rpc__Address_Closure)
(const Tari__Rpc__Address *message,
void *closure_data);
typedef void (*Tari__Rpc__ListConnectedPeersResponse_Closure)
(const Tari__Rpc__ListConnectedPeersResponse *message,
void *closure_data);
typedef void (*Tari__Rpc__SoftwareUpdate_Closure)
(const Tari__Rpc__SoftwareUpdate *message,
void *closure_data);
typedef void (*Tari__Rpc__GetIdentityRequest_Closure)
(const Tari__Rpc__GetIdentityRequest *message,
void *closure_data);
typedef void (*Tari__Rpc__GetIdentityResponse_Closure)
(const Tari__Rpc__GetIdentityResponse *message,
void *closure_data);
/* --- services --- */
/* --- descriptors --- */
extern const ProtobufCEnumDescriptor tari__rpc__connectivity_status__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__node_identity__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__peer__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__network_status_response__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__address__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__list_connected_peers_response__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__software_update__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__get_identity_request__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__get_identity_response__descriptor;
PROTOBUF_C__END_DECLS
#endif /* PROTOBUF_C_network_2eproto__INCLUDED */

2375
external/src/Tari/proto/gRPC/network.pb.cc vendored Normal file

File diff suppressed because it is too large Load diff

3263
external/src/Tari/proto/gRPC/network.pb.h vendored Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,27 @@
// Generated by the gRPC C++ plugin.
// If you make any local change, they will be lost.
// source: sidechain_types.proto
#include "sidechain_types.pb.h"
#include "sidechain_types.grpc.pb.h"
#include <functional>
#include <grpcpp/support/async_stream.h>
#include <grpcpp/support/async_unary_call.h>
#include <grpcpp/impl/channel_interface.h>
#include <grpcpp/impl/client_unary_call.h>
#include <grpcpp/support/client_callback.h>
#include <grpcpp/support/message_allocator.h>
#include <grpcpp/support/method_handler.h>
#include <grpcpp/impl/rpc_service_method.h>
#include <grpcpp/support/server_callback.h>
#include <grpcpp/impl/server_callback_handlers.h>
#include <grpcpp/server_context.h>
#include <grpcpp/impl/service_type.h>
#include <grpcpp/support/sync_stream.h>
namespace tari {
namespace rpc {
} // namespace tari
} // namespace rpc

View file

@ -0,0 +1,57 @@
// Generated by the gRPC C++ plugin.
// If you make any local change, they will be lost.
// source: sidechain_types.proto
// Original file comments:
// Copyright 2020. The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
// following disclaimer in the documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
// products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef GRPC_sidechain_5ftypes_2eproto__INCLUDED
#define GRPC_sidechain_5ftypes_2eproto__INCLUDED
#include "sidechain_types.pb.h"
#include <functional>
#include <grpcpp/generic/async_generic_service.h>
#include <grpcpp/support/async_stream.h>
#include <grpcpp/support/async_unary_call.h>
#include <grpcpp/support/client_callback.h>
#include <grpcpp/client_context.h>
#include <grpcpp/completion_queue.h>
#include <grpcpp/support/message_allocator.h>
#include <grpcpp/support/method_handler.h>
#include <grpcpp/impl/proto_utils.h>
#include <grpcpp/impl/rpc_method.h>
#include <grpcpp/support/server_callback.h>
#include <grpcpp/impl/server_callback_handlers.h>
#include <grpcpp/server_context.h>
#include <grpcpp/impl/service_type.h>
#include <grpcpp/support/status.h>
#include <grpcpp/support/stub_options.h>
#include <grpcpp/support/sync_stream.h>
namespace tari {
namespace rpc {
} // namespace rpc
} // namespace tari
#endif // GRPC_sidechain_5ftypes_2eproto__INCLUDED

View file

@ -1,885 +0,0 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: sidechain_types.proto */
/* Do not generate deprecated warnings for self */
#ifndef PROTOBUF_C__NO_DEPRECATED
#define PROTOBUF_C__NO_DEPRECATED
#endif
#include "sidechain_types.pb-c.h"
void tari__rpc__side_chain_feature__init
(Tari__Rpc__SideChainFeature *message)
{
static const Tari__Rpc__SideChainFeature init_value = TARI__RPC__SIDE_CHAIN_FEATURE__INIT;
*message = init_value;
}
size_t tari__rpc__side_chain_feature__get_packed_size
(const Tari__Rpc__SideChainFeature *message)
{
assert(message->base.descriptor == &tari__rpc__side_chain_feature__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__side_chain_feature__pack
(const Tari__Rpc__SideChainFeature *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__side_chain_feature__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__side_chain_feature__pack_to_buffer
(const Tari__Rpc__SideChainFeature *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__side_chain_feature__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__SideChainFeature *
tari__rpc__side_chain_feature__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__SideChainFeature *)
protobuf_c_message_unpack (&tari__rpc__side_chain_feature__descriptor,
allocator, len, data);
}
void tari__rpc__side_chain_feature__free_unpacked
(Tari__Rpc__SideChainFeature *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__side_chain_feature__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__validator_node_registration__init
(Tari__Rpc__ValidatorNodeRegistration *message)
{
static const Tari__Rpc__ValidatorNodeRegistration init_value = TARI__RPC__VALIDATOR_NODE_REGISTRATION__INIT;
*message = init_value;
}
size_t tari__rpc__validator_node_registration__get_packed_size
(const Tari__Rpc__ValidatorNodeRegistration *message)
{
assert(message->base.descriptor == &tari__rpc__validator_node_registration__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__validator_node_registration__pack
(const Tari__Rpc__ValidatorNodeRegistration *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__validator_node_registration__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__validator_node_registration__pack_to_buffer
(const Tari__Rpc__ValidatorNodeRegistration *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__validator_node_registration__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__ValidatorNodeRegistration *
tari__rpc__validator_node_registration__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__ValidatorNodeRegistration *)
protobuf_c_message_unpack (&tari__rpc__validator_node_registration__descriptor,
allocator, len, data);
}
void tari__rpc__validator_node_registration__free_unpacked
(Tari__Rpc__ValidatorNodeRegistration *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__validator_node_registration__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__template_registration__init
(Tari__Rpc__TemplateRegistration *message)
{
static const Tari__Rpc__TemplateRegistration init_value = TARI__RPC__TEMPLATE_REGISTRATION__INIT;
*message = init_value;
}
size_t tari__rpc__template_registration__get_packed_size
(const Tari__Rpc__TemplateRegistration *message)
{
assert(message->base.descriptor == &tari__rpc__template_registration__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__template_registration__pack
(const Tari__Rpc__TemplateRegistration *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__template_registration__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__template_registration__pack_to_buffer
(const Tari__Rpc__TemplateRegistration *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__template_registration__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__TemplateRegistration *
tari__rpc__template_registration__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__TemplateRegistration *)
protobuf_c_message_unpack (&tari__rpc__template_registration__descriptor,
allocator, len, data);
}
void tari__rpc__template_registration__free_unpacked
(Tari__Rpc__TemplateRegistration *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__template_registration__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__confidential_output_data__init
(Tari__Rpc__ConfidentialOutputData *message)
{
static const Tari__Rpc__ConfidentialOutputData init_value = TARI__RPC__CONFIDENTIAL_OUTPUT_DATA__INIT;
*message = init_value;
}
size_t tari__rpc__confidential_output_data__get_packed_size
(const Tari__Rpc__ConfidentialOutputData *message)
{
assert(message->base.descriptor == &tari__rpc__confidential_output_data__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__confidential_output_data__pack
(const Tari__Rpc__ConfidentialOutputData *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__confidential_output_data__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__confidential_output_data__pack_to_buffer
(const Tari__Rpc__ConfidentialOutputData *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__confidential_output_data__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__ConfidentialOutputData *
tari__rpc__confidential_output_data__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__ConfidentialOutputData *)
protobuf_c_message_unpack (&tari__rpc__confidential_output_data__descriptor,
allocator, len, data);
}
void tari__rpc__confidential_output_data__free_unpacked
(Tari__Rpc__ConfidentialOutputData *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__confidential_output_data__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__template_type__init
(Tari__Rpc__TemplateType *message)
{
static const Tari__Rpc__TemplateType init_value = TARI__RPC__TEMPLATE_TYPE__INIT;
*message = init_value;
}
size_t tari__rpc__template_type__get_packed_size
(const Tari__Rpc__TemplateType *message)
{
assert(message->base.descriptor == &tari__rpc__template_type__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__template_type__pack
(const Tari__Rpc__TemplateType *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__template_type__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__template_type__pack_to_buffer
(const Tari__Rpc__TemplateType *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__template_type__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__TemplateType *
tari__rpc__template_type__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__TemplateType *)
protobuf_c_message_unpack (&tari__rpc__template_type__descriptor,
allocator, len, data);
}
void tari__rpc__template_type__free_unpacked
(Tari__Rpc__TemplateType *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__template_type__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__wasm_info__init
(Tari__Rpc__WasmInfo *message)
{
static const Tari__Rpc__WasmInfo init_value = TARI__RPC__WASM_INFO__INIT;
*message = init_value;
}
size_t tari__rpc__wasm_info__get_packed_size
(const Tari__Rpc__WasmInfo *message)
{
assert(message->base.descriptor == &tari__rpc__wasm_info__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__wasm_info__pack
(const Tari__Rpc__WasmInfo *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__wasm_info__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__wasm_info__pack_to_buffer
(const Tari__Rpc__WasmInfo *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__wasm_info__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__WasmInfo *
tari__rpc__wasm_info__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__WasmInfo *)
protobuf_c_message_unpack (&tari__rpc__wasm_info__descriptor,
allocator, len, data);
}
void tari__rpc__wasm_info__free_unpacked
(Tari__Rpc__WasmInfo *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__wasm_info__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__flow_info__init
(Tari__Rpc__FlowInfo *message)
{
static const Tari__Rpc__FlowInfo init_value = TARI__RPC__FLOW_INFO__INIT;
*message = init_value;
}
size_t tari__rpc__flow_info__get_packed_size
(const Tari__Rpc__FlowInfo *message)
{
assert(message->base.descriptor == &tari__rpc__flow_info__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__flow_info__pack
(const Tari__Rpc__FlowInfo *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__flow_info__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__flow_info__pack_to_buffer
(const Tari__Rpc__FlowInfo *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__flow_info__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__FlowInfo *
tari__rpc__flow_info__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__FlowInfo *)
protobuf_c_message_unpack (&tari__rpc__flow_info__descriptor,
allocator, len, data);
}
void tari__rpc__flow_info__free_unpacked
(Tari__Rpc__FlowInfo *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__flow_info__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__manifest_info__init
(Tari__Rpc__ManifestInfo *message)
{
static const Tari__Rpc__ManifestInfo init_value = TARI__RPC__MANIFEST_INFO__INIT;
*message = init_value;
}
size_t tari__rpc__manifest_info__get_packed_size
(const Tari__Rpc__ManifestInfo *message)
{
assert(message->base.descriptor == &tari__rpc__manifest_info__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__manifest_info__pack
(const Tari__Rpc__ManifestInfo *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__manifest_info__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__manifest_info__pack_to_buffer
(const Tari__Rpc__ManifestInfo *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__manifest_info__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__ManifestInfo *
tari__rpc__manifest_info__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__ManifestInfo *)
protobuf_c_message_unpack (&tari__rpc__manifest_info__descriptor,
allocator, len, data);
}
void tari__rpc__manifest_info__free_unpacked
(Tari__Rpc__ManifestInfo *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__manifest_info__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
void tari__rpc__build_info__init
(Tari__Rpc__BuildInfo *message)
{
static const Tari__Rpc__BuildInfo init_value = TARI__RPC__BUILD_INFO__INIT;
*message = init_value;
}
size_t tari__rpc__build_info__get_packed_size
(const Tari__Rpc__BuildInfo *message)
{
assert(message->base.descriptor == &tari__rpc__build_info__descriptor);
return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message));
}
size_t tari__rpc__build_info__pack
(const Tari__Rpc__BuildInfo *message,
uint8_t *out)
{
assert(message->base.descriptor == &tari__rpc__build_info__descriptor);
return protobuf_c_message_pack ((const ProtobufCMessage*)message, out);
}
size_t tari__rpc__build_info__pack_to_buffer
(const Tari__Rpc__BuildInfo *message,
ProtobufCBuffer *buffer)
{
assert(message->base.descriptor == &tari__rpc__build_info__descriptor);
return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer);
}
Tari__Rpc__BuildInfo *
tari__rpc__build_info__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data)
{
return (Tari__Rpc__BuildInfo *)
protobuf_c_message_unpack (&tari__rpc__build_info__descriptor,
allocator, len, data);
}
void tari__rpc__build_info__free_unpacked
(Tari__Rpc__BuildInfo *message,
ProtobufCAllocator *allocator)
{
if(!message)
return;
assert(message->base.descriptor == &tari__rpc__build_info__descriptor);
protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator);
}
static const ProtobufCFieldDescriptor tari__rpc__side_chain_feature__field_descriptors[3] =
{
{
"validator_node_registration",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(Tari__Rpc__SideChainFeature, side_chain_feature_case),
offsetof(Tari__Rpc__SideChainFeature, validator_node_registration),
&tari__rpc__validator_node_registration__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"template_registration",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(Tari__Rpc__SideChainFeature, side_chain_feature_case),
offsetof(Tari__Rpc__SideChainFeature, template_registration),
&tari__rpc__template_registration__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"confidential_output",
3,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(Tari__Rpc__SideChainFeature, side_chain_feature_case),
offsetof(Tari__Rpc__SideChainFeature, confidential_output),
&tari__rpc__confidential_output_data__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__side_chain_feature__field_indices_by_name[] = {
2, /* field[2] = confidential_output */
1, /* field[1] = template_registration */
0, /* field[0] = validator_node_registration */
};
static const ProtobufCIntRange tari__rpc__side_chain_feature__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 3 }
};
const ProtobufCMessageDescriptor tari__rpc__side_chain_feature__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.SideChainFeature",
"SideChainFeature",
"Tari__Rpc__SideChainFeature",
"tari.rpc",
sizeof(Tari__Rpc__SideChainFeature),
3,
tari__rpc__side_chain_feature__field_descriptors,
tari__rpc__side_chain_feature__field_indices_by_name,
1, tari__rpc__side_chain_feature__number_ranges,
(ProtobufCMessageInit) tari__rpc__side_chain_feature__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor tari__rpc__validator_node_registration__field_descriptors[2] =
{
{
"public_key",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__ValidatorNodeRegistration, public_key),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"signature",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
0, /* quantifier_offset */
offsetof(Tari__Rpc__ValidatorNodeRegistration, signature),
&tari__rpc__signature__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__validator_node_registration__field_indices_by_name[] = {
0, /* field[0] = public_key */
1, /* field[1] = signature */
};
static const ProtobufCIntRange tari__rpc__validator_node_registration__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 2 }
};
const ProtobufCMessageDescriptor tari__rpc__validator_node_registration__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.ValidatorNodeRegistration",
"ValidatorNodeRegistration",
"Tari__Rpc__ValidatorNodeRegistration",
"tari.rpc",
sizeof(Tari__Rpc__ValidatorNodeRegistration),
2,
tari__rpc__validator_node_registration__field_descriptors,
tari__rpc__validator_node_registration__field_indices_by_name,
1, tari__rpc__validator_node_registration__number_ranges,
(ProtobufCMessageInit) tari__rpc__validator_node_registration__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor tari__rpc__template_registration__field_descriptors[8] =
{
{
"author_public_key",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__TemplateRegistration, author_public_key),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"author_signature",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
0, /* quantifier_offset */
offsetof(Tari__Rpc__TemplateRegistration, author_signature),
&tari__rpc__signature__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"template_name",
3,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Tari__Rpc__TemplateRegistration, template_name),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"template_version",
4,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT32,
0, /* quantifier_offset */
offsetof(Tari__Rpc__TemplateRegistration, template_version),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"template_type",
5,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
0, /* quantifier_offset */
offsetof(Tari__Rpc__TemplateRegistration, template_type),
&tari__rpc__template_type__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"build_info",
6,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
0, /* quantifier_offset */
offsetof(Tari__Rpc__TemplateRegistration, build_info),
&tari__rpc__build_info__descriptor,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"binary_sha",
7,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__TemplateRegistration, binary_sha),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"binary_url",
8,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Tari__Rpc__TemplateRegistration, binary_url),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__template_registration__field_indices_by_name[] = {
0, /* field[0] = author_public_key */
1, /* field[1] = author_signature */
6, /* field[6] = binary_sha */
7, /* field[7] = binary_url */
5, /* field[5] = build_info */
2, /* field[2] = template_name */
4, /* field[4] = template_type */
3, /* field[3] = template_version */
};
static const ProtobufCIntRange tari__rpc__template_registration__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 8 }
};
const ProtobufCMessageDescriptor tari__rpc__template_registration__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.TemplateRegistration",
"TemplateRegistration",
"Tari__Rpc__TemplateRegistration",
"tari.rpc",
sizeof(Tari__Rpc__TemplateRegistration),
8,
tari__rpc__template_registration__field_descriptors,
tari__rpc__template_registration__field_indices_by_name,
1, tari__rpc__template_registration__number_ranges,
(ProtobufCMessageInit) tari__rpc__template_registration__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor tari__rpc__confidential_output_data__field_descriptors[1] =
{
{
"claim_public_key",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__ConfidentialOutputData, claim_public_key),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__confidential_output_data__field_indices_by_name[] = {
0, /* field[0] = claim_public_key */
};
static const ProtobufCIntRange tari__rpc__confidential_output_data__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 1 }
};
const ProtobufCMessageDescriptor tari__rpc__confidential_output_data__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.ConfidentialOutputData",
"ConfidentialOutputData",
"Tari__Rpc__ConfidentialOutputData",
"tari.rpc",
sizeof(Tari__Rpc__ConfidentialOutputData),
1,
tari__rpc__confidential_output_data__field_descriptors,
tari__rpc__confidential_output_data__field_indices_by_name,
1, tari__rpc__confidential_output_data__number_ranges,
(ProtobufCMessageInit) tari__rpc__confidential_output_data__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor tari__rpc__template_type__field_descriptors[3] =
{
{
"wasm",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(Tari__Rpc__TemplateType, template_type_case),
offsetof(Tari__Rpc__TemplateType, wasm),
&tari__rpc__wasm_info__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"flow",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(Tari__Rpc__TemplateType, template_type_case),
offsetof(Tari__Rpc__TemplateType, flow),
&tari__rpc__flow_info__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"manifest",
3,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_MESSAGE,
offsetof(Tari__Rpc__TemplateType, template_type_case),
offsetof(Tari__Rpc__TemplateType, manifest),
&tari__rpc__manifest_info__descriptor,
NULL,
0 | PROTOBUF_C_FIELD_FLAG_ONEOF, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__template_type__field_indices_by_name[] = {
1, /* field[1] = flow */
2, /* field[2] = manifest */
0, /* field[0] = wasm */
};
static const ProtobufCIntRange tari__rpc__template_type__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 3 }
};
const ProtobufCMessageDescriptor tari__rpc__template_type__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.TemplateType",
"TemplateType",
"Tari__Rpc__TemplateType",
"tari.rpc",
sizeof(Tari__Rpc__TemplateType),
3,
tari__rpc__template_type__field_descriptors,
tari__rpc__template_type__field_indices_by_name,
1, tari__rpc__template_type__number_ranges,
(ProtobufCMessageInit) tari__rpc__template_type__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor tari__rpc__wasm_info__field_descriptors[1] =
{
{
"abi_version",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_UINT32,
0, /* quantifier_offset */
offsetof(Tari__Rpc__WasmInfo, abi_version),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__wasm_info__field_indices_by_name[] = {
0, /* field[0] = abi_version */
};
static const ProtobufCIntRange tari__rpc__wasm_info__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 1 }
};
const ProtobufCMessageDescriptor tari__rpc__wasm_info__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.WasmInfo",
"WasmInfo",
"Tari__Rpc__WasmInfo",
"tari.rpc",
sizeof(Tari__Rpc__WasmInfo),
1,
tari__rpc__wasm_info__field_descriptors,
tari__rpc__wasm_info__field_indices_by_name,
1, tari__rpc__wasm_info__number_ranges,
(ProtobufCMessageInit) tari__rpc__wasm_info__init,
NULL,NULL,NULL /* reserved[123] */
};
#define tari__rpc__flow_info__field_descriptors NULL
#define tari__rpc__flow_info__field_indices_by_name NULL
#define tari__rpc__flow_info__number_ranges NULL
const ProtobufCMessageDescriptor tari__rpc__flow_info__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.FlowInfo",
"FlowInfo",
"Tari__Rpc__FlowInfo",
"tari.rpc",
sizeof(Tari__Rpc__FlowInfo),
0,
tari__rpc__flow_info__field_descriptors,
tari__rpc__flow_info__field_indices_by_name,
0, tari__rpc__flow_info__number_ranges,
(ProtobufCMessageInit) tari__rpc__flow_info__init,
NULL,NULL,NULL /* reserved[123] */
};
#define tari__rpc__manifest_info__field_descriptors NULL
#define tari__rpc__manifest_info__field_indices_by_name NULL
#define tari__rpc__manifest_info__number_ranges NULL
const ProtobufCMessageDescriptor tari__rpc__manifest_info__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.ManifestInfo",
"ManifestInfo",
"Tari__Rpc__ManifestInfo",
"tari.rpc",
sizeof(Tari__Rpc__ManifestInfo),
0,
tari__rpc__manifest_info__field_descriptors,
tari__rpc__manifest_info__field_indices_by_name,
0, tari__rpc__manifest_info__number_ranges,
(ProtobufCMessageInit) tari__rpc__manifest_info__init,
NULL,NULL,NULL /* reserved[123] */
};
static const ProtobufCFieldDescriptor tari__rpc__build_info__field_descriptors[2] =
{
{
"repo_url",
1,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_STRING,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BuildInfo, repo_url),
NULL,
&protobuf_c_empty_string,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
{
"commit_hash",
2,
PROTOBUF_C_LABEL_NONE,
PROTOBUF_C_TYPE_BYTES,
0, /* quantifier_offset */
offsetof(Tari__Rpc__BuildInfo, commit_hash),
NULL,
NULL,
0, /* flags */
0,NULL,NULL /* reserved1,reserved2, etc */
},
};
static const unsigned tari__rpc__build_info__field_indices_by_name[] = {
1, /* field[1] = commit_hash */
0, /* field[0] = repo_url */
};
static const ProtobufCIntRange tari__rpc__build_info__number_ranges[1 + 1] =
{
{ 1, 0 },
{ 0, 2 }
};
const ProtobufCMessageDescriptor tari__rpc__build_info__descriptor =
{
PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC,
"tari.rpc.BuildInfo",
"BuildInfo",
"Tari__Rpc__BuildInfo",
"tari.rpc",
sizeof(Tari__Rpc__BuildInfo),
2,
tari__rpc__build_info__field_descriptors,
tari__rpc__build_info__field_indices_by_name,
1, tari__rpc__build_info__number_ranges,
(ProtobufCMessageInit) tari__rpc__build_info__init,
NULL,NULL,NULL /* reserved[123] */
};

View file

@ -1,377 +0,0 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: sidechain_types.proto */
#ifndef PROTOBUF_C_sidechain_5ftypes_2eproto__INCLUDED
#define PROTOBUF_C_sidechain_5ftypes_2eproto__INCLUDED
#include <protobuf-c/protobuf-c.h>
PROTOBUF_C__BEGIN_DECLS
#if PROTOBUF_C_VERSION_NUMBER < 1003000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1003003 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif
#include "types.pb-c.h"
typedef struct _Tari__Rpc__SideChainFeature Tari__Rpc__SideChainFeature;
typedef struct _Tari__Rpc__ValidatorNodeRegistration Tari__Rpc__ValidatorNodeRegistration;
typedef struct _Tari__Rpc__TemplateRegistration Tari__Rpc__TemplateRegistration;
typedef struct _Tari__Rpc__ConfidentialOutputData Tari__Rpc__ConfidentialOutputData;
typedef struct _Tari__Rpc__TemplateType Tari__Rpc__TemplateType;
typedef struct _Tari__Rpc__WasmInfo Tari__Rpc__WasmInfo;
typedef struct _Tari__Rpc__FlowInfo Tari__Rpc__FlowInfo;
typedef struct _Tari__Rpc__ManifestInfo Tari__Rpc__ManifestInfo;
typedef struct _Tari__Rpc__BuildInfo Tari__Rpc__BuildInfo;
/* --- enums --- */
/* --- messages --- */
typedef enum {
TARI__RPC__SIDE_CHAIN_FEATURE__SIDE_CHAIN_FEATURE__NOT_SET = 0,
TARI__RPC__SIDE_CHAIN_FEATURE__SIDE_CHAIN_FEATURE_VALIDATOR_NODE_REGISTRATION = 1,
TARI__RPC__SIDE_CHAIN_FEATURE__SIDE_CHAIN_FEATURE_TEMPLATE_REGISTRATION = 2,
TARI__RPC__SIDE_CHAIN_FEATURE__SIDE_CHAIN_FEATURE_CONFIDENTIAL_OUTPUT = 3
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(TARI__RPC__SIDE_CHAIN_FEATURE__SIDE_CHAIN_FEATURE)
} Tari__Rpc__SideChainFeature__SideChainFeatureCase;
struct _Tari__Rpc__SideChainFeature
{
ProtobufCMessage base;
Tari__Rpc__SideChainFeature__SideChainFeatureCase side_chain_feature_case;
union {
Tari__Rpc__ValidatorNodeRegistration *validator_node_registration;
Tari__Rpc__TemplateRegistration *template_registration;
Tari__Rpc__ConfidentialOutputData *confidential_output;
};
};
#define TARI__RPC__SIDE_CHAIN_FEATURE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__side_chain_feature__descriptor) \
, TARI__RPC__SIDE_CHAIN_FEATURE__SIDE_CHAIN_FEATURE__NOT_SET, {0} }
struct _Tari__Rpc__ValidatorNodeRegistration
{
ProtobufCMessage base;
ProtobufCBinaryData public_key;
Tari__Rpc__Signature *signature;
};
#define TARI__RPC__VALIDATOR_NODE_REGISTRATION__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__validator_node_registration__descriptor) \
, {0,NULL}, NULL }
struct _Tari__Rpc__TemplateRegistration
{
ProtobufCMessage base;
ProtobufCBinaryData author_public_key;
Tari__Rpc__Signature *author_signature;
char *template_name;
uint32_t template_version;
Tari__Rpc__TemplateType *template_type;
Tari__Rpc__BuildInfo *build_info;
ProtobufCBinaryData binary_sha;
char *binary_url;
};
#define TARI__RPC__TEMPLATE_REGISTRATION__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__template_registration__descriptor) \
, {0,NULL}, NULL, (char *)protobuf_c_empty_string, 0, NULL, NULL, {0,NULL}, (char *)protobuf_c_empty_string }
struct _Tari__Rpc__ConfidentialOutputData
{
ProtobufCMessage base;
ProtobufCBinaryData claim_public_key;
};
#define TARI__RPC__CONFIDENTIAL_OUTPUT_DATA__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__confidential_output_data__descriptor) \
, {0,NULL} }
typedef enum {
TARI__RPC__TEMPLATE_TYPE__TEMPLATE_TYPE__NOT_SET = 0,
TARI__RPC__TEMPLATE_TYPE__TEMPLATE_TYPE_WASM = 1,
TARI__RPC__TEMPLATE_TYPE__TEMPLATE_TYPE_FLOW = 2,
TARI__RPC__TEMPLATE_TYPE__TEMPLATE_TYPE_MANIFEST = 3
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(TARI__RPC__TEMPLATE_TYPE__TEMPLATE_TYPE)
} Tari__Rpc__TemplateType__TemplateTypeCase;
struct _Tari__Rpc__TemplateType
{
ProtobufCMessage base;
Tari__Rpc__TemplateType__TemplateTypeCase template_type_case;
union {
Tari__Rpc__WasmInfo *wasm;
Tari__Rpc__FlowInfo *flow;
Tari__Rpc__ManifestInfo *manifest;
};
};
#define TARI__RPC__TEMPLATE_TYPE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__template_type__descriptor) \
, TARI__RPC__TEMPLATE_TYPE__TEMPLATE_TYPE__NOT_SET, {0} }
struct _Tari__Rpc__WasmInfo
{
ProtobufCMessage base;
uint32_t abi_version;
};
#define TARI__RPC__WASM_INFO__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__wasm_info__descriptor) \
, 0 }
struct _Tari__Rpc__FlowInfo
{
ProtobufCMessage base;
};
#define TARI__RPC__FLOW_INFO__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__flow_info__descriptor) \
}
struct _Tari__Rpc__ManifestInfo
{
ProtobufCMessage base;
};
#define TARI__RPC__MANIFEST_INFO__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__manifest_info__descriptor) \
}
struct _Tari__Rpc__BuildInfo
{
ProtobufCMessage base;
char *repo_url;
ProtobufCBinaryData commit_hash;
};
#define TARI__RPC__BUILD_INFO__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__build_info__descriptor) \
, (char *)protobuf_c_empty_string, {0,NULL} }
/* Tari__Rpc__SideChainFeature methods */
void tari__rpc__side_chain_feature__init
(Tari__Rpc__SideChainFeature *message);
size_t tari__rpc__side_chain_feature__get_packed_size
(const Tari__Rpc__SideChainFeature *message);
size_t tari__rpc__side_chain_feature__pack
(const Tari__Rpc__SideChainFeature *message,
uint8_t *out);
size_t tari__rpc__side_chain_feature__pack_to_buffer
(const Tari__Rpc__SideChainFeature *message,
ProtobufCBuffer *buffer);
Tari__Rpc__SideChainFeature *
tari__rpc__side_chain_feature__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__side_chain_feature__free_unpacked
(Tari__Rpc__SideChainFeature *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__ValidatorNodeRegistration methods */
void tari__rpc__validator_node_registration__init
(Tari__Rpc__ValidatorNodeRegistration *message);
size_t tari__rpc__validator_node_registration__get_packed_size
(const Tari__Rpc__ValidatorNodeRegistration *message);
size_t tari__rpc__validator_node_registration__pack
(const Tari__Rpc__ValidatorNodeRegistration *message,
uint8_t *out);
size_t tari__rpc__validator_node_registration__pack_to_buffer
(const Tari__Rpc__ValidatorNodeRegistration *message,
ProtobufCBuffer *buffer);
Tari__Rpc__ValidatorNodeRegistration *
tari__rpc__validator_node_registration__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__validator_node_registration__free_unpacked
(Tari__Rpc__ValidatorNodeRegistration *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__TemplateRegistration methods */
void tari__rpc__template_registration__init
(Tari__Rpc__TemplateRegistration *message);
size_t tari__rpc__template_registration__get_packed_size
(const Tari__Rpc__TemplateRegistration *message);
size_t tari__rpc__template_registration__pack
(const Tari__Rpc__TemplateRegistration *message,
uint8_t *out);
size_t tari__rpc__template_registration__pack_to_buffer
(const Tari__Rpc__TemplateRegistration *message,
ProtobufCBuffer *buffer);
Tari__Rpc__TemplateRegistration *
tari__rpc__template_registration__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__template_registration__free_unpacked
(Tari__Rpc__TemplateRegistration *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__ConfidentialOutputData methods */
void tari__rpc__confidential_output_data__init
(Tari__Rpc__ConfidentialOutputData *message);
size_t tari__rpc__confidential_output_data__get_packed_size
(const Tari__Rpc__ConfidentialOutputData *message);
size_t tari__rpc__confidential_output_data__pack
(const Tari__Rpc__ConfidentialOutputData *message,
uint8_t *out);
size_t tari__rpc__confidential_output_data__pack_to_buffer
(const Tari__Rpc__ConfidentialOutputData *message,
ProtobufCBuffer *buffer);
Tari__Rpc__ConfidentialOutputData *
tari__rpc__confidential_output_data__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__confidential_output_data__free_unpacked
(Tari__Rpc__ConfidentialOutputData *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__TemplateType methods */
void tari__rpc__template_type__init
(Tari__Rpc__TemplateType *message);
size_t tari__rpc__template_type__get_packed_size
(const Tari__Rpc__TemplateType *message);
size_t tari__rpc__template_type__pack
(const Tari__Rpc__TemplateType *message,
uint8_t *out);
size_t tari__rpc__template_type__pack_to_buffer
(const Tari__Rpc__TemplateType *message,
ProtobufCBuffer *buffer);
Tari__Rpc__TemplateType *
tari__rpc__template_type__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__template_type__free_unpacked
(Tari__Rpc__TemplateType *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__WasmInfo methods */
void tari__rpc__wasm_info__init
(Tari__Rpc__WasmInfo *message);
size_t tari__rpc__wasm_info__get_packed_size
(const Tari__Rpc__WasmInfo *message);
size_t tari__rpc__wasm_info__pack
(const Tari__Rpc__WasmInfo *message,
uint8_t *out);
size_t tari__rpc__wasm_info__pack_to_buffer
(const Tari__Rpc__WasmInfo *message,
ProtobufCBuffer *buffer);
Tari__Rpc__WasmInfo *
tari__rpc__wasm_info__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__wasm_info__free_unpacked
(Tari__Rpc__WasmInfo *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__FlowInfo methods */
void tari__rpc__flow_info__init
(Tari__Rpc__FlowInfo *message);
size_t tari__rpc__flow_info__get_packed_size
(const Tari__Rpc__FlowInfo *message);
size_t tari__rpc__flow_info__pack
(const Tari__Rpc__FlowInfo *message,
uint8_t *out);
size_t tari__rpc__flow_info__pack_to_buffer
(const Tari__Rpc__FlowInfo *message,
ProtobufCBuffer *buffer);
Tari__Rpc__FlowInfo *
tari__rpc__flow_info__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__flow_info__free_unpacked
(Tari__Rpc__FlowInfo *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__ManifestInfo methods */
void tari__rpc__manifest_info__init
(Tari__Rpc__ManifestInfo *message);
size_t tari__rpc__manifest_info__get_packed_size
(const Tari__Rpc__ManifestInfo *message);
size_t tari__rpc__manifest_info__pack
(const Tari__Rpc__ManifestInfo *message,
uint8_t *out);
size_t tari__rpc__manifest_info__pack_to_buffer
(const Tari__Rpc__ManifestInfo *message,
ProtobufCBuffer *buffer);
Tari__Rpc__ManifestInfo *
tari__rpc__manifest_info__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__manifest_info__free_unpacked
(Tari__Rpc__ManifestInfo *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__BuildInfo methods */
void tari__rpc__build_info__init
(Tari__Rpc__BuildInfo *message);
size_t tari__rpc__build_info__get_packed_size
(const Tari__Rpc__BuildInfo *message);
size_t tari__rpc__build_info__pack
(const Tari__Rpc__BuildInfo *message,
uint8_t *out);
size_t tari__rpc__build_info__pack_to_buffer
(const Tari__Rpc__BuildInfo *message,
ProtobufCBuffer *buffer);
Tari__Rpc__BuildInfo *
tari__rpc__build_info__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__build_info__free_unpacked
(Tari__Rpc__BuildInfo *message,
ProtobufCAllocator *allocator);
/* --- per-message closures --- */
typedef void (*Tari__Rpc__SideChainFeature_Closure)
(const Tari__Rpc__SideChainFeature *message,
void *closure_data);
typedef void (*Tari__Rpc__ValidatorNodeRegistration_Closure)
(const Tari__Rpc__ValidatorNodeRegistration *message,
void *closure_data);
typedef void (*Tari__Rpc__TemplateRegistration_Closure)
(const Tari__Rpc__TemplateRegistration *message,
void *closure_data);
typedef void (*Tari__Rpc__ConfidentialOutputData_Closure)
(const Tari__Rpc__ConfidentialOutputData *message,
void *closure_data);
typedef void (*Tari__Rpc__TemplateType_Closure)
(const Tari__Rpc__TemplateType *message,
void *closure_data);
typedef void (*Tari__Rpc__WasmInfo_Closure)
(const Tari__Rpc__WasmInfo *message,
void *closure_data);
typedef void (*Tari__Rpc__FlowInfo_Closure)
(const Tari__Rpc__FlowInfo *message,
void *closure_data);
typedef void (*Tari__Rpc__ManifestInfo_Closure)
(const Tari__Rpc__ManifestInfo *message,
void *closure_data);
typedef void (*Tari__Rpc__BuildInfo_Closure)
(const Tari__Rpc__BuildInfo *message,
void *closure_data);
/* --- services --- */
/* --- descriptors --- */
extern const ProtobufCMessageDescriptor tari__rpc__side_chain_feature__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__validator_node_registration__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__template_registration__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__confidential_output_data__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__template_type__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__wasm_info__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__flow_info__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__manifest_info__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__build_info__descriptor;
PROTOBUF_C__END_DECLS
#endif /* PROTOBUF_C_sidechain_5ftypes_2eproto__INCLUDED */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,27 @@
// Generated by the gRPC C++ plugin.
// If you make any local change, they will be lost.
// source: transaction.proto
#include "transaction.pb.h"
#include "transaction.grpc.pb.h"
#include <functional>
#include <grpcpp/support/async_stream.h>
#include <grpcpp/support/async_unary_call.h>
#include <grpcpp/impl/channel_interface.h>
#include <grpcpp/impl/client_unary_call.h>
#include <grpcpp/support/client_callback.h>
#include <grpcpp/support/message_allocator.h>
#include <grpcpp/support/method_handler.h>
#include <grpcpp/impl/rpc_service_method.h>
#include <grpcpp/support/server_callback.h>
#include <grpcpp/impl/server_callback_handlers.h>
#include <grpcpp/server_context.h>
#include <grpcpp/impl/service_type.h>
#include <grpcpp/support/sync_stream.h>
namespace tari {
namespace rpc {
} // namespace tari
} // namespace rpc

View file

@ -0,0 +1,57 @@
// Generated by the gRPC C++ plugin.
// If you make any local change, they will be lost.
// source: transaction.proto
// Original file comments:
// Copyright 2020. The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
// following disclaimer in the documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
// products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef GRPC_transaction_2eproto__INCLUDED
#define GRPC_transaction_2eproto__INCLUDED
#include "transaction.pb.h"
#include <functional>
#include <grpcpp/generic/async_generic_service.h>
#include <grpcpp/support/async_stream.h>
#include <grpcpp/support/async_unary_call.h>
#include <grpcpp/support/client_callback.h>
#include <grpcpp/client_context.h>
#include <grpcpp/completion_queue.h>
#include <grpcpp/support/message_allocator.h>
#include <grpcpp/support/method_handler.h>
#include <grpcpp/impl/proto_utils.h>
#include <grpcpp/impl/rpc_method.h>
#include <grpcpp/support/server_callback.h>
#include <grpcpp/impl/server_callback_handlers.h>
#include <grpcpp/server_context.h>
#include <grpcpp/impl/service_type.h>
#include <grpcpp/support/status.h>
#include <grpcpp/support/stub_options.h>
#include <grpcpp/support/sync_stream.h>
namespace tari {
namespace rpc {
} // namespace rpc
} // namespace tari
#endif // GRPC_transaction_2eproto__INCLUDED

File diff suppressed because it is too large Load diff

View file

@ -1,525 +0,0 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: transaction.proto */
#ifndef PROTOBUF_C_transaction_2eproto__INCLUDED
#define PROTOBUF_C_transaction_2eproto__INCLUDED
#include <protobuf-c/protobuf-c.h>
PROTOBUF_C__BEGIN_DECLS
#if PROTOBUF_C_VERSION_NUMBER < 1003000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1003003 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif
#include "types.pb-c.h"
#include "sidechain_types.pb-c.h"
typedef struct _Tari__Rpc__TransactionKernel Tari__Rpc__TransactionKernel;
typedef struct _Tari__Rpc__TransactionInput Tari__Rpc__TransactionInput;
typedef struct _Tari__Rpc__TransactionOutput Tari__Rpc__TransactionOutput;
typedef struct _Tari__Rpc__OutputFeatures Tari__Rpc__OutputFeatures;
typedef struct _Tari__Rpc__AggregateBody Tari__Rpc__AggregateBody;
typedef struct _Tari__Rpc__Transaction Tari__Rpc__Transaction;
typedef struct _Tari__Rpc__UnblindedOutput Tari__Rpc__UnblindedOutput;
/* --- enums --- */
/* --- messages --- */
/*
* The transaction kernel tracks the excess for a given transaction. For an explanation of what the excess is, and
* why it is necessary, refer to the
* [Mimblewimble TLU post](https://tlu.tarilabs.com/protocols/mimblewimble-1/sources/PITCHME.link.html?highlight=mimblewimble#mimblewimble).
* The kernel also tracks other transaction metadata, such as the lock height for the transaction (i.e. the earliest
* this transaction can be mined) and the transaction fee, in cleartext.
*/
struct _Tari__Rpc__TransactionKernel
{
ProtobufCMessage base;
/*
* Options for a kernel's structure or use
*/
uint32_t features;
/*
* / Fee originally included in the transaction this proof is for (in MicroMinotari)
*/
uint64_t fee;
/*
* This kernel is not valid earlier than lock_height blocks
* The max lock_height of all *inputs* to this transaction
*/
uint64_t lock_height;
/*
* Remainder of the sum of all transaction commitments. If the transaction
* is well formed, amounts components should sum to zero and the excess
* is hence a valid public key.
*/
ProtobufCBinaryData excess;
/*
* The signature proving the excess is a valid public key, which signs
* the transaction fee.
*/
Tari__Rpc__Signature *excess_sig;
/*
* The hash of the kernel, as it appears in the MMR
*/
ProtobufCBinaryData hash;
/*
* Version
*/
uint32_t version;
/*
* Optional burned commitment
*/
ProtobufCBinaryData burn_commitment;
};
#define TARI__RPC__TRANSACTION_KERNEL__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__transaction_kernel__descriptor) \
, 0, 0, 0, {0,NULL}, NULL, {0,NULL}, 0, {0,NULL} }
/*
* A transaction input.
* Primarily a reference to an output being spent by the transaction.
*/
struct _Tari__Rpc__TransactionInput
{
ProtobufCMessage base;
/*
* The features of the output being spent. We will check maturity for all outputs.
*/
Tari__Rpc__OutputFeatures *features;
/*
* The commitment referencing the output being spent.
*/
ProtobufCBinaryData commitment;
/*
* Hash of the input, as it appears in the MMR
*/
ProtobufCBinaryData hash;
/*
* The serialised script
*/
ProtobufCBinaryData script;
/*
* The script input data, if any
*/
ProtobufCBinaryData input_data;
/*
* A signature with k_s, signing the script, input data, and mined height
*/
Tari__Rpc__ComAndPubSignature *script_signature;
/*
* The offset public key, K_O
*/
ProtobufCBinaryData sender_offset_public_key;
/*
* The hash of the output this input is spending
*/
ProtobufCBinaryData output_hash;
/*
* Covenant
*/
ProtobufCBinaryData covenant;
/*
* Version
*/
uint32_t version;
/*
* The encrypted data
*/
ProtobufCBinaryData encrypted_data;
/*
* The minimum value of the commitment that is proven by the range proof (in MicroMinotari)
*/
uint64_t minimum_value_promise;
/*
* The metadata signature for output this input is spending
*/
Tari__Rpc__ComAndPubSignature *metadata_signature;
/*
* The rangeproof hash for output this input is spending
*/
ProtobufCBinaryData rangeproof_hash;
};
#define TARI__RPC__TRANSACTION_INPUT__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__transaction_input__descriptor) \
, NULL, {0,NULL}, {0,NULL}, {0,NULL}, {0,NULL}, NULL, {0,NULL}, {0,NULL}, {0,NULL}, 0, {0,NULL}, 0, NULL, {0,NULL} }
/*
* Output for a transaction, defining the new ownership of coins that are being transferred. The commitment is a
* blinded value for the output while the range proof guarantees the commitment includes a positive value without
* overflow and the ownership of the private key.
*/
struct _Tari__Rpc__TransactionOutput
{
ProtobufCMessage base;
/*
* Options for an output's structure or use
*/
Tari__Rpc__OutputFeatures *features;
/*
* The homomorphic commitment representing the output amount
*/
ProtobufCBinaryData commitment;
/*
* A proof that the commitment is in the right range
*/
Tari__Rpc__RangeProof *range_proof;
/*
* The hash of the output, as it appears in the MMR
*/
ProtobufCBinaryData hash;
/*
* Tari script serialised script
*/
ProtobufCBinaryData script;
/*
* Tari script offset public key, K_O
*/
ProtobufCBinaryData sender_offset_public_key;
/*
* Metadata signature with the homomorphic commitment private values (amount and blinding factor) and the sender
* offset private key
*/
Tari__Rpc__ComAndPubSignature *metadata_signature;
/*
* Covenant
*/
ProtobufCBinaryData covenant;
/*
* Version
*/
uint32_t version;
/*
* Encrypted Pedersen commitment openings (value and mask) for the output
*/
ProtobufCBinaryData encrypted_data;
/*
* The minimum value of the commitment that is proven by the range proof (in MicroMinotari)
*/
uint64_t minimum_value_promise;
};
#define TARI__RPC__TRANSACTION_OUTPUT__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__transaction_output__descriptor) \
, NULL, {0,NULL}, NULL, {0,NULL}, {0,NULL}, {0,NULL}, NULL, {0,NULL}, 0, {0,NULL}, 0 }
/*
* Options for UTXOs
*/
struct _Tari__Rpc__OutputFeatures
{
ProtobufCMessage base;
/*
* Version
*/
uint32_t version;
/*
* The type of output, eg Coinbase, all of which have different consensus rules
*/
uint32_t output_type;
/*
* The maturity of the specific UTXO. This is the min lock height at which an UTXO can be spend. Coinbase UTXO
* require a min maturity of the Coinbase_lock_height, this should be checked on receiving new blocks.
*/
uint64_t maturity;
/*
* Additional arbitrary info in coinbase transactions supplied by miners
*/
ProtobufCBinaryData coinbase_extra;
/*
* Features that are specific to a side chain
*/
Tari__Rpc__SideChainFeature *sidechain_feature;
/*
* The type of range proof used in the output
*/
uint32_t range_proof_type;
};
#define TARI__RPC__OUTPUT_FEATURES__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__output_features__descriptor) \
, 0, 0, 0, {0,NULL}, NULL, 0 }
/*
* The components of the block or transaction. The same struct can be used for either, since in Mimblewimble,
* cut-through means that blocks and transactions have the same structure. The inputs, outputs and kernels should
* be sorted by their Blake2b-256bit digest hash
*/
struct _Tari__Rpc__AggregateBody
{
ProtobufCMessage base;
/*
* List of inputs spent by the transaction.
*/
size_t n_inputs;
Tari__Rpc__TransactionInput **inputs;
/*
* List of outputs the transaction produces.
*/
size_t n_outputs;
Tari__Rpc__TransactionOutput **outputs;
/*
* Kernels contain the excesses and their signatures for transaction
*/
size_t n_kernels;
Tari__Rpc__TransactionKernel **kernels;
};
#define TARI__RPC__AGGREGATE_BODY__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__aggregate_body__descriptor) \
, 0,NULL, 0,NULL, 0,NULL }
/*
* A transaction which consists of a kernel offset and an aggregate body made up of inputs, outputs and kernels.
*/
struct _Tari__Rpc__Transaction
{
ProtobufCMessage base;
ProtobufCBinaryData offset;
Tari__Rpc__AggregateBody *body;
ProtobufCBinaryData script_offset;
};
#define TARI__RPC__TRANSACTION__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__transaction__descriptor) \
, {0,NULL}, NULL, {0,NULL} }
struct _Tari__Rpc__UnblindedOutput
{
ProtobufCMessage base;
/*
* Value of the output
*/
uint64_t value;
/*
* Spending key of the output
*/
ProtobufCBinaryData spending_key;
/*
* Options for an output's structure or use
*/
Tari__Rpc__OutputFeatures *features;
/*
* Tari script serialised script
*/
ProtobufCBinaryData script;
/*
* Tari script input data for spending
*/
ProtobufCBinaryData input_data;
/*
* Tari script private key
*/
ProtobufCBinaryData script_private_key;
/*
* Tari script offset pubkey, K_O
*/
ProtobufCBinaryData sender_offset_public_key;
/*
* UTXO signature with the script offset private key, k_O
*/
Tari__Rpc__ComAndPubSignature *metadata_signature;
/*
* The minimum height the script allows this output to be spent
*/
uint64_t script_lock_height;
/*
* Covenant
*/
ProtobufCBinaryData covenant;
/*
* Encrypted data
*/
ProtobufCBinaryData encrypted_data;
/*
* The minimum value of the commitment that is proven by the range proof (in MicroMinotari)
*/
uint64_t minimum_value_promise;
};
#define TARI__RPC__UNBLINDED_OUTPUT__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__unblinded_output__descriptor) \
, 0, {0,NULL}, NULL, {0,NULL}, {0,NULL}, {0,NULL}, {0,NULL}, NULL, 0, {0,NULL}, {0,NULL}, 0 }
/* Tari__Rpc__TransactionKernel methods */
void tari__rpc__transaction_kernel__init
(Tari__Rpc__TransactionKernel *message);
size_t tari__rpc__transaction_kernel__get_packed_size
(const Tari__Rpc__TransactionKernel *message);
size_t tari__rpc__transaction_kernel__pack
(const Tari__Rpc__TransactionKernel *message,
uint8_t *out);
size_t tari__rpc__transaction_kernel__pack_to_buffer
(const Tari__Rpc__TransactionKernel *message,
ProtobufCBuffer *buffer);
Tari__Rpc__TransactionKernel *
tari__rpc__transaction_kernel__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__transaction_kernel__free_unpacked
(Tari__Rpc__TransactionKernel *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__TransactionInput methods */
void tari__rpc__transaction_input__init
(Tari__Rpc__TransactionInput *message);
size_t tari__rpc__transaction_input__get_packed_size
(const Tari__Rpc__TransactionInput *message);
size_t tari__rpc__transaction_input__pack
(const Tari__Rpc__TransactionInput *message,
uint8_t *out);
size_t tari__rpc__transaction_input__pack_to_buffer
(const Tari__Rpc__TransactionInput *message,
ProtobufCBuffer *buffer);
Tari__Rpc__TransactionInput *
tari__rpc__transaction_input__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__transaction_input__free_unpacked
(Tari__Rpc__TransactionInput *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__TransactionOutput methods */
void tari__rpc__transaction_output__init
(Tari__Rpc__TransactionOutput *message);
size_t tari__rpc__transaction_output__get_packed_size
(const Tari__Rpc__TransactionOutput *message);
size_t tari__rpc__transaction_output__pack
(const Tari__Rpc__TransactionOutput *message,
uint8_t *out);
size_t tari__rpc__transaction_output__pack_to_buffer
(const Tari__Rpc__TransactionOutput *message,
ProtobufCBuffer *buffer);
Tari__Rpc__TransactionOutput *
tari__rpc__transaction_output__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__transaction_output__free_unpacked
(Tari__Rpc__TransactionOutput *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__OutputFeatures methods */
void tari__rpc__output_features__init
(Tari__Rpc__OutputFeatures *message);
size_t tari__rpc__output_features__get_packed_size
(const Tari__Rpc__OutputFeatures *message);
size_t tari__rpc__output_features__pack
(const Tari__Rpc__OutputFeatures *message,
uint8_t *out);
size_t tari__rpc__output_features__pack_to_buffer
(const Tari__Rpc__OutputFeatures *message,
ProtobufCBuffer *buffer);
Tari__Rpc__OutputFeatures *
tari__rpc__output_features__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__output_features__free_unpacked
(Tari__Rpc__OutputFeatures *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__AggregateBody methods */
void tari__rpc__aggregate_body__init
(Tari__Rpc__AggregateBody *message);
size_t tari__rpc__aggregate_body__get_packed_size
(const Tari__Rpc__AggregateBody *message);
size_t tari__rpc__aggregate_body__pack
(const Tari__Rpc__AggregateBody *message,
uint8_t *out);
size_t tari__rpc__aggregate_body__pack_to_buffer
(const Tari__Rpc__AggregateBody *message,
ProtobufCBuffer *buffer);
Tari__Rpc__AggregateBody *
tari__rpc__aggregate_body__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__aggregate_body__free_unpacked
(Tari__Rpc__AggregateBody *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__Transaction methods */
void tari__rpc__transaction__init
(Tari__Rpc__Transaction *message);
size_t tari__rpc__transaction__get_packed_size
(const Tari__Rpc__Transaction *message);
size_t tari__rpc__transaction__pack
(const Tari__Rpc__Transaction *message,
uint8_t *out);
size_t tari__rpc__transaction__pack_to_buffer
(const Tari__Rpc__Transaction *message,
ProtobufCBuffer *buffer);
Tari__Rpc__Transaction *
tari__rpc__transaction__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__transaction__free_unpacked
(Tari__Rpc__Transaction *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__UnblindedOutput methods */
void tari__rpc__unblinded_output__init
(Tari__Rpc__UnblindedOutput *message);
size_t tari__rpc__unblinded_output__get_packed_size
(const Tari__Rpc__UnblindedOutput *message);
size_t tari__rpc__unblinded_output__pack
(const Tari__Rpc__UnblindedOutput *message,
uint8_t *out);
size_t tari__rpc__unblinded_output__pack_to_buffer
(const Tari__Rpc__UnblindedOutput *message,
ProtobufCBuffer *buffer);
Tari__Rpc__UnblindedOutput *
tari__rpc__unblinded_output__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__unblinded_output__free_unpacked
(Tari__Rpc__UnblindedOutput *message,
ProtobufCAllocator *allocator);
/* --- per-message closures --- */
typedef void (*Tari__Rpc__TransactionKernel_Closure)
(const Tari__Rpc__TransactionKernel *message,
void *closure_data);
typedef void (*Tari__Rpc__TransactionInput_Closure)
(const Tari__Rpc__TransactionInput *message,
void *closure_data);
typedef void (*Tari__Rpc__TransactionOutput_Closure)
(const Tari__Rpc__TransactionOutput *message,
void *closure_data);
typedef void (*Tari__Rpc__OutputFeatures_Closure)
(const Tari__Rpc__OutputFeatures *message,
void *closure_data);
typedef void (*Tari__Rpc__AggregateBody_Closure)
(const Tari__Rpc__AggregateBody *message,
void *closure_data);
typedef void (*Tari__Rpc__Transaction_Closure)
(const Tari__Rpc__Transaction *message,
void *closure_data);
typedef void (*Tari__Rpc__UnblindedOutput_Closure)
(const Tari__Rpc__UnblindedOutput *message,
void *closure_data);
/* --- services --- */
/* --- descriptors --- */
extern const ProtobufCMessageDescriptor tari__rpc__transaction_kernel__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__transaction_input__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__transaction_output__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__output_features__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__aggregate_body__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__transaction__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__unblinded_output__descriptor;
PROTOBUF_C__END_DECLS
#endif /* PROTOBUF_C_transaction_2eproto__INCLUDED */

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,27 @@
// Generated by the gRPC C++ plugin.
// If you make any local change, they will be lost.
// source: types.proto
#include "types.pb.h"
#include "types.grpc.pb.h"
#include <functional>
#include <grpcpp/support/async_stream.h>
#include <grpcpp/support/async_unary_call.h>
#include <grpcpp/impl/channel_interface.h>
#include <grpcpp/impl/client_unary_call.h>
#include <grpcpp/support/client_callback.h>
#include <grpcpp/support/message_allocator.h>
#include <grpcpp/support/method_handler.h>
#include <grpcpp/impl/rpc_service_method.h>
#include <grpcpp/support/server_callback.h>
#include <grpcpp/impl/server_callback_handlers.h>
#include <grpcpp/server_context.h>
#include <grpcpp/impl/service_type.h>
#include <grpcpp/support/sync_stream.h>
namespace tari {
namespace rpc {
} // namespace tari
} // namespace rpc

View file

@ -0,0 +1,57 @@
// Generated by the gRPC C++ plugin.
// If you make any local change, they will be lost.
// source: types.proto
// Original file comments:
// Copyright 2020. The Tari Project
//
// Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
// following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following
// disclaimer.
//
// 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
// following disclaimer in the documentation and/or other materials provided with the distribution.
//
// 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote
// products derived from this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
// INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef GRPC_types_2eproto__INCLUDED
#define GRPC_types_2eproto__INCLUDED
#include "types.pb.h"
#include <functional>
#include <grpcpp/generic/async_generic_service.h>
#include <grpcpp/support/async_stream.h>
#include <grpcpp/support/async_unary_call.h>
#include <grpcpp/support/client_callback.h>
#include <grpcpp/client_context.h>
#include <grpcpp/completion_queue.h>
#include <grpcpp/support/message_allocator.h>
#include <grpcpp/support/method_handler.h>
#include <grpcpp/impl/proto_utils.h>
#include <grpcpp/impl/rpc_method.h>
#include <grpcpp/support/server_callback.h>
#include <grpcpp/impl/server_callback_handlers.h>
#include <grpcpp/server_context.h>
#include <grpcpp/impl/service_type.h>
#include <grpcpp/support/status.h>
#include <grpcpp/support/stub_options.h>
#include <grpcpp/support/sync_stream.h>
namespace tari {
namespace rpc {
} // namespace rpc
} // namespace tari
#endif // GRPC_types_2eproto__INCLUDED

File diff suppressed because it is too large Load diff

View file

@ -1,570 +0,0 @@
/* Generated by the protocol buffer compiler. DO NOT EDIT! */
/* Generated from: types.proto */
#ifndef PROTOBUF_C_types_2eproto__INCLUDED
#define PROTOBUF_C_types_2eproto__INCLUDED
#include <protobuf-c/protobuf-c.h>
PROTOBUF_C__BEGIN_DECLS
#if PROTOBUF_C_VERSION_NUMBER < 1003000
# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers.
#elif 1003003 < PROTOBUF_C_MIN_COMPILER_VERSION
# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c.
#endif
typedef struct _Tari__Rpc__Range Tari__Rpc__Range;
typedef struct _Tari__Rpc__Empty Tari__Rpc__Empty;
typedef struct _Tari__Rpc__BlockHeight Tari__Rpc__BlockHeight;
typedef struct _Tari__Rpc__Signature Tari__Rpc__Signature;
typedef struct _Tari__Rpc__ComAndPubSignature Tari__Rpc__ComAndPubSignature;
typedef struct _Tari__Rpc__CommitmentSignature Tari__Rpc__CommitmentSignature;
typedef struct _Tari__Rpc__PowAlgorithmConstants Tari__Rpc__PowAlgorithmConstants;
typedef struct _Tari__Rpc__WeightParams Tari__Rpc__WeightParams;
typedef struct _Tari__Rpc__OutputsVersion Tari__Rpc__OutputsVersion;
typedef struct _Tari__Rpc__PermittedRangeProofs Tari__Rpc__PermittedRangeProofs;
typedef struct _Tari__Rpc__RangeProof Tari__Rpc__RangeProof;
typedef struct _Tari__Rpc__ConsensusConstants Tari__Rpc__ConsensusConstants;
typedef struct _Tari__Rpc__ConsensusConstants__ProofOfWorkEntry Tari__Rpc__ConsensusConstants__ProofOfWorkEntry;
/* --- enums --- */
/*
* / Output types
*/
typedef enum _Tari__Rpc__OutputType {
TARI__RPC__OUTPUT_TYPE__STANDARD = 0,
TARI__RPC__OUTPUT_TYPE__COINBASE = 1,
TARI__RPC__OUTPUT_TYPE__BURN = 2,
TARI__RPC__OUTPUT_TYPE__VALIDATOR_NODE_REGISTRATION = 3,
TARI__RPC__OUTPUT_TYPE__CODE_TEMPLATE_REGISTRATION = 4
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(TARI__RPC__OUTPUT_TYPE)
} Tari__Rpc__OutputType;
/*
* / Range proof types
*/
typedef enum _Tari__Rpc__RangeProofType {
TARI__RPC__RANGE_PROOF_TYPE__BULLETPROOF_PLUS = 0,
TARI__RPC__RANGE_PROOF_TYPE__REVEALED_VALUE = 1
PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(TARI__RPC__RANGE_PROOF_TYPE)
} Tari__Rpc__RangeProofType;
/* --- messages --- */
/*
* / An unsigned range interface to more accurately represent Rust native Range's
*/
struct _Tari__Rpc__Range
{
ProtobufCMessage base;
uint64_t min;
uint64_t max;
};
#define TARI__RPC__RANGE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__range__descriptor) \
, 0, 0 }
/*
* / An Empty placeholder for endpoints without request parameters
*/
struct _Tari__Rpc__Empty
{
ProtobufCMessage base;
};
#define TARI__RPC__EMPTY__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__empty__descriptor) \
}
/*
* / Define an interface for block height
*/
struct _Tari__Rpc__BlockHeight
{
ProtobufCMessage base;
uint64_t block_height;
};
#define TARI__RPC__BLOCK_HEIGHT__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__block_height__descriptor) \
, 0 }
/*
* Define the explicit Signature implementation for the Minotari base layer. A different signature scheme can be
* employed by redefining this type.
*/
struct _Tari__Rpc__Signature
{
ProtobufCMessage base;
ProtobufCBinaryData public_nonce;
ProtobufCBinaryData signature;
};
#define TARI__RPC__SIGNATURE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__signature__descriptor) \
, {0,NULL}, {0,NULL} }
/*
* Define the explicit ComAndPubSignature implementation for the Minotari base layer. A different signature scheme can be
* employed by redefining this type.
*/
struct _Tari__Rpc__ComAndPubSignature
{
ProtobufCMessage base;
ProtobufCBinaryData ephemeral_commitment;
ProtobufCBinaryData ephemeral_pubkey;
ProtobufCBinaryData u_a;
ProtobufCBinaryData u_x;
ProtobufCBinaryData u_y;
};
#define TARI__RPC__COM_AND_PUB_SIGNATURE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__com_and_pub_signature__descriptor) \
, {0,NULL}, {0,NULL}, {0,NULL}, {0,NULL}, {0,NULL} }
/*
* Define the explicit CommitmentSignature implementation for the Minotari base layer. A different signature scheme can be
* employed by redefining this type
*/
struct _Tari__Rpc__CommitmentSignature
{
ProtobufCMessage base;
ProtobufCBinaryData public_nonce;
ProtobufCBinaryData u;
ProtobufCBinaryData v;
};
#define TARI__RPC__COMMITMENT_SIGNATURE__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__commitment_signature__descriptor) \
, {0,NULL}, {0,NULL}, {0,NULL} }
/*
* / PoW Algorithm constants
*/
struct _Tari__Rpc__PowAlgorithmConstants
{
ProtobufCMessage base;
uint64_t min_difficulty;
uint64_t max_difficulty;
uint64_t target_time;
};
#define TARI__RPC__POW_ALGORITHM_CONSTANTS__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__pow_algorithm_constants__descriptor) \
, 0, 0, 0 }
/*
* / Weight params
*/
struct _Tari__Rpc__WeightParams
{
ProtobufCMessage base;
uint64_t kernel_weight;
uint64_t input_weight;
uint64_t output_weight;
uint64_t features_and_scripts_bytes_per_gram;
};
#define TARI__RPC__WEIGHT_PARAMS__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__weight_params__descriptor) \
, 0, 0, 0, 0 }
/*
* / Output version
*/
struct _Tari__Rpc__OutputsVersion
{
ProtobufCMessage base;
Tari__Rpc__Range *outputs;
Tari__Rpc__Range *features;
};
#define TARI__RPC__OUTPUTS_VERSION__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__outputs_version__descriptor) \
, NULL, NULL }
struct _Tari__Rpc__PermittedRangeProofs
{
ProtobufCMessage base;
Tari__Rpc__OutputType output_type;
size_t n_range_proof_types;
Tari__Rpc__RangeProofType *range_proof_types;
};
#define TARI__RPC__PERMITTED_RANGE_PROOFS__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__permitted_range_proofs__descriptor) \
, TARI__RPC__OUTPUT_TYPE__STANDARD, 0,NULL }
/*
* / Range proof
*/
struct _Tari__Rpc__RangeProof
{
ProtobufCMessage base;
ProtobufCBinaryData proof_bytes;
};
#define TARI__RPC__RANGE_PROOF__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__range_proof__descriptor) \
, {0,NULL} }
struct _Tari__Rpc__ConsensusConstants__ProofOfWorkEntry
{
ProtobufCMessage base;
uint32_t key;
Tari__Rpc__PowAlgorithmConstants *value;
};
#define TARI__RPC__CONSENSUS_CONSTANTS__PROOF_OF_WORK_ENTRY__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__consensus_constants__proof_of_work_entry__descriptor) \
, 0, NULL }
/*
* / Consensus Constants response
*/
struct _Tari__Rpc__ConsensusConstants
{
ProtobufCMessage base;
uint64_t coinbase_min_maturity;
uint32_t blockchain_version;
uint64_t future_time_limit;
uint64_t difficulty_block_window;
uint64_t max_block_transaction_weight;
uint64_t pow_algo_count;
uint64_t median_timestamp_count;
uint64_t emission_initial;
size_t n_emission_decay;
uint64_t *emission_decay;
uint64_t emission_tail;
uint64_t min_sha3x_pow_difficulty;
uint64_t block_weight_inputs;
uint64_t block_weight_outputs;
uint64_t block_weight_kernels;
uint64_t faucet_value;
uint64_t max_script_byte_size;
uint64_t validator_node_validity_period;
uint64_t effective_from_height;
Tari__Rpc__Range *valid_blockchain_version_range;
uint64_t max_randomx_seed_height;
size_t n_proof_of_work;
Tari__Rpc__ConsensusConstants__ProofOfWorkEntry **proof_of_work;
Tari__Rpc__WeightParams *transaction_weight;
Tari__Rpc__Range *input_version_range;
Tari__Rpc__OutputsVersion *output_version_range;
Tari__Rpc__Range *kernel_version_range;
size_t n_permitted_output_types;
Tari__Rpc__OutputType *permitted_output_types;
uint64_t epoch_length;
uint64_t validator_node_registration_min_deposit_amount;
uint64_t validator_node_registration_min_lock_height;
uint64_t validator_node_registration_shuffle_interval_epoch;
size_t n_permitted_range_proof_types;
Tari__Rpc__PermittedRangeProofs **permitted_range_proof_types;
};
#define TARI__RPC__CONSENSUS_CONSTANTS__INIT \
{ PROTOBUF_C_MESSAGE_INIT (&tari__rpc__consensus_constants__descriptor) \
, 0, 0, 0, 0, 0, 0, 0, 0, 0,NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0,NULL, NULL, NULL, NULL, NULL, 0,NULL, 0, 0, 0, 0, 0,NULL }
/* Tari__Rpc__Range methods */
void tari__rpc__range__init
(Tari__Rpc__Range *message);
size_t tari__rpc__range__get_packed_size
(const Tari__Rpc__Range *message);
size_t tari__rpc__range__pack
(const Tari__Rpc__Range *message,
uint8_t *out);
size_t tari__rpc__range__pack_to_buffer
(const Tari__Rpc__Range *message,
ProtobufCBuffer *buffer);
Tari__Rpc__Range *
tari__rpc__range__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__range__free_unpacked
(Tari__Rpc__Range *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__Empty methods */
void tari__rpc__empty__init
(Tari__Rpc__Empty *message);
size_t tari__rpc__empty__get_packed_size
(const Tari__Rpc__Empty *message);
size_t tari__rpc__empty__pack
(const Tari__Rpc__Empty *message,
uint8_t *out);
size_t tari__rpc__empty__pack_to_buffer
(const Tari__Rpc__Empty *message,
ProtobufCBuffer *buffer);
Tari__Rpc__Empty *
tari__rpc__empty__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__empty__free_unpacked
(Tari__Rpc__Empty *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__BlockHeight methods */
void tari__rpc__block_height__init
(Tari__Rpc__BlockHeight *message);
size_t tari__rpc__block_height__get_packed_size
(const Tari__Rpc__BlockHeight *message);
size_t tari__rpc__block_height__pack
(const Tari__Rpc__BlockHeight *message,
uint8_t *out);
size_t tari__rpc__block_height__pack_to_buffer
(const Tari__Rpc__BlockHeight *message,
ProtobufCBuffer *buffer);
Tari__Rpc__BlockHeight *
tari__rpc__block_height__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__block_height__free_unpacked
(Tari__Rpc__BlockHeight *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__Signature methods */
void tari__rpc__signature__init
(Tari__Rpc__Signature *message);
size_t tari__rpc__signature__get_packed_size
(const Tari__Rpc__Signature *message);
size_t tari__rpc__signature__pack
(const Tari__Rpc__Signature *message,
uint8_t *out);
size_t tari__rpc__signature__pack_to_buffer
(const Tari__Rpc__Signature *message,
ProtobufCBuffer *buffer);
Tari__Rpc__Signature *
tari__rpc__signature__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__signature__free_unpacked
(Tari__Rpc__Signature *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__ComAndPubSignature methods */
void tari__rpc__com_and_pub_signature__init
(Tari__Rpc__ComAndPubSignature *message);
size_t tari__rpc__com_and_pub_signature__get_packed_size
(const Tari__Rpc__ComAndPubSignature *message);
size_t tari__rpc__com_and_pub_signature__pack
(const Tari__Rpc__ComAndPubSignature *message,
uint8_t *out);
size_t tari__rpc__com_and_pub_signature__pack_to_buffer
(const Tari__Rpc__ComAndPubSignature *message,
ProtobufCBuffer *buffer);
Tari__Rpc__ComAndPubSignature *
tari__rpc__com_and_pub_signature__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__com_and_pub_signature__free_unpacked
(Tari__Rpc__ComAndPubSignature *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__CommitmentSignature methods */
void tari__rpc__commitment_signature__init
(Tari__Rpc__CommitmentSignature *message);
size_t tari__rpc__commitment_signature__get_packed_size
(const Tari__Rpc__CommitmentSignature *message);
size_t tari__rpc__commitment_signature__pack
(const Tari__Rpc__CommitmentSignature *message,
uint8_t *out);
size_t tari__rpc__commitment_signature__pack_to_buffer
(const Tari__Rpc__CommitmentSignature *message,
ProtobufCBuffer *buffer);
Tari__Rpc__CommitmentSignature *
tari__rpc__commitment_signature__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__commitment_signature__free_unpacked
(Tari__Rpc__CommitmentSignature *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__PowAlgorithmConstants methods */
void tari__rpc__pow_algorithm_constants__init
(Tari__Rpc__PowAlgorithmConstants *message);
size_t tari__rpc__pow_algorithm_constants__get_packed_size
(const Tari__Rpc__PowAlgorithmConstants *message);
size_t tari__rpc__pow_algorithm_constants__pack
(const Tari__Rpc__PowAlgorithmConstants *message,
uint8_t *out);
size_t tari__rpc__pow_algorithm_constants__pack_to_buffer
(const Tari__Rpc__PowAlgorithmConstants *message,
ProtobufCBuffer *buffer);
Tari__Rpc__PowAlgorithmConstants *
tari__rpc__pow_algorithm_constants__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__pow_algorithm_constants__free_unpacked
(Tari__Rpc__PowAlgorithmConstants *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__WeightParams methods */
void tari__rpc__weight_params__init
(Tari__Rpc__WeightParams *message);
size_t tari__rpc__weight_params__get_packed_size
(const Tari__Rpc__WeightParams *message);
size_t tari__rpc__weight_params__pack
(const Tari__Rpc__WeightParams *message,
uint8_t *out);
size_t tari__rpc__weight_params__pack_to_buffer
(const Tari__Rpc__WeightParams *message,
ProtobufCBuffer *buffer);
Tari__Rpc__WeightParams *
tari__rpc__weight_params__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__weight_params__free_unpacked
(Tari__Rpc__WeightParams *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__OutputsVersion methods */
void tari__rpc__outputs_version__init
(Tari__Rpc__OutputsVersion *message);
size_t tari__rpc__outputs_version__get_packed_size
(const Tari__Rpc__OutputsVersion *message);
size_t tari__rpc__outputs_version__pack
(const Tari__Rpc__OutputsVersion *message,
uint8_t *out);
size_t tari__rpc__outputs_version__pack_to_buffer
(const Tari__Rpc__OutputsVersion *message,
ProtobufCBuffer *buffer);
Tari__Rpc__OutputsVersion *
tari__rpc__outputs_version__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__outputs_version__free_unpacked
(Tari__Rpc__OutputsVersion *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__PermittedRangeProofs methods */
void tari__rpc__permitted_range_proofs__init
(Tari__Rpc__PermittedRangeProofs *message);
size_t tari__rpc__permitted_range_proofs__get_packed_size
(const Tari__Rpc__PermittedRangeProofs *message);
size_t tari__rpc__permitted_range_proofs__pack
(const Tari__Rpc__PermittedRangeProofs *message,
uint8_t *out);
size_t tari__rpc__permitted_range_proofs__pack_to_buffer
(const Tari__Rpc__PermittedRangeProofs *message,
ProtobufCBuffer *buffer);
Tari__Rpc__PermittedRangeProofs *
tari__rpc__permitted_range_proofs__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__permitted_range_proofs__free_unpacked
(Tari__Rpc__PermittedRangeProofs *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__RangeProof methods */
void tari__rpc__range_proof__init
(Tari__Rpc__RangeProof *message);
size_t tari__rpc__range_proof__get_packed_size
(const Tari__Rpc__RangeProof *message);
size_t tari__rpc__range_proof__pack
(const Tari__Rpc__RangeProof *message,
uint8_t *out);
size_t tari__rpc__range_proof__pack_to_buffer
(const Tari__Rpc__RangeProof *message,
ProtobufCBuffer *buffer);
Tari__Rpc__RangeProof *
tari__rpc__range_proof__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__range_proof__free_unpacked
(Tari__Rpc__RangeProof *message,
ProtobufCAllocator *allocator);
/* Tari__Rpc__ConsensusConstants__ProofOfWorkEntry methods */
void tari__rpc__consensus_constants__proof_of_work_entry__init
(Tari__Rpc__ConsensusConstants__ProofOfWorkEntry *message);
/* Tari__Rpc__ConsensusConstants methods */
void tari__rpc__consensus_constants__init
(Tari__Rpc__ConsensusConstants *message);
size_t tari__rpc__consensus_constants__get_packed_size
(const Tari__Rpc__ConsensusConstants *message);
size_t tari__rpc__consensus_constants__pack
(const Tari__Rpc__ConsensusConstants *message,
uint8_t *out);
size_t tari__rpc__consensus_constants__pack_to_buffer
(const Tari__Rpc__ConsensusConstants *message,
ProtobufCBuffer *buffer);
Tari__Rpc__ConsensusConstants *
tari__rpc__consensus_constants__unpack
(ProtobufCAllocator *allocator,
size_t len,
const uint8_t *data);
void tari__rpc__consensus_constants__free_unpacked
(Tari__Rpc__ConsensusConstants *message,
ProtobufCAllocator *allocator);
/* --- per-message closures --- */
typedef void (*Tari__Rpc__Range_Closure)
(const Tari__Rpc__Range *message,
void *closure_data);
typedef void (*Tari__Rpc__Empty_Closure)
(const Tari__Rpc__Empty *message,
void *closure_data);
typedef void (*Tari__Rpc__BlockHeight_Closure)
(const Tari__Rpc__BlockHeight *message,
void *closure_data);
typedef void (*Tari__Rpc__Signature_Closure)
(const Tari__Rpc__Signature *message,
void *closure_data);
typedef void (*Tari__Rpc__ComAndPubSignature_Closure)
(const Tari__Rpc__ComAndPubSignature *message,
void *closure_data);
typedef void (*Tari__Rpc__CommitmentSignature_Closure)
(const Tari__Rpc__CommitmentSignature *message,
void *closure_data);
typedef void (*Tari__Rpc__PowAlgorithmConstants_Closure)
(const Tari__Rpc__PowAlgorithmConstants *message,
void *closure_data);
typedef void (*Tari__Rpc__WeightParams_Closure)
(const Tari__Rpc__WeightParams *message,
void *closure_data);
typedef void (*Tari__Rpc__OutputsVersion_Closure)
(const Tari__Rpc__OutputsVersion *message,
void *closure_data);
typedef void (*Tari__Rpc__PermittedRangeProofs_Closure)
(const Tari__Rpc__PermittedRangeProofs *message,
void *closure_data);
typedef void (*Tari__Rpc__RangeProof_Closure)
(const Tari__Rpc__RangeProof *message,
void *closure_data);
typedef void (*Tari__Rpc__ConsensusConstants__ProofOfWorkEntry_Closure)
(const Tari__Rpc__ConsensusConstants__ProofOfWorkEntry *message,
void *closure_data);
typedef void (*Tari__Rpc__ConsensusConstants_Closure)
(const Tari__Rpc__ConsensusConstants *message,
void *closure_data);
/* --- services --- */
/* --- descriptors --- */
extern const ProtobufCEnumDescriptor tari__rpc__output_type__descriptor;
extern const ProtobufCEnumDescriptor tari__rpc__range_proof_type__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__range__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__empty__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__block_height__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__signature__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__com_and_pub_signature__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__commitment_signature__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__pow_algorithm_constants__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__weight_params__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__outputs_version__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__permitted_range_proofs__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__range_proof__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__consensus_constants__descriptor;
extern const ProtobufCMessageDescriptor tari__rpc__consensus_constants__proof_of_work_entry__descriptor;
PROTOBUF_C__END_DECLS
#endif /* PROTOBUF_C_types_2eproto__INCLUDED */

4010
external/src/Tari/proto/gRPC/types.pb.cc vendored Normal file

File diff suppressed because it is too large Load diff

5282
external/src/Tari/proto/gRPC/types.pb.h vendored Normal file

File diff suppressed because it is too large Load diff

9
external/src/common/stdalign.h vendored Normal file
View file

@ -0,0 +1,9 @@
#ifndef P2POOL_EXTERNAL_SRC_COMMON_STDALIGN_H
#define P2POOL_EXTERNAL_SRC_COMMON_STDALIGN_H
#if !defined(__cplusplus) && defined(_MSC_VER) && (_MSC_VER < 1930)
#define alignas(x) __declspec(align(x))
#define alignof __alignof
#endif
#endif // P2POOL_EXTERNAL_SRC_COMMON_STDALIGN_H

1
external/src/grpc vendored Submodule

@ -0,0 +1 @@
Subproject commit b330d6bf23768763af41a754ac5b3f6088ab8531

@ -1 +0,0 @@
Subproject commit 8c201f6e47a53feaab773922a743091eb6c8972a

View file

@ -42,6 +42,12 @@
#include <fstream> #include <fstream>
#include <numeric> #include <numeric>
#define GRPC_TEST 0
#if GRPC_TEST
#include "Tari/proto.h"
#endif
LOG_CATEGORY(P2Pool) LOG_CATEGORY(P2Pool)
constexpr int BLOCK_HEADERS_REQUIRED = 720; constexpr int BLOCK_HEADERS_REQUIRED = 720;
@ -61,6 +67,34 @@ p2pool::p2pool(int argc, char* argv[])
, m_startTime(seconds_since_epoch()) , m_startTime(seconds_since_epoch())
, m_lastMinerDataReceived(0) , m_lastMinerDataReceived(0)
{ {
#if GRPC_TEST
{
using namespace tari::rpc;
BaseNode::Stub stub(grpc::CreateChannel("127.0.0.1:18142", grpc::InsecureChannelCredentials()));
grpc::Status status;
NewBlockTemplateResponse response;
{
grpc::ClientContext context;
NewBlockTemplateRequest request;
PowAlgo* algo = new PowAlgo();
algo->set_pow_algo(PowAlgo_PowAlgos_POW_ALGOS_RANDOMX);
request.clear_algo();
request.set_allocated_algo(algo);
request.set_max_weight(1);
status = stub.GetNewBlockTemplate(&context, request, &response);
}
GetNewBlockResult response2;
grpc::ClientContext context2;
status = stub.GetNewBlock(&context2, response.new_block_template(), &response2);
const std::string& s = response2.tari_unique_id();
LOGINFO(0, "Tari unique_id = " << log::hex_buf(s.data(), s.size()));
}
#endif
LOGINFO(1, log::LightCyan() << VERSION); LOGINFO(1, log::LightCyan() << VERSION);
Params* p = new Params(argc, argv); Params* p = new Params(argc, argv);

View file

@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.5) cmake_minimum_required(VERSION 3.5)
project(p2pool_tests) project(p2pool_tests)
include(cmake/standard.cmake)
option(STATIC_LIBS "Use locally built libuv and libzmq static libs" OFF) option(STATIC_LIBS "Use locally built libuv and libzmq static libs" OFF)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake")

View file

@ -0,0 +1,13 @@
set(CMAKE_CXX_EXTENSIONS OFF)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
if(NOT ARCH_ID)
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "")
set(CMAKE_SYSTEM_PROCESSOR ${CMAKE_HOST_SYSTEM_PROCESSOR})
endif()
string(TOLOWER "${CMAKE_SYSTEM_PROCESSOR}" ARCH_ID)
endif()

View file

@ -261,6 +261,29 @@ allowedAPIs = {
"GetConsoleCP", "GetConsoleCP",
"DeleteFileW", "DeleteFileW",
"GetTempPathW", "GetTempPathW",
"WSAConnect",
"WSAGetOverlappedResult",
"GetBestRoute2",
"FreeMibTable",
"GetUnicastIpAddressTable",
"SymFromAddr",
"RegEnumKeyExA",
"RegQueryValueExA",
"RegOpenKeyExA",
"RegGetValueA",
"RegCloseKey",
"GetLocaleInfoEx",
"ExpandEnvironmentStringsA",
"GetWindowsDirectoryA",
"GetVersionExA",
"LoadLibraryW",
"GetCurrentProcessorNumber",
"OutputDebugStringA",
"GetLogicalProcessorInformation",
"InitOnceComplete",
"InitOnceBeginInitialize",
"BCryptOpenAlgorithmProvider",
"BCryptCloseAlgorithmProvider",
} }
f = open(sys.argv[1], 'r') f = open(sys.argv[1], 'r')