Provide a sample project for those people:
- use Linux
- need C++ project (support gcc)
- need bazel construction
- need gRPC and protobuf
- need openssl (version 1.1.1+, or the better option is boringssl)
- need {fmt} for formatting.
- need sqlite3.
- use Visual Studio Code (not have to)
In macOS, homebrew can only install the latest version, please use 3.7.1 for this repo.
export BAZEL_VERSION=3.7.1
mkdir -p ~/tmp
cd ~/tmp
curl -fLO "https://github.com/bazelbuild/bazel/releases/download/${BAZEL_VERSION}/bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh"
chmod +x "bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh"
./bazel-${BAZEL_VERSION}-installer-linux-x86_64.sh --user
echo 'export PATH="$PATH:$HOME/bin"' >> ~/.bashrc
source ~/.bashrc
Install the extension Bazel.
Install the extension vscode-proto3.
git clone https://github.com/lty2226262/demo.git
Open your VS Code, Click File->Open
then choose this repo.
Open terminal in VS Code and run
bazel build --cxxopt='-std=c++17' //...
Open terminal in VS Code and run
bazel test //...
After built, run
cd bazel-bin/src
./server
to launch server.
run
cd bazel-bin/src
./client
for client test
Not availiable now
curl http://49.235.109.193:50001/v3/pay/transactions/id/1217752501201407033233368018?mc