Skip to content

Commit

Permalink
Peer ID that distinguishes agent and gateway
Browse files Browse the repository at this point in the history
Signed-off-by: Poorunga <[email protected]>
  • Loading branch information
Poorunga committed Oct 26, 2023
1 parent 94ef20d commit 89bd940
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/tunnel/module.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,11 @@ func newEdgeTunnel(c *v1alpha1.EdgeTunnelConfig) (*EdgeTunnel, error) {
opts := make([]libp2p.Option, 0) // libp2p options
peerSource := make(chan peer.AddrInfo, c.MaxCandidates)

privKey, err := GenerateKeyPairWithString(c.NodeName)
hostName := c.NodeName
if c.Mode == defaults.ClientMode {
hostName += "-gateway"
}
privKey, err := GenerateKeyPairWithString(hostName)
if err != nil {
return nil, fmt.Errorf("failed to generate private key: %w", err)
}
Expand Down

0 comments on commit 89bd940

Please sign in to comment.