mirror of
https://github.com/OffchainLabs/prysm.git
synced 2026-01-09 13:28:01 -05:00
Move p2p to deprecated-p2p (#3191)
* move to deprecated-p2p * fix lint * lint? * fix lint * lint * lint * lint * lint
This commit is contained in:
@@ -17,7 +17,7 @@ go_library(
|
||||
"p2p.go",
|
||||
"service.go",
|
||||
],
|
||||
importpath = "github.com/prysmaticlabs/prysm/shared/p2p",
|
||||
importpath = "github.com/prysmaticlabs/prysm/shared/deprecated-p2p",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//proto/beacon/p2p/v1:go_default_library",
|
||||
@@ -78,7 +78,7 @@ go_test(
|
||||
"//proto/sharding/p2p/v1:go_default_library",
|
||||
"//proto/testing:go_default_library",
|
||||
"//shared:go_default_library",
|
||||
"//shared/p2p/mock:go_default_library",
|
||||
"//shared/deprecated-p2p/mock:go_default_library",
|
||||
"//shared/testutil:go_default_library",
|
||||
"@com_github_gogo_protobuf//io:go_default_library",
|
||||
"@com_github_gogo_protobuf//proto:go_default_library",
|
||||
@@ -3,10 +3,10 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
|
||||
go_library(
|
||||
name = "go_default_library",
|
||||
srcs = ["metric.go"],
|
||||
importpath = "github.com/prysmaticlabs/prysm/shared/p2p/adapter/metric",
|
||||
importpath = "github.com/prysmaticlabs/prysm/shared/deprecated-p2p/adapter/metric",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//shared/p2p:go_default_library",
|
||||
"//shared/deprecated-p2p:go_default_library",
|
||||
"@com_github_gogo_protobuf//proto:go_default_library",
|
||||
"@com_github_prometheus_client_golang//prometheus:go_default_library",
|
||||
"@com_github_prometheus_client_golang//prometheus/promauto:go_default_library",
|
||||
@@ -20,7 +20,7 @@ go_test(
|
||||
embed = [":go_default_library"],
|
||||
deps = [
|
||||
"//proto/eth/v1alpha1:go_default_library",
|
||||
"//shared/p2p:go_default_library",
|
||||
"//shared/deprecated-p2p:go_default_library",
|
||||
"//shared/prometheus:go_default_library",
|
||||
],
|
||||
)
|
||||
@@ -8,7 +8,7 @@ import (
|
||||
"github.com/gogo/protobuf/proto"
|
||||
"github.com/prometheus/client_golang/prometheus"
|
||||
"github.com/prometheus/client_golang/prometheus/promauto"
|
||||
"github.com/prysmaticlabs/prysm/shared/p2p"
|
||||
p2p "github.com/prysmaticlabs/prysm/shared/deprecated-p2p"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
ethpb "github.com/prysmaticlabs/prysm/proto/eth/v1alpha1"
|
||||
"github.com/prysmaticlabs/prysm/shared/p2p"
|
||||
p2p "github.com/prysmaticlabs/prysm/shared/deprecated-p2p"
|
||||
"github.com/prysmaticlabs/prysm/shared/prometheus"
|
||||
)
|
||||
|
||||
@@ -8,7 +8,7 @@ go_library(
|
||||
"broadcaster_mock.go",
|
||||
"feed_mock.go",
|
||||
],
|
||||
importpath = "github.com/prysmaticlabs/prysm/shared/p2p/mock",
|
||||
importpath = "github.com/prysmaticlabs/prysm/shared/deprecated-p2p/mock",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//shared/event:go_default_library",
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/prysmaticlabs/prysm/shared/p2p (interfaces: Broadcaster)
|
||||
// Source: github.com/prysmaticlabs/prysm/shared/deprecated-p2p (interfaces: Broadcaster)
|
||||
|
||||
// Package mock_p2p is a generated GoMock package.
|
||||
package mock_p2p
|
||||
@@ -1,5 +1,5 @@
|
||||
// Code generated by MockGen. DO NOT EDIT.
|
||||
// Source: github.com/prysmaticlabs/prysm/shared/p2p (interfaces: Feed)
|
||||
// Source: github.com/prysmaticlabs/prysm/shared/deprecated-p2p (interfaces: Feed)
|
||||
|
||||
// Package mock_p2p is a generated GoMock package.
|
||||
package mock_p2p
|
||||
@@ -25,10 +25,10 @@ const TagReputation = "prysm-reputation"
|
||||
|
||||
// Adapter is used to create middleware.
|
||||
//
|
||||
// See http://godoc.org/github.com/prysmaticlabs/prysm/shared/p2p#Server.RegisterTopic
|
||||
// See http://godoc.org/github.com/prysmaticlabs/prysm/shared/deprecated-p2p#Server.RegisterTopic
|
||||
type Adapter func(Handler) Handler
|
||||
|
||||
// Handler is a callback used in the adapter/middleware stack chain.
|
||||
//
|
||||
// See http://godoc.org/github.com/prysmaticlabs/prysm/shared/p2p#Server.RegisterTopic
|
||||
// See http://godoc.org/github.com/prysmaticlabs/prysm/shared/deprecated-p2p#Server.RegisterTopic
|
||||
type Handler func(Message)
|
||||
@@ -4,7 +4,7 @@ import (
|
||||
"fmt"
|
||||
|
||||
"github.com/gogo/protobuf/proto"
|
||||
"github.com/prysmaticlabs/prysm/shared/p2p"
|
||||
p2p "github.com/prysmaticlabs/prysm/shared/deprecated-p2p"
|
||||
)
|
||||
|
||||
// A basic adapter will complete its logic then call next. Some adapters
|
||||
@@ -21,7 +21,7 @@ import (
|
||||
shardpb "github.com/prysmaticlabs/prysm/proto/sharding/p2p/v1"
|
||||
testpb "github.com/prysmaticlabs/prysm/proto/testing"
|
||||
"github.com/prysmaticlabs/prysm/shared"
|
||||
p2pmock "github.com/prysmaticlabs/prysm/shared/p2p/mock"
|
||||
p2pmock "github.com/prysmaticlabs/prysm/shared/deprecated-p2p/mock"
|
||||
"github.com/prysmaticlabs/prysm/shared/testutil"
|
||||
"github.com/sirupsen/logrus"
|
||||
logTest "github.com/sirupsen/logrus/hooks/test"
|
||||
@@ -35,7 +35,7 @@ $ go tool trace trace.out
|
||||
#### How to collect additional traces
|
||||
|
||||
We use the OpenCensus library to create traces. To trace the execution of a p2p
|
||||
message through the system, we must define [spans](https://godoc.org/go.opencensus.io/trace#Span) around the code that handles the message. To correlate the trace with other spans defined for the same message, use the context passed inside the [Message](https://godoc.org/github.com/prysmaticlabs/prysm/shared/p2p#Message) struct to create a span:
|
||||
message through the system, we must define [spans](https://godoc.org/go.opencensus.io/trace#Span) around the code that handles the message. To correlate the trace with other spans defined for the same message, use the context passed inside the [Message](https://godoc.org/github.com/prysmaticlabs/prysm/shared/deprecated-p2p#Message) struct to create a span:
|
||||
|
||||
```go
|
||||
var msg p2p.Message
|
||||
|
||||
Reference in New Issue
Block a user