Update submodules.
git submodule update --init
Install prerequisite for Tachyon by following the instructions.
Install snarkjs.
npm install -g snarkjs@latest
Prepare .bazelrc.user
.
On Linux
echo "build --config linux" > .bazelrc.user
echo "build --@kroma_network_tachyon//:has_openmp" >> .bazelrc.user
echo "build -c opt" >> .bazelrc.user
On Macos ARM64(After M1)
echo "build --config macos_arm64" > .bazelrc.user
echo "build -c opt" >> .bazelrc.user
On Macos x86(Before M1)
echo "build --config macos_x86_64" > .bazelrc.user
echo "build -c opt" >> .bazelrc.user
Sync the rust dependencies.
CARGO_BAZEL_REPIN=1 bazel sync --only=crate_index
bazel run //src/{circuit_dir}:prover_main
{circuit_dir}
should be one of these: adder
, multiplier_2
, multiplier_3
or sha256_512
.
This task is automatically called when running //src/{circuit_dir}:prover_main
, but you can also compile a circuit manually like this example below.
bazel build //circuits/multiplier_2:compile_multiplier_2_main
As a result, these 3 files are generated.
bazel-bin/circuits/multiplier_2/multiplier_2_main.r1cs
bazel-bin/circuits/multiplier_2/multiplier_2_main_cpp/multiplier_2_main.cpp
bazel-bin/circuits/multiplier_2/multiplier_2_main_cpp/multiplier_2_main.dat