Skip to main content

Build

Build Tools

Linux environment configuration refer to Dockerfile

apt update
apt install -y python3 python3-dev gcc-8 g++-8 python-dev libgmp-dev cmake libmysqlclient-dev
apt install -y automake ca-certificates git libtool m4 patch pkg-config unzip make wget curl zip ninja-build npm
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8

npm install -g @bazel/bazelisk

Get the code

git clone https://github.com/primihub/primihub.git

Build

Linux & MacOS

  • Linux Environment: gcc-8,g++-8,python3.7 and higher,python3.7-dev,cmake-3.20
  • Mac Environment: clang 12+,python3.7 and higher,cmake-3.20
./pre_build.sh
make

After build compiling, execute the following command in the root directory of the code to start the node, and its related logs are saved in log_node0, log_node1, log_node2 files respectively

bash start_server.sh

Check the logs, the following will start normally

# tail -f log_node0
...
I20230619 18:53:17.816563 29477 grpc_impl.cc:49] PutMeta to node: [:127.0.0.1:7977:0:] rpc succeeded.
I20230619 18:53:17.817224 29477 main.cc:55] server runing in no tls mode
I20230619 18:53:17.818142 29477 main.cc:86] 💻 Node listening on port: 50050
Apple M1 docker build problems

When building docker images on Apple M1 devices, bazel 5.0.0 will cause build errors, which is a bug in bazel. Specific question see bazel github issue #13925, Need to modify the code .bazelvsersion file contents of 4d900ceea12919ad62012830a95e51f9ec1a48bb

Build FAQ

  1. Bazel build new platform and toolchain issues seeHere

Was this page helpful?

Happy React is loading...