Skip to content

Expose corenet interface#3128

Closed
magik6k wants to merge 7 commits intoipfs:masterfrom
magik6k:feat/corenet
Closed

Expose corenet interface#3128
magik6k wants to merge 7 commits intoipfs:masterfrom
magik6k:feat/corenet

Conversation

@magik6k
Copy link
Member

@magik6k magik6k commented Aug 26, 2016

This implements ipfs/notes#160 and obsoletes #2765

I've tested it manually using two nodes and the connection worked.

defer listener.Close()

for {
remote, err := listener.Accept()
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't found a way to get peer address. Should we left determining peer identity up to applications using this interface or is there actually a way to get peer ID?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the object returned here should be a stream that you can call ID() on (or .Conn().ID())

@whyrusleeping
Copy link
Member

Alright, i think this would be really fun to have merged in.

Heres what I see us possibly doing: We add a config field value or daemon flag for ipfs experimental or ipfs exp. When the flag is enabled, this command gets added under ipfs exp corenet. We should also make it clear in the ipfs exp helptext that commands under it are there solely for experimentation and should not be depended on as they can and will change with a good deal of frequency.

@whyrusleeping
Copy link
Member

The tests are failing because you have the wrong gx import paths, you can use gx deps find go-libp2p-peerstore to check what the right value is for those.

@Kubuxu
Copy link
Member

Kubuxu commented Sep 4, 2016

@whyrusleeping they are now failing because of that as HEAD changed dep.
@magik6k can you update it.

License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
@whyrusleeping
Copy link
Member

I'm pretty happy with this. Will need to run the idea by @jbenet, but this is a pretty cool thing to have (even if its just an experiment)

@Kubuxu
Copy link
Member

Kubuxu commented Sep 6, 2016

Error from teamcity:

[19:41:18][Step 4/4] Listening on [0.0.0.0] (family 0, port 10002)
[19:41:18][Step 4/4] expecting success: 
[19:41:18][Step 4/4]   ipfsi 1 exp corenet dial $PEERID_0 /ip4/127.0.0.1/tcp/10002 corenet-test
[19:41:18][Step 4/4] Listening on [0.0.0.0] (family 0, port 10001)
[19:41:18][Step 4/4] 
[19:41:18][Step 4/4] Error: protocol not supported
[19:41:18][Step 4/4] Dial for server to client
[19:41:18][Dial for server to client] Dial for server to client
[19:41:18][Step 4/4] not ok 11 - Dial for server to client
[19:41:18][Step 4/4] #  
[19:41:18][Step 4/4] #    ipfsi 1 exp corenet dial $PEERID_0 /ip4/127.0.0.1/tcp/10002 corenet-test
[19:41:18][Step 4/4] #  
[19:41:18][Step 4/4] 
[19:41:18][Step 4/4] expecting success: 
[19:41:18][Step 4/4]   kill $LISTENER_PID_PID &&
[19:41:18][Step 4/4]   wait $NC_SERVER_PID $NC_CLIENT_PID
[19:41:18][Step 4/4] 
[19:50:14][Step 4/4] The build go-ipfs::ci_tests_linux #3362 {buildId=5603} has been running for more than 15 minutes. Terminating...
[19:50:14][Step 4/4] Dumping threads before termination:

@Kubuxu
Copy link
Member

Kubuxu commented Sep 6, 2016

Circle is having different errors, something about wrong usage of netcat.

@jbenet
Copy link
Member

jbenet commented Sep 8, 2016

This is a cool idea, lemme review the interface when I'm back on land.

Btw finding a solid way to do this for libp2p would be ideal, and go-ipfs
could inherit the behavior.

Btw, @magik6k check out the plans over at https://github.com/ipfs/xtp --
it's a subproject we want to do. these interfaces MAY be able to relate.
On Tue, Sep 6, 2016 at 9:23 PM Jakub Sztandera notifications@github.com
wrote:

Circle is having different errors, something about wrong usage of netcat.


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#3128 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/AAIcoaFyBzDAOfuyYd9GKuqhb7tYWBZSks5qnbvngaJpZM4JuIuh
.

@whyrusleeping whyrusleeping added the status/in-progress In progress label Sep 10, 2016
@whyrusleeping whyrusleeping mentioned this pull request Sep 14, 2016
7 tasks
License: MIT
Signed-off-by: Łukasz Magiera <magik6k@gmail.com>
@whyrusleeping
Copy link
Member

I'll take a look at these test failures when i get a chance. I want to try and get this in (at least as an experimental feature)

@whyrusleeping whyrusleeping self-assigned this Nov 2, 2016
@whyrusleeping whyrusleeping added status/ready Ready to be worked and removed status/in-progress In progress labels Nov 2, 2016
@tswindell
Copy link
Contributor

tswindell commented Dec 15, 2016

I think we should have the ability for a dial out to setup a local listening port, so client software can connect to it like it would a remote service. The current method requires apps to be listening on both sides, no matter whether it's a listen or a dial call.

Attached my patch
dial-listen-.txt

@magik6k
Copy link
Member Author

magik6k commented Jun 13, 2017

Closing as #3943 got merged

@magik6k magik6k closed this Jun 13, 2017
@Kubuxu Kubuxu removed the status/ready Ready to be worked label Jun 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants