mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-09 11:11:20 +00:00
63308239d9
* begin service for key management * begin defining schema * generate bindings * rev * add in custom compiler * use custom plugin with option * goimports * fix up proto to take in multiple passwords * keymanagent proto edit * rev * rev * dev * builds * comment * indent Co-authored-by: prylabs-bulldozer[bot] <58059840+prylabs-bulldozer[bot]@users.noreply.github.com>
143 lines
5.5 KiB
Python
143 lines
5.5 KiB
Python
load("@rules_proto//proto:defs.bzl", "proto_library")
|
|
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
|
load("@prysm//tools/go:def.bzl", "go_library")
|
|
load("@io_bazel_rules_go//proto:compiler.bzl", "go_proto_compiler")
|
|
|
|
# gazelle:ignore
|
|
proto_library(
|
|
name = "proto",
|
|
srcs = [
|
|
"beacon_chain_service.proto",
|
|
"beacon_debug_service.proto",
|
|
"events_service.proto",
|
|
"node_service.proto",
|
|
"validator_service.proto",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//proto/eth/ext:proto",
|
|
"//proto/eth/v1:proto",
|
|
"//proto/eth/v2:proto",
|
|
"@com_google_protobuf//:descriptor_proto",
|
|
"@com_google_protobuf//:empty_proto",
|
|
"@com_google_protobuf//:timestamp_proto",
|
|
"@go_googleapis//google/api:annotations_proto",
|
|
"@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:event_source_proto",
|
|
],
|
|
)
|
|
|
|
# We create a custom proto library for key_management.proto as it requires a different
|
|
# compiler plugin for grpc gateway than the others. Namely, it requires adding the option
|
|
# --allow_delete_body=true to allow grpc gateway endpoints to take in DELETE HTTP requests
|
|
# with a request body properly.
|
|
proto_library(
|
|
name = "custom_proto",
|
|
srcs = [
|
|
"key_management.proto",
|
|
],
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//proto/eth/ext:proto",
|
|
"//proto/eth/v1:proto",
|
|
"//proto/eth/v2:proto",
|
|
"@com_google_protobuf//:descriptor_proto",
|
|
"@com_google_protobuf//:empty_proto",
|
|
"@com_google_protobuf//:timestamp_proto",
|
|
"@go_googleapis//google/api:annotations_proto",
|
|
"@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:event_source_proto",
|
|
],
|
|
)
|
|
|
|
go_proto_library(
|
|
name = "go_proto",
|
|
compilers = ["@com_github_prysmaticlabs_protoc_gen_go_cast//:go_cast_grpc",],
|
|
importpath = "github.com/prysmaticlabs/prysm/proto/eth/service",
|
|
proto = ":proto",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//proto/eth/ext:go_default_library",
|
|
"//proto/eth/v1:go_default_library",
|
|
"//proto/eth/v2:go_default_library",
|
|
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
|
|
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
|
|
"@com_github_prysmaticlabs_eth2_types//:go_default_library",
|
|
"@go_googleapis//google/api:annotations_go_proto",
|
|
"@com_github_golang_protobuf//proto:go_default_library",
|
|
"@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:go_default_library",
|
|
],
|
|
)
|
|
|
|
go_proto_library(
|
|
name = "custom_go_proto",
|
|
compilers = ["@com_github_prysmaticlabs_protoc_gen_go_cast//:go_cast_grpc",],
|
|
importpath = "github.com/prysmaticlabs/prysm/proto/eth/service",
|
|
proto = ":custom_proto",
|
|
visibility = ["//visibility:public"],
|
|
deps = [
|
|
"//proto/eth/ext:go_default_library",
|
|
"//proto/eth/v1:go_default_library",
|
|
"//proto/eth/v2:go_default_library",
|
|
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
|
|
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
|
|
"@com_github_prysmaticlabs_eth2_types//:go_default_library",
|
|
"@go_googleapis//google/api:annotations_go_proto",
|
|
"@com_github_golang_protobuf//proto:go_default_library",
|
|
"@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:go_default_library",
|
|
],
|
|
)
|
|
|
|
go_proto_compiler(
|
|
name = "allow_delete_body_gateway_compiler",
|
|
plugin = "@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:protoc-gen-grpc-gateway",
|
|
options = ["allow_delete_body=true"],
|
|
)
|
|
|
|
go_proto_library(
|
|
name = "go_grpc_gateway_library",
|
|
compilers = [
|
|
"@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-grpc-gateway:go_gen_grpc_gateway",
|
|
],
|
|
embed = [":go_proto"],
|
|
importpath = "github.com/prysmaticlabs/prysm/proto/eth/service",
|
|
protos = [":proto"],
|
|
visibility = ["//proto:__subpackages__"],
|
|
deps = [
|
|
"//proto/eth/ext:go_default_library",
|
|
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
|
|
"@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto",
|
|
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
|
|
"@go_googleapis//google/api:annotations_go_proto",
|
|
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
|
|
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
|
|
"@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:go_default_library",
|
|
],
|
|
)
|
|
|
|
go_proto_library(
|
|
name = "custom_go_grpc_gateway_library",
|
|
compilers = [
|
|
"allow_delete_body_gateway_compiler",
|
|
],
|
|
embed = [":custom_go_proto"],
|
|
importpath = "github.com/prysmaticlabs/prysm/proto/eth/service",
|
|
protos = [":custom_proto"],
|
|
visibility = ["//proto:__subpackages__"],
|
|
deps = [
|
|
"//proto/eth/ext:go_default_library",
|
|
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
|
|
"@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto",
|
|
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
|
|
"@go_googleapis//google/api:annotations_go_proto",
|
|
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
|
|
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
|
|
"@com_github_grpc_ecosystem_grpc_gateway_v2//proto/gateway:go_default_library",
|
|
],
|
|
)
|
|
|
|
go_library(
|
|
name = "go_default_library",
|
|
embed = [":go_grpc_gateway_library", ":custom_go_grpc_gateway_library"],
|
|
importpath = "github.com/prysmaticlabs/prysm/proto/eth/service",
|
|
visibility = ["//visibility:public"],
|
|
)
|