diff --git a/charts/pocket/values.yaml b/charts/pocket/values.yaml index afa383c2f..745e46bfb 100644 --- a/charts/pocket/values.yaml +++ b/charts/pocket/values.yaml @@ -100,6 +100,7 @@ config: use_rain_tree: true is_empty_connection_type: false private_key: "" # @ignored This value is needed but ignored - use privateKeySecretKeyRef instead + # TODO: I think this has been renamed to `max_nonces` max_mempool_count: 100000 enable_peer_discovery_debug_rpc: false telemetry: diff --git a/p2p/module.go b/p2p/module.go index 6bb8f479a..58f64322e 100644 --- a/p2p/module.go +++ b/p2p/module.go @@ -7,6 +7,7 @@ import ( "github.com/libp2p/go-libp2p" libp2pHost "github.com/libp2p/go-libp2p/core/host" + libp2pNetwork "github.com/libp2p/go-libp2p/core/network" "github.com/multiformats/go-multiaddr" "go.uber.org/multierr" "google.golang.org/protobuf/proto" @@ -274,6 +275,11 @@ func (m *p2pModule) GetAddress() (cryptoPocket.Address, error) { return m.address, nil } +// GetConnections implements the respective `modules.P2PModule` interface method. +func (m *p2pModule) GetConnections() []libp2pNetwork.Conn { + return m.host.Network().Conns() +} + // setupDependencies sets up the module's current height and peerstore providers. func (m *p2pModule) setupDependencies() error { if err := m.setupPeerstoreProvider(); err != nil { diff --git a/shared/modules/p2p_module.go b/shared/modules/p2p_module.go index e306d4fd2..097b557cb 100644 --- a/shared/modules/p2p_module.go +++ b/shared/modules/p2p_module.go @@ -3,8 +3,10 @@ package modules //go:generate mockgen -destination=./mocks/p2p_module_mock.go github.com/pokt-network/pocket/shared/modules P2PModule import ( - cryptoPocket "github.com/pokt-network/pocket/shared/crypto" + libp2pNetwork "github.com/libp2p/go-libp2p/core/network" "google.golang.org/protobuf/types/known/anypb" + + cryptoPocket "github.com/pokt-network/pocket/shared/crypto" ) const P2PModuleName = "p2p" @@ -17,6 +19,10 @@ type P2PModule interface { // TECHDEBT(#811): uncomment after moving `typesP2P.Peerstore` interface to a shared package // GetUnstakedPeerstore() (typesP2P.Peerstore, error) + // GetConnections returns a list of all connections between the local libp2p + // host and connected remote peers. + GetConnections() []libp2pNetwork.Conn + // A network broadcast to all staked actors on the network using RainTree Broadcast(msg *anypb.Any) error