Open p-shahi opened 1 year ago
Here is something similar that tailscale does: https://github.com/tailscale/tailscale/blob/main/tstest/natlab/natlab.go#L737
Do I understand correctly that this should substitute mocknet ? 😃
Do I understand correctly that this should substitute mocknet ? 😃
Yes indeed. Mocknet shouldn't mock the swarm, only connections / streams.
We have a lot of open questions, so removing help wanted for now.
The requirement is ambiguous.
We need to decide whether we want an in memory transport for testing where we can fake IP address and possibly simulate NAT or we want to implement a /memory
transport like the one implemented by rust-libp2p.
/memory
is useful for testing protocols which do not depend on specific remote or local addresses but it cannot be used for testing something like AutoNATv2 without changing the /memory
multiaddress intention. @mxinden is my understanding correct?
The effort required in both the cases seems similar.
/memory
is useful for testing protocols which do not depend on specific remote or local addresses but it cannot be used for testing something like AutoNATv2 without changing the/memory
multiaddress intention. @mxinden is my understanding correct?
That is correct. rust-libp2p's memory transport is very simple with a single uniform address space. It does not have any more complex mechanisms, e.g. NATs.
The effort required in both the cases seems similar.
I would assume the opposite. While I think it is very simple to port rust-libp2p's MemoryTransport
to go-libp2p, I expect building a Transport "where we can fake IP address and possibly simulate NAT" is much harder.
I expect building a Transport "where we can fake IP address and possibly simulate NAT" is much harder.
I think you're right. I'll change my stance to
Building a transport where we fake IP address is a little more work than adding a /memory
transport
simulating NATs is a lot more work.
I think a in-memory transport without faking IP addresses or simulating NATs is still useful for testing protocols.
I think simulating NATs should be a separate task.
I'm going to readd the help wanted label since I think we have a clearer idea of what we want here. Which is essentially the equivalent of rust-libp2p's MemoryTransport
Could I claim this issue? I think it would be a good intro for me to start contributing to go-libp2p
(edit: I am part of PLDG cohort 1)
go for it
Hey @MarcoPolo could you assign issue on me and maybe refer me to someone who could take a look at this
Add an in memory transport (similar to rust-libp2p) which can be used for testing https://docs.rs/libp2p/latest/libp2p/core/transport/struct.MemoryTransport.html