I am building a blockchain prototype (github.com/0xpolygon/polygon-sdk) with libp2p as the network stack. I use libp2p to establish the connection and then I run grpc on top of the stream as the communication protocol.
However, I need to do some custom handshake after the connection is established to exchange important metadata and do some validations (i.e. both clients are on the same chain). This is a pre requisite before any other grpc streams can be started.
Is there any support for this kind of behaviour or are there any best practices you would recommend to implement this?