fn main() -> Result<(), Box<dyn std::error::Error>> {
    let protoc_path = protoc_bin_vendored::protoc_bin_path()?;
    std::env::set_var("PROTOC", protoc_path);

    tonic_build::configure()
        .build_server(true)
        .build_client(true)
        .compile_protos(
            &[
                "src/kvrpc.proto",
                "src/pdpb.proto",
                "src/raft_server.proto",
                "src/chainfire.proto",
                "src/sqlrpc.proto",
            ],
            &["src"], // proto_path
        )?;
    Ok(())
}
