This project is a basic setup for a consensus layer peer-to-peer connection, as specified in the consensus layer specifications of the peer-to-peer interface.
I also made this brief post for my initial research on the topic which you may find complementary for the code.
It is based on the lighthouse client beacon chain networking and examples of basic implementations for both discovery and gossipsub connections, featuring:
After adding a PeerManager we usually manage to maintain a peer count > 0, however most peers still disconnect almost immediately. The reason for this should be investigated and fixed.