Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some libp2p streams needs to use transient connections #1050

Closed
aarshkshah1992 opened this issue Feb 12, 2021 · 7 comments
Closed

Some libp2p streams needs to use transient connections #1050

aarshkshah1992 opened this issue Feb 12, 2021 · 7 comments
Assignees

Comments

@aarshkshah1992
Copy link
Contributor

aarshkshah1992 commented Feb 12, 2021

Once libp2p/go-libp2p-transport-upgrader#71 and the Limited Relay work by @vyzo lands, streams need to explicitly tell the Swarm(via a context) that they are okay with using Transient connections.

Streams like Identify and the Hole punching streams should use Transient connections as the Hole punching attempt depends on Identify completion.

@aarshkshah1992
Copy link
Contributor Author

aarshkshah1992 commented Feb 12, 2021

cc @vyzo

Now that I think about it, all streams except Identify& Hole-Punch should use non-transient connections. I don't think we are missing much by not talking to DHT peers that are behinds Relays anyways. Wdyt ?

@aarshkshah1992 aarshkshah1992 changed the title Some DHT streams needs to use transient connections Some libp2p streams needs to use transient connections Feb 12, 2021
@marten-seemann
Copy link
Contributor

We now have transient connections and we're using them in some application protocols.

@wanjunlengfeng
Copy link

relayv2.there is a word:check for a limit provided by the relay; if the limit is not nil, then this is a limited.relay connection and we mark the connection as transient.
so I set the value into stat.Transient = false.
"transient connection to peer" dispear .
how do I get the correct set way?

@vyzo
Copy link
Contributor

vyzo commented Feb 23, 2022

use the network.UseTransient context option.

@vyzo
Copy link
Contributor

vyzo commented Feb 23, 2022

but are you sure this is what you want to do?

@wanjunlengfeng
Copy link

wanjunlengfeng commented Feb 23, 2022

when i use relayv2.New(host),Throw an exception “transient connection”.
when i use relayv2.New(host, relayv2.WithLimit(nil)) (set limit=0), all is well.
reservation.LimitData and reservation.LimitDuration =0.
My purpose is to limit the speed, what do I need to do?

@marten-seemann
Copy link
Contributor

@wanjunlengfeng

  1. Please don't hijack issues that have been closed for more than a year.
  2. This is not a bug report nor a feature request. Please refer to the forums: https://discuss.libp2p.io/.

@libp2p libp2p locked as resolved and limited conversation to collaborators Feb 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants