|
|
@ -8,7 +8,6 @@ import ( |
|
|
|
|
|
|
|
|
|
|
|
"github.com/ethereum/go-ethereum/event" |
|
|
|
"github.com/ethereum/go-ethereum/event" |
|
|
|
"github.com/harmony-one/harmony/consensus/engine" |
|
|
|
"github.com/harmony-one/harmony/consensus/engine" |
|
|
|
"github.com/harmony-one/harmony/core" |
|
|
|
|
|
|
|
nodeconfig "github.com/harmony-one/harmony/internal/configs/node" |
|
|
|
nodeconfig "github.com/harmony-one/harmony/internal/configs/node" |
|
|
|
shardingconfig "github.com/harmony-one/harmony/internal/configs/sharding" |
|
|
|
shardingconfig "github.com/harmony-one/harmony/internal/configs/sharding" |
|
|
|
"github.com/harmony-one/harmony/internal/utils" |
|
|
|
"github.com/harmony-one/harmony/internal/utils" |
|
|
@ -17,7 +16,6 @@ import ( |
|
|
|
"github.com/harmony-one/harmony/p2p/stream/common/requestmanager" |
|
|
|
"github.com/harmony-one/harmony/p2p/stream/common/requestmanager" |
|
|
|
"github.com/harmony-one/harmony/p2p/stream/common/streammanager" |
|
|
|
"github.com/harmony-one/harmony/p2p/stream/common/streammanager" |
|
|
|
sttypes "github.com/harmony-one/harmony/p2p/stream/types" |
|
|
|
sttypes "github.com/harmony-one/harmony/p2p/stream/types" |
|
|
|
"github.com/harmony-one/harmony/shard" |
|
|
|
|
|
|
|
"github.com/hashicorp/go-version" |
|
|
|
"github.com/hashicorp/go-version" |
|
|
|
libp2p_host "github.com/libp2p/go-libp2p/core/host" |
|
|
|
libp2p_host "github.com/libp2p/go-libp2p/core/host" |
|
|
|
libp2p_network "github.com/libp2p/go-libp2p/core/network" |
|
|
|
libp2p_network "github.com/libp2p/go-libp2p/core/network" |
|
|
@ -65,7 +63,7 @@ type ( |
|
|
|
Discovery discovery.Discovery |
|
|
|
Discovery discovery.Discovery |
|
|
|
ShardID nodeconfig.ShardID |
|
|
|
ShardID nodeconfig.ShardID |
|
|
|
Network nodeconfig.NetworkType |
|
|
|
Network nodeconfig.NetworkType |
|
|
|
|
|
|
|
BeaconNode bool |
|
|
|
// stream manager config
|
|
|
|
// stream manager config
|
|
|
|
SmSoftLowCap int |
|
|
|
SmSoftLowCap int |
|
|
|
SmHardLowCap int |
|
|
|
SmHardLowCap int |
|
|
@ -78,13 +76,9 @@ type ( |
|
|
|
func NewProtocol(config Config) *Protocol { |
|
|
|
func NewProtocol(config Config) *Protocol { |
|
|
|
ctx, cancel := context.WithCancel(context.Background()) |
|
|
|
ctx, cancel := context.WithCancel(context.Background()) |
|
|
|
|
|
|
|
|
|
|
|
isBeaconNode := config.Chain.ShardID() == shard.BeaconChainShardID |
|
|
|
|
|
|
|
if _, ok := config.Chain.(*core.EpochChain); ok { |
|
|
|
|
|
|
|
isBeaconNode = false |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
sp := &Protocol{ |
|
|
|
sp := &Protocol{ |
|
|
|
chain: config.Chain, |
|
|
|
chain: config.Chain, |
|
|
|
beaconNode: isBeaconNode, |
|
|
|
beaconNode: config.BeaconNode, |
|
|
|
disc: config.Discovery, |
|
|
|
disc: config.Discovery, |
|
|
|
config: config, |
|
|
|
config: config, |
|
|
|
ctx: ctx, |
|
|
|
ctx: ctx, |
|
|
|