Flow C++ SDK For Flow Hackathon
-
Ensure that the required libraries are present and installed.
gcc==9.3.0 g++==9.3.0 cmake==3.16.3 protobuf==3.15.8 grpc==1.40.0 OpenSSL 1.1.1l -
Set environment variables in
~/.bashrc. Ensure that this is the same directory used during the installation ofgrpc.export MY_INSTALL_DIR=$HOME/.local export PATH="$MY_INSTALL_DIR/bin:$PATH" -
Copy the
absldirectory to the install directory.cd grpc sudo cp -r third_party/abseil-cpp/absl $HOME/.local/include -
Clone the project.
git clone https://github.com/QMrpy/flow-cpp-sdk.git -
Build the Flow C++ client. Use
makeifmake -jfails due to out of memory error.cd flow-cpp-sdk mkdir -p cmake/build pushd cmake/build cmake -DCMAKE_PREFIX_PATH=$MY_INSTALL_DIR ../.. make -j popdThe above steps lead to a successful build on Ubuntu WSL2 and Mac OSX Big Sur 11.5. The executable
mainwill be created in thecmake/builddirectory.
-
Start the flow emulator from a terminal, from a directory where a configuration file
flow.jsonis present.flow emulator -
From another terminal, run the binary
main, using the URL of thehostFlow network../main <host>[flow-emulator|flow-mainnet|flow-testnet]