mirror of
https://github.com/luxfi/p2p.git
synced 2026-10-30 15:22:55 +00:00
Update proto definitions to match latest p2p spec. Remove AllChains field from Handshake/GetPeerList messages. Update dependency versions.
43 lines
775 B
Go
43 lines
775 B
Go
// Copyright (C) 2019-2025, Lux Industries, Inc. All rights reserved.
|
|
// See the file LICENSE for licensing terms.
|
|
|
|
package message
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/luxfi/metric"
|
|
"github.com/luxfi/node/utils/compression"
|
|
)
|
|
|
|
var _ Creator = (*creator)(nil)
|
|
|
|
type Creator interface {
|
|
OutboundMsgBuilder
|
|
InboundMsgBuilder
|
|
}
|
|
|
|
type creator struct {
|
|
OutboundMsgBuilder
|
|
InboundMsgBuilder
|
|
}
|
|
|
|
func NewCreator(
|
|
metrics metric.Registerer,
|
|
compressionType compression.Type,
|
|
maxMessageTimeout time.Duration,
|
|
) (Creator, error) {
|
|
builder, err := newMsgBuilder(
|
|
metrics,
|
|
maxMessageTimeout,
|
|
)
|
|
if err != nil {
|
|
return nil, err
|
|
}
|
|
|
|
return &creator{
|
|
OutboundMsgBuilder: newOutboundBuilder(compressionType, builder),
|
|
InboundMsgBuilder: newInboundBuilder(builder),
|
|
}, nil
|
|
}
|