load("@prysm//tools/go:def.bzl", "go_library")
load("@io_bazel_rules_go//go:def.bzl", "go_binary")
load("//tools:prysm_image.bzl", "prysm_image_upload")

go_library(
    name = "go_default_library",
    srcs = ["main.go"],
    importpath = "github.com/OffchainLabs/prysm/v7/tools/eth1exporter",
    visibility = ["//visibility:private"],
    deps = [
        "//runtime/maxprocs:go_default_library",
        "@com_github_ethereum_go_ethereum//common:go_default_library",
        "@com_github_ethereum_go_ethereum//ethclient:go_default_library",
        "@com_github_ethereum_go_ethereum//params:go_default_library",
        "@com_github_sirupsen_logrus//:go_default_library",
    ],
)

go_binary(
    name = "eth1exporter",
    embed = [":go_default_library"],
    visibility = ["//visibility:public"],
)

prysm_image_upload(
    name = "push_images",
    binary = ":eth1exporter",
    entrypoint = ["/eth1exporter"],
    repository = "gcr.io/offchainlabs/prysm/eth1monitor",
    symlinks = {
        # Backwards compatibility for images that depended on the old filepath.
        "/app/tools/eth1exporter/eth1exporter": "/eth1exporter",
    },
    tags = ["manual"],
)
