2021-06-02 23:49:52 +00:00
|
|
|
##############################################################################
|
|
|
|
# Common
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
load("@rules_proto//proto:defs.bzl", "proto_library")
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# Go
|
|
|
|
##############################################################################
|
|
|
|
# gazelle:ignore
|
|
|
|
load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
|
|
|
load("@io_bazel_rules_go//proto:def.bzl", "go_proto_library")
|
2021-06-24 15:32:30 +00:00
|
|
|
load("//proto:ssz_proto_library.bzl", "ssz_proto_files")
|
2021-06-02 23:49:52 +00:00
|
|
|
load("//tools:ssz.bzl", "SSZ_DEPS", "ssz_gen_marshal")
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# OpenAPI (Swagger) V2
|
|
|
|
##############################################################################
|
|
|
|
load("@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2:defs.bzl", "protoc_gen_openapiv2")
|
|
|
|
|
|
|
|
proto_library(
|
|
|
|
name = "proto",
|
|
|
|
srcs = [
|
|
|
|
"attestation.proto",
|
|
|
|
"beacon_block.proto",
|
|
|
|
"beacon_chain.proto",
|
|
|
|
"node.proto",
|
|
|
|
"validator.proto",
|
|
|
|
# ":generated_swagger_proto",
|
|
|
|
],
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
"//proto/eth/ext:proto",
|
|
|
|
"@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_proto",
|
|
|
|
"@com_google_protobuf//:any_proto",
|
|
|
|
"@com_google_protobuf//:descriptor_proto",
|
|
|
|
"@com_google_protobuf//:empty_proto",
|
|
|
|
"@com_google_protobuf//:timestamp_proto",
|
|
|
|
"@go_googleapis//google/api:annotations_proto",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
##############################################################################
|
|
|
|
# Go
|
|
|
|
##############################################################################
|
|
|
|
ssz_gen_marshal(
|
|
|
|
name = "ssz_generated_files",
|
|
|
|
go_proto = ":go_proto",
|
|
|
|
includes = [
|
|
|
|
"@com_github_prysmaticlabs_eth2_types//:go_default_library",
|
|
|
|
],
|
|
|
|
objs = [
|
|
|
|
"AggregateAttestationAndProof",
|
|
|
|
"Attestation",
|
|
|
|
"AttestationData",
|
|
|
|
"AttesterSlashing",
|
|
|
|
"BeaconBlock",
|
|
|
|
"BeaconBlockHeader",
|
|
|
|
"Checkpoint",
|
|
|
|
"Deposit",
|
|
|
|
"Eth1Data",
|
|
|
|
"IndexedAttestation",
|
|
|
|
"ProposerSlashing",
|
|
|
|
"SignedAggregateAttestationAndProof",
|
|
|
|
"SignedBeaconBlock",
|
|
|
|
"SignedBeaconBlockHeader",
|
|
|
|
"SignedVoluntaryExit",
|
|
|
|
"Validator",
|
|
|
|
"VoluntaryExit",
|
|
|
|
"ContributionAndProof",
|
|
|
|
"SignedContributionAndProof",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
go_proto_library(
|
|
|
|
name = "go_proto",
|
|
|
|
compilers = [
|
|
|
|
"@com_github_prysmaticlabs_protoc_gen_go_cast//:go_cast_grpc",
|
|
|
|
],
|
|
|
|
importpath = "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1",
|
|
|
|
proto = ":proto",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = [
|
|
|
|
"//proto/eth/ext:go_default_library",
|
|
|
|
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
|
|
|
|
"@com_github_golang_protobuf//proto:go_default_library",
|
|
|
|
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
|
|
|
|
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
|
|
|
|
"@org_golang_google_protobuf//types/known/timestamppb:go_default_library",
|
|
|
|
"@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto",
|
|
|
|
"@com_github_prysmaticlabs_go_bitfield//:go_default_library",
|
|
|
|
"@com_github_prysmaticlabs_eth2_types//:go_default_library",
|
|
|
|
"@go_googleapis//google/api:annotations_go_proto",
|
|
|
|
"@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
|
|
|
|
"@org_golang_google_protobuf//runtime/protoimpl:go_default_library",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
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/v1alpha1",
|
|
|
|
protos = [":proto"],
|
|
|
|
visibility = ["//visibility:private"],
|
|
|
|
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",
|
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
go_library(
|
|
|
|
name = "go_default_library",
|
|
|
|
srcs = [
|
|
|
|
":ssz_generated_files", # keep
|
|
|
|
],
|
|
|
|
embed = [
|
|
|
|
":go_grpc_gateway_library",
|
|
|
|
],
|
|
|
|
importpath = "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1",
|
|
|
|
visibility = ["//visibility:public"],
|
|
|
|
deps = SSZ_DEPS + [
|
|
|
|
"//proto/eth/ext:go_default_library",
|
|
|
|
"@com_github_grpc_ecosystem_grpc_gateway_v2//runtime:go_default_library",
|
|
|
|
"@com_github_grpc_ecosystem_grpc_gateway_v2//utilities:go_default_library",
|
|
|
|
"@io_bazel_rules_go//proto/wkt:empty_go_proto",
|
|
|
|
"@org_golang_google_grpc//:go_default_library",
|
|
|
|
"@org_golang_google_grpc//codes:go_default_library",
|
|
|
|
"@org_golang_google_grpc//grpclog:go_default_library",
|
|
|
|
"@org_golang_google_grpc//metadata:go_default_library",
|
|
|
|
"@org_golang_google_grpc//status:go_default_library",
|
|
|
|
"@io_bazel_rules_go//proto/wkt:descriptor_go_proto",
|
|
|
|
"@com_github_golang_protobuf//proto:go_default_library",
|
|
|
|
"@io_bazel_rules_go//proto/wkt:timestamp_go_proto",
|
|
|
|
"@com_github_prysmaticlabs_go_bitfield//:go_default_library", # keep
|
|
|
|
"@go_googleapis//google/api:annotations_go_proto",
|
|
|
|
"@org_golang_google_protobuf//reflect/protoreflect:go_default_library",
|
|
|
|
"@org_golang_google_protobuf//runtime/protoimpl:go_default_library",
|
|
|
|
"@com_github_grpc_ecosystem_grpc_gateway_v2//protoc-gen-openapiv2/options:options_go_proto",
|
|
|
|
], # keep
|
|
|
|
)
|
|
|
|
|
|
|
|
#protoc_gen_openapiv2(
|
|
|
|
# name = "swagger",
|
|
|
|
# json_names_for_fields = True,
|
|
|
|
# proto = ":proto",
|
|
|
|
# single_output = True,
|
|
|
|
# visibility = ["//visibility:public"],
|
|
|
|
#)
|
|
|
|
|
|
|
|
## Genrule for template subsitution.
|
|
|
|
## See documentation in //tools/replacer.
|
|
|
|
#genrule(
|
|
|
|
# name = "generated_swagger_proto",
|
|
|
|
# srcs = [
|
|
|
|
# "swagger.proto", # A go template compatibile file.
|
|
|
|
# "swagger_description.md", # Replacement for description.
|
|
|
|
# ],
|
|
|
|
# outs = ["swagger_generated.proto"],
|
|
|
|
# cmd = "$(location //tools/replacer) $(location swagger.proto) description=$(location swagger_description.md) > $(@)",
|
|
|
|
# tools = ["//tools/replacer"],
|
|
|
|
#)
|