deprecate node p2p config (#3192)

This commit is contained in:
Preston Van Loon 2019-08-13 14:24:09 -04:00 committed by GitHub
parent 4e886a84f9
commit e31792f999
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -192,7 +192,7 @@ func (b *BeaconNode) startDB(ctx *cli.Context) error {
}
func (b *BeaconNode) registerP2P(ctx *cli.Context) error {
beaconp2p, err := configureP2P(ctx)
beaconp2p, err := deprecatedConfigureP2P(ctx)
if err != nil {
return errors.Wrap(err, "could not register p2p service")
}

View File

@ -13,7 +13,8 @@ import (
"github.com/urfave/cli"
)
var topicMappings = map[pb.Topic]proto.Message{
// Deprecated: Do not use. See #3147.
var deprecatedTopicMappings = map[pb.Topic]proto.Message{
pb.Topic_BEACON_BLOCK_ANNOUNCE: &pb.BeaconBlockAnnounce{},
pb.Topic_BEACON_BLOCK_REQUEST: &pb.BeaconBlockRequest{},
pb.Topic_BEACON_BLOCK_REQUEST_BY_SLOT_NUMBER: &pb.BeaconBlockRequestBySlotNumber{},
@ -28,7 +29,8 @@ var topicMappings = map[pb.Topic]proto.Message{
pb.Topic_BEACON_ATTESTATION: &ethpb.Attestation{},
}
func configureP2P(ctx *cli.Context) (*p2p.Server, error) {
// Deprecated: Do not use. See #3147.
func deprecatedConfigureP2P(ctx *cli.Context) (*p2p.Server, error) {
contractAddress := ctx.GlobalString(flags.DepositContractFlag.Name)
if contractAddress == "" {
var err error
@ -65,7 +67,7 @@ func configureP2P(ctx *cli.Context) (*p2p.Server, error) {
adapters = append(adapters, metric.New())
}
for k, v := range topicMappings {
for k, v := range deprecatedTopicMappings {
s.RegisterTopic(k.String(), v, adapters...)
}