2021-08-14 01:45:11 +00:00
|
|
|
fn config() -> prost_build::Config {
|
|
|
|
let mut config = prost_build::Config::new();
|
|
|
|
config.bytes(&["."]);
|
|
|
|
config
|
|
|
|
}
|
|
|
|
|
|
|
|
fn make_protos(protos: &[&str]) {
|
|
|
|
tonic_build::configure()
|
|
|
|
.compile_with_config(config(), protos, &["."])
|
|
|
|
.unwrap();
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let mut protos = vec!["types/types.proto"];
|
|
|
|
|
|
|
|
if cfg!(feature = "consensus") {
|
|
|
|
protos.push("consensus_engine/consensus.proto");
|
|
|
|
}
|
|
|
|
|
|
|
|
if cfg!(feature = "sentry") {
|
|
|
|
protos.push("p2psentry/sentry.proto");
|
|
|
|
}
|
|
|
|
|
2022-01-07 10:14:21 +00:00
|
|
|
if cfg!(feature = "starknet") {
|
|
|
|
protos.push("starknet/cairo.proto");
|
|
|
|
}
|
|
|
|
|
2021-08-14 01:45:11 +00:00
|
|
|
if cfg!(feature = "remotekv") {
|
|
|
|
protos.push("remote/ethbackend.proto");
|
|
|
|
protos.push("remote/kv.proto");
|
|
|
|
}
|
|
|
|
|
|
|
|
if cfg!(feature = "snapshotsync") {
|
2021-12-14 13:33:32 +00:00
|
|
|
protos.push("downloader/downloader.proto");
|
2021-08-14 01:45:11 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if cfg!(feature = "txpool") {
|
|
|
|
protos.push("txpool/mining.proto");
|
|
|
|
protos.push("txpool/txpool.proto");
|
|
|
|
protos.push("txpool/txpool_control.proto");
|
|
|
|
}
|
|
|
|
|
2021-09-26 12:47:11 +00:00
|
|
|
if cfg!(feature = "web3") {
|
|
|
|
protos.push("web3/common.proto");
|
|
|
|
protos.push("web3/eth.proto");
|
|
|
|
protos.push("web3/trace.proto");
|
|
|
|
}
|
|
|
|
|
2021-08-14 01:45:11 +00:00
|
|
|
make_protos(&protos);
|
|
|
|
}
|