Getting Started

PETAce-Network

Requirements

SystemToolchain
LinuxClang++ (>= 5.0) or GNU G++ (>= 5.5), CMake (>= 3.15)
Optional dependencyTested versionUse
GoogleTest1.12.1For running tests
gRPC1.62.1For agent-assisted network

Building PETAce-Network

We assume that all commands presented below are executed in the root directory of PETAce-Network.

To build PETAce-Network library (optionally with test and example):

cmake -S . -B build -DNETWORK_BUILD_TEST=ON -DNETWORK_BUILD_EXAMPLE=ON
cmake --build build

PETAce-Network supports network agents based on gRPC. Here we provide the following scripts to help users install gRPC. Assume that gRPC is cloned into the directory ${gRPC} and will be installed to the directory ${gRPC_INSTALL_DIR}.

cmake -S . -B build  -DCMAKE_INSTALL_PREFIX=${gRPC_INSTALL_DIR} -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DgRPC_SSL_PROVIDER=package
cmake --build ${gRPC}/build -j
cmake --build ${gRPC}/build --target install

Then, build PETAce-Network library with extra configuration(optionally with test and example):

cmake -B build -S . -DCMAKE_PREFIX_PATH=${gRPC_INSTALL_DIR} -DNETWORK_BUILD_AGENT=ON -DNETWORK_BUILD_TEST=ON -DNETWORK_BUILD_EXAMPLE=ON
cmake --build build

Output binaries can be found in build/lib/ and build/bin/ directories.

Compile OptionsValuesDefaultDescription
CMAKE_BUILD_TYPERelease/DebugReleaseDebug mode decreases run-time performance.
NETWORK_BUILD_SHARED_LIBSON/OFFOFFBuild a shared library if set to ON.
NETWORK_BUILD_EXAMPLEON/OFFONBuild C++ example if set to ON.
NETWORK_BUILD_TESTON/OFFONBuild C++ test if set to ON.
NETWORK_BUILD_DEPSON/OFFONDownload and build unmet dependencies if set to ON.
NETWORK_BUILD_AGENTON/OFFOFFBuild agent-assisted network if set to ON.

Running the PETAce-Network protocol

Here we give a simple example to run our socket protocol.

To run as Party A:

./build/bin/network_example 127.0.0.1 8899 127.0.0.1 8890

To run as Party B:

./build/bin/network_example 127.0.0.1 8890 127.0.0.1 8899