idiomatic way to trigger file requests after dial is complete #4910
-
What is the libp2p idiomatic way to trigger additional requests (in this case, file requests) after successfully dialing another node? Right now I simply sleep for 5 seconds and it works, but I would like to trigger this based on the https://github.com/snowmead/storage-provider-node/blob/main/src/main.rs#L230-L232 Should I move this call to happen inside the |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
|
Beta Was this translation helpful? Give feedback.
The part at after
/p2p
is thePeerId
, so you can extract it from there :)You can add this address first using
add_address
to keep it around and then send requests to thePeerId
andrequest-response
will use the (and other addresses) to make a new connection.